How to remove SNMP trap destination IP via command line

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
babygen
Posts: 7
Joined: Tue Jun 04, 2013 10:59 pm

How to remove SNMP trap destination IP via command line

Post by babygen »

Hi,

How to remove SNMP trap destination IP via command line? I can only see SNMP Send trap document done via GUI. What config file can I edit?

Thanks,
BabyGen
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: How to remove SNMP trap destination IP via command line

Post by sreinhardt »

Could you please explain in more detail what you are looking to do?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
babygen
Posts: 7
Joined: Tue Jun 04, 2013 10:59 pm

Re: How to remove SNMP trap destination IP via command line

Post by babygen »

Hi,

Currently, I have a problem with the GUI. I lost all the data in GUI but since the config is still there, my monitoring is still working and sending alerts to snmp trap destination NM1 and NM2 (Nagios -> NM1 and NM2 IPs).

I need to remove IP address of NM2 where Nagios is sending the traps so only NM1 will be active. I cannot do it via GUI (SNMP Trap Sender) since nothing is there. Is it possible to remove snmp trap destination NM2 in the config file? What config file is the snmp trap destination IPs saved? I tried to look at nagios.cfg file, I don't see the NM IP there.

Thanks so much for your help! I hope there is another way of removing the IP not going thru the GUI.

Regards,
BabyGen
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: How to remove SNMP trap destination IP via command line

Post by sreinhardt »

I will have to check with our devs to see where nsti would have this configured. I should also ask, what version of nsti are you using?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
babygen
Posts: 7
Joined: Tue Jun 04, 2013 10:59 pm

Re: How to remove SNMP trap destination IP via command line

Post by babygen »

Hi,

I am not sure of the version and if it's installed. Version of Nagios is quite old Nagios XI 2009R1.3E and I am using Centos 6.2. What command can I use to find nsti?

Thank you.

Regards,
BabyGen
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: How to remove SNMP trap destination IP via command line

Post by sreinhardt »

It should say on the nsti interface, otherwise if you can tell me where it is installed, I likely could tell you which version you are on from that too.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
babygen
Posts: 7
Joined: Tue Jun 04, 2013 10:59 pm

Re: How to remove SNMP trap destination IP via command line

Post by babygen »

Hi,

Looks like it's not there. I checked I don't have /etc/init.d/nsti and http://<server ip>/nsti gives Not found error. Is it possible it's not installed?

Thanks you.

Regards,
BabyGen
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: How to remove SNMP trap destination IP via command line

Post by sreinhardt »

Well, you posted in nsti, so are you really just using snmptt and nagios xi/nagios core? If so I can just move this to the relevant forum, but that is why I asked what nsti version you were on. As for removing the destination IP in this case, it would probably be easiest to remove this via the snmptt.conf file and modify the exec line to not forward that data to your nagios system.(presuming that is what you want)
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
babygen
Posts: 7
Joined: Tue Jun 04, 2013 10:59 pm

Re: How to remove SNMP trap destination IP via command line

Post by babygen »

Sorry about the confusion on nsti. I am just using snmptt and nagios core.

I still want the alerts to be sent to Nagios.

Server sends alerts to Nagios and Nagios forwards to NM1 and NM2. From Nagios, I wanted to remove IP of NM2 where Nagios forwards the alerts.
Server -> Nagios -> NM1 and NM2

I do not see NM1 and NM2 IP address in snmptt.conf file.

Thanks.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: How to remove SNMP trap destination IP via command line

Post by sreinhardt »

It sounds like you need to actaully modify the notification command to omit the ip\hostname or a portion of the message being sent. The reason I say this opposed to modifying it within snmptt is that doing it in snmptt would likely make nagios not understand what host and service it is intended for. Could you give an example of the notification from nagios and what you would actually like to see? Also if you could include the notification command that nagios uses to send to nm1\2 it would be helpful.
Last edited by sreinhardt on Fri Mar 07, 2014 11:56 am, edited 1 time in total.
Reason: Topic moved to core
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Locked