Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed API usage (includes PR#54, PR#71, PR#74) #78

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

adn77
Copy link

@adn77 adn77 commented Oct 17, 2024

Sorry I didn't create a separate branch for my changes :(
This is only a diff from my running production code, hence PR#54, PR#71, PR#74 are included.

I mostly fixed the rule handling to use API calls.

There're some additional notes in the config dialog about IDO_DB failing and trapd not listening on port 162 when trapdirector is run in a different Docker container.

@abrenner94
Copy link

Hi @adn77 . Do you know how to get trapdirector running wihthout an IDO database?
We followed the latest installation procedure of icingaweb2 and icinga direcotr, where IDO is not used anymore.
Thanks!

@adn77
Copy link
Author

adn77 commented Jan 8, 2025

I compiled the patches in order not to use IDO anymore. You can basically follow the documentation below the module configuration (I used the manual installation steps). Then simply set the IDO-Database dropdown to the Trapdirector Database (in case some legacy code is trying to use it).
It's working for me, that's why I created this PR 😄

@abrenner94
Copy link

abrenner94 commented Jan 8, 2025

Yes, I used your version, but I am facing this messages in trapdirector.
Do you also have the warning regarding the ido database?

image

Ok, looks like I am facing the same issue as another use here
We are using PHP v8.1.2-1
#79

Do you have a solution for this?

@adn77
Copy link
Author

adn77 commented Jan 8, 2025

I tried "fixing" the error message by adding "default to API use" and making it only a warning 😃
All is fine, this is intended. I am also running on PHP8.

@abrenner94
Copy link

abrenner94 commented Jan 8, 2025

Ah okay. So if the API part is "OK" everything is fine? so i could choose every database in IDO field, it wouldn't change anything?

My problem is, that MIBs are loaded, and i try to send the test trap command, but i don't see them in the Received tab.
snmptrap -v 1 -c public localhost SNMPv2-MIB::coldStart localhost 2 0 ""

@adn77
Copy link
Author

adn77 commented Jan 8, 2025

Ah okay. So if the API part is "OK" everything is fine? so i could choose every database in IDO field, it wouldn't change anything?

Right, the IDO-database can be anything - the check will just fail. I didn't know any better and didn't want to remove the IDO code as some people might still rely on it. If API is configured, you're all set!

My problem is, that MIBs are loaded, and i try to send the test trap command, but i don't see them in the Received tab. snmptrap -v 1 -c public localhost SNMPv2-MIB::coldStart localhost 2 0 ""

Check if the traphandler is working correctly:
echo -e "localhost\n.DP: [8.8.8.8]:123->[127.0.0.1]:161\n.1.3.6.1.6.3.1.1.4.1.0 .1.3.6.1.6.3.1.1.4.1" | /usr/bin/php /data/etc/icingaweb2/enabledModules/trapdirector/bin/trap_in.php
This should show up under received traps.

If it's working, you need to check the traphandler configuration.

@abrenner94
Copy link

Yes, with your command it will be displayed in icinga.
Could you provide me your start parameters of snmptrapd service and your config file of snmptrapd?

@adn77
Copy link
Author

adn77 commented Jan 9, 2025

My command-line is:

  • -Lo (log output to stdout)
  • -Oen (output as numeric OIDs with symbolic labels from enumeration values removed; -On might suffice )
  • -n (don't translate source addresses of incoming packets into hostnames)
  • -t (disables logging to syslog)
    (http://www.net-snmp.org/docs/man/snmpcmd.html)

Make sure, your /etc/snmp/snmptrapd.conf is correct:

authCommunity log,execute,net public
traphandle default /usr/bin/php /data/etc/icingaweb2/enabledModules/trapdirector/bin/trap_in.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants