Configuring XI to send a SNMP trap on port 15162

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
thernand
Posts: 8
Joined: Tue Jun 03, 2014 11:19 am

Configuring XI to send a SNMP trap on port 15162

Post by thernand »

Can we setup XI to send SNMP notification Host and service checks on port 15162? How do we configure this?
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Configuring XI to send a SNMP trap on port 15162

Post by ssax »

You can use the Nagios-XI-SNMP-Trap-Sender-Component to specify the port:

https://exchange.nagios.org/directory/A ... nt/details
thernand
Posts: 8
Joined: Tue Jun 03, 2014 11:19 am

Re: Configuring XI to send a SNMP trap on port 15162

Post by thernand »

We use version 1.4 of the SNMP trap Sender component and I do not see where you can configure the port. Is there a way to do it with this version?
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Configuring XI to send a SNMP trap on port 15162

Post by ssax »

There is not, are you not able to upgrade the component to 1.5?
thernand
Posts: 8
Joined: Tue Jun 03, 2014 11:19 am

Re: Configuring XI to send a SNMP trap on port 15162

Post by thernand »

Not at this time because of the way the company does the XI install.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Configuring XI to send a SNMP trap on port 15162

Post by ssax »

We might be able to hack it together, I'll take a look on Monday, if you don't hear from me by midday on Monday, send me a reply on here.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Configuring XI to send a SNMP trap on port 15162

Post by ssax »

Edit this file:

Code: Select all

/usr/local/nagiosxi/html/includes/components/snmptrapsender/snmptrapsender.inc.php
Around line 420 you'll see this line:

Code: Select all

$trap_command = "/usr/bin/snmptrap -v 2c -c $community $address '' NAGIOS-NOTIFY-MIB::nSvcEvent nSvcHostname s \"%host%\" nSvcDesc s \"%service%\" nSvcStateID i %servicestateid% nSvcOutput s \"%serviceoutput%\"";
Change:

Code: Select all

$address
To:

Code: Select all

${address}:15162
Then it should work for you.
Locked