How are Traps assigned to hosts in Nagios?

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
evisus
Posts: 82
Joined: Tue Apr 26, 2016 1:19 pm

How are Traps assigned to hosts in Nagios?

Post by evisus »

Hi!!

I would like to know what is the criteria for assigning the traps configured in Nagios XI to the host, I have read the documentation but I do not understand well if the IP address or the host name is used.

For example:
In the non-configured objects I receive the following Traps

10.206.10.12 SNMP Traps (see attached)

When using the Wizard, the Snmp Traps service is created in Host = 10.203.0.12 and IP = 10.203.0.12. What happens if I change the name of the Host to "Server_1" but I keep the IP address? Will the Traps continue arriving at the same Host?

Thanks
You do not have the required permissions to view the files attached to this post.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: How are Traps assigned to hosts in Nagios?

Post by tgriep »

If the settings are default for the snmptt daemon, it should resolve the host name if the IP address is setup in DNS.

But, the default command that sends the trap to Nagios XI, it only passes the IP address.
To pass the Host Name to XI, you would have to edit the /etc/snmp/snmptt.conf file and change all of the EXEC lines from

Code: Select all

EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "Link down on interface $1. Admin state: $2. Operational state: $3"
to

Code: Select all

EXEC /usr/local/bin/snmptraphandling.py "$A" "SNMP Traps" "$s" "$@" "$-*" "Link down on interface $1. Admin state: $2. Operational state: $3"
Mainly change the $r to $A so it will pass the hostname and not the IP.

That will make the server receive names and not addresses.

And to answer your question, the trap will continue to come in as an IP address so renaming the host probably will not work.
Be sure to check out our Knowledgebase for helpful articles and solutions!
evisus
Posts: 82
Joined: Tue Apr 26, 2016 1:19 pm

Re: How are Traps assigned to hosts in Nagios?

Post by evisus »

thanks for your answer, it is clear to me
kyang

Re: How are Traps assigned to hosts in Nagios?

Post by kyang »

@evisus Great! Did you have any more questions or are we okay to close this thread?
evisus
Posts: 82
Joined: Tue Apr 26, 2016 1:19 pm

Re: How are Traps assigned to hosts in Nagios?

Post by evisus »

I'm fine, thank you, you can close this thread
kyang

Re: How are Traps assigned to hosts in Nagios?

Post by kyang »

Sounds good! I'll be closing this thread!

If you have any more questions, feel free to create another thread.

Thanks for using the Nagios Support Forum!
Locked