Page 1 of 1

SNMPTrapSender Customization

Posted: Thu Mar 30, 2017 1:09 pm
by vaibhavdaud
Hi Team,

We are looking a way to automate SnmpTrap send to the third party tool. Requirement is that if some condition met Nagios should stop sending traps from one server and start from second server. We write a script and its doing the changes in “snmptrapsender.inc.php” file. Its doing change “enabled, 0 or enabled, 1”, but thing is sometimes Nagios can’t understand the changes whenever we go to console, snmptrap component and apply the changes. We are using RHEL 7.2 3.10.0-327.36.3.el7.x86_64 x86_64. Nagios XI 5.4.0. SnmpTrap sender 1.5.3
Can you suggest on below.
1) How we can add or change all details ie. IP, community, port etc. through backend to snmptrap sender instead of console
2) How to refresh changes if do some in snmptrapsender.inc.php
3) Is other way to send snmptrap instead to use component
4) Where Nagios store the given input ie. IP, community etc. We cannot see it in snmptrapsender.inc.php

Thanks,

Re: SNMPTrapSender Customization

Posted: Thu Mar 30, 2017 4:04 pm
by ssax
1) How we can add or change all details ie. IP, community, port etc. through backend to snmptrap sender instead of console
2) How to refresh changes if do some in snmptrapsender.inc.php
4) Where Nagios store the given input ie. IP, community etc. We cannot see it in snmptrapsender.inc.php

The trap sender component data is stored in the nagiosxi database in the xi_options table, we do not recommend that you interact directly with the DB though.

Please post the output of this command:

Code: Select all

grep mysql /usr/local/nagiosxi/html/config.inc.php
Unfortunately, there is no inherent functionality that does what you're looking for.

3) Is other way to send snmptrap instead to use component

Yes, you can use Admin > Manage Components > Global Event Handler > Settings and write a script that will send the traps, you could also do it with standard event handlers but you would have to define them on all of the hosts/services.


Let us know if you have any questions.


Thank you