Page 1 of 2
Multiple traps for same host
Posted: Wed Oct 16, 2013 5:02 am
by deepavaidya
Hi,
We have installed NagiosXI 2012 R2.3 trial version. We have done SNMP integration and the traps are working fine. We get the latest trap in the home services detail. But we need traps from different OIDs on the same host service. Is there any other option than NSTI ? Anything which can read from the logs without linking it with MySql. If there is no other option other than NSTI please let us know which version would be compatible with NagiosXI 2012 R2.3.
Re: Multiple traps for same host
Posted: Wed Oct 16, 2013 1:50 pm
by sreinhardt
As mentioned before when you were discussing renaming the snmp trap service, you simply need to use the same hostname\IP and service name to have differing oids come into the same service. The hostname\IP portion is handled via the trap as it is sent it, and since you have traps coming in should not need to be altered further. Then just find the OID in your snmptt.conf and alter the service name if you are not using snmp traps as the service. Otherwise they should all come into thier respective hosts\services based on those two criteria. You can always see if something is not being sent to the correct, or any, host by checking the unconfigured objects page.
Re: Multiple traps for same host
Posted: Thu Oct 17, 2013 12:13 pm
by deepavaidya
Thanks a lot. It worked. But if we have to monitor 200 hosts and each host has to monitor say 50 OIDs then we need to create 50 services for each host ?
Re: Multiple traps for same host
Posted: Thu Oct 17, 2013 1:28 pm
by sreinhardt
Unfortunately, yes if you would like them all able to show individually. An alternative option would be to modify the snmptraphandler.py and have it keep temp files for each host. My thought would be to then keep a temp file that rotates the last 4 traps that came in, and adds them to the end of the current trap that would be sent in.
One other option, that I can't quite suggest at the moment would be NSTI. It is a trap interface that allows for historical logging and views of traps and is very useful. Another admin could see that they have alerts in XI and go to NSTI also to see all past events that are stored. The reason I cannot suggest it at the moment, is that 2.0(the current release) has some dependency issues, that cannot be resolved. We are working on a new version that should be out shortly, although there is not presently a time frame to do so.
Re: Multiple traps for same host
Posted: Tue Dec 10, 2013 9:23 am
by deepavaidya
We are monitoring some traps from HP Chassis. We get traps like fan removed, fan inserted, power supply removed, power supply inserted etc. I have linked the fan OIDs to a single service in nagios XI. So I will get a fan removed trap and when fan is inserted back I will get an ok trap for the same service. but now if more than 1 fan are down/removed in the rack enclosure how is it possible to capture all the traps. Is it possible to create different service for each fan ? But they come from same OID. What kind of customization can be done for this scenario ?
Re: Multiple traps for same host
Posted: Tue Dec 10, 2013 11:49 am
by sreinhardt
Sure is, but you need to include all of that logic in the script that gets exec'd via snmptt. So when a fan trap comes in, you need to see if this is fan 1 or fan 2, and use a different service name for each. It shouldn't be too tricky.
Re: Multiple traps for same host
Posted: Wed Dec 11, 2013 1:10 am
by deepavaidya
Hi,
Just saw in internet that the below bug is fixed.
Fixed bug with multi-line traps (2915658).
Please can you explain what is meant by multi-line traps ? Does it mean we can display more than 1 trap of the same service (same OID ) in the console ? Do we need to create multiple services for same OID ?
Re: Multiple traps for same host
Posted: Wed Dec 11, 2013 8:08 am
by deepavaidya
Hi
'need to include all of that logic in the script that gets exec'd via snmptt'
Please can you let me know which script you are talking about.
Re: Multiple traps for same host
Posted: Wed Dec 11, 2013 5:28 pm
by slansing
Multi line traps are simply traps which contain values on multiple lines, It does not mean that you redirect them to multiple hosts. Traps are only sent from one host, and that host address is what hooks into Nagios and updates service information for your traps.
Re: Multiple traps for same host
Posted: Wed Dec 11, 2013 5:38 pm
by sreinhardt
Generally this would be handled by snmptraphandler.py, however it could be handled by any script that you wish if the script is done correctly. That is totally up to you.