Re: How to remove SNMP trap destination IP via command line
Posted: Sun Mar 09, 2014 10:35 pm
Hi,
Below is the sample trap. Nagios sends to 192.168.10.188 (NM1) and .189 (NM2).
I need to remove .189. Is there a standard script or file where I can remove this? Thank you.
==========================start ================
event_id = 642667
event_source = 2
event_type = 1
event_time = 2013-02-28 11:22:42
event_meta = Array
==========================start ================
192.168.10.188
public
/usr/bin/snmptrap -v 2c -c public 192.168.10.188 '' NAGIOS-NOTIFY-MIB::nSvcNotify nSvcNotifyType s "%type%" nSvcNotifyNum i %servicenot
ificationnumber% nSvcAckAuthor s "%ackAuthor%" nSvcAckComment s "%svcackcomment%" nHostname s "%host%" nHostStateID i %hoststateid%
nSvcDesc s "%service%" nSvcStateID i %servicestateid% nSvcAttempt i %currentattempt% nSvcDurationSec i %servicedurationsec% nSvcGroupNa
me s "%servicegroupname%" nSvcLastCheck i %lastservicecheck% nSvcLastChange i %lastservicestatechange% nSvcOutput s "%service% %servi
cestate% %serviceoutput%"
handler-type = service
Processes Command
/usr/bin/snmptrap -v 2c -c public 192.168.10.188 '' NAGIOS-NOTIFY-MIB::nSvcNotify nSvcNotifyType s "" nSvcNotifyNum i 1 nSvcAckAuthor
s "" nSvcAckComment s "" nHostname s "TS-03" nHostStateID i 0 nSvcDesc s "RAM Status" nSvcStateID i 1 nSvcAttempt i 3 nSvcD
urationSec i 659 nSvcGroupName s "$" nSvcLastCheck i 1362021729 nSvcLastChange i 1362021103 nSvcOutput s "RAM Status WARNING RAM WARN
ING - 73% (6094 of 8257 MB) used"
==========================end ================
==========================start ================
192.168.10.189
public
/usr/bin/snmptrap -v 2c -c public 192.168.10.189 '' NAGIOS-NOTIFY-MIB::nSvcNotify nSvcNotifyType s "%type%" nSvcNotifyNum i %servicenot
ificationnumber% nSvcAckAuthor s "%ackAuthor%" nSvcAckComment s "%svcackcomment%" nHostname s "%host%" nHostStateID i %hoststateid%
nSvcDesc s "%service%" nSvcStateID i %servicestateid% nSvcAttempt i %currentattempt% nSvcDurationSec i %servicedurationsec% nSvcGroupNa
me s "%servicegroupname%" nSvcLastCheck i %lastservicecheck% nSvcLastChange i %lastservicestatechange% nSvcOutput s "%service% %servi
cestate% %serviceoutput%"
handler-type = service
Processes Command
/usr/bin/snmptrap -v 2c -c public 192.168.10.189 '' NAGIOS-NOTIFY-MIB::nSvcNotify nSvcNotifyType s "" nSvcNotifyNum i 1 nSvcAckAuthor
s "" nSvcAckComment s "" nHostname s "TS-03" nHostStateID i 0 nSvcDesc s "RAM Status" nSvcStateID i 1 nSvcAttempt i 3 nSvcD
urationSec i 659 nSvcGroupName s "$" nSvcLastCheck i 1362021729 nSvcLastChange i 1362021103 nSvcOutput s "RAM Status WARNING RAM WARN
ING - 73% (6094 of 8257 MB) used"
==========================end ================
Below is the sample trap. Nagios sends to 192.168.10.188 (NM1) and .189 (NM2).
I need to remove .189. Is there a standard script or file where I can remove this? Thank you.
==========================start ================
event_id = 642667
event_source = 2
event_type = 1
event_time = 2013-02-28 11:22:42
event_meta = Array
==========================start ================
192.168.10.188
public
/usr/bin/snmptrap -v 2c -c public 192.168.10.188 '' NAGIOS-NOTIFY-MIB::nSvcNotify nSvcNotifyType s "%type%" nSvcNotifyNum i %servicenot
ificationnumber% nSvcAckAuthor s "%ackAuthor%" nSvcAckComment s "%svcackcomment%" nHostname s "%host%" nHostStateID i %hoststateid%
nSvcDesc s "%service%" nSvcStateID i %servicestateid% nSvcAttempt i %currentattempt% nSvcDurationSec i %servicedurationsec% nSvcGroupNa
me s "%servicegroupname%" nSvcLastCheck i %lastservicecheck% nSvcLastChange i %lastservicestatechange% nSvcOutput s "%service% %servi
cestate% %serviceoutput%"
handler-type = service
Processes Command
/usr/bin/snmptrap -v 2c -c public 192.168.10.188 '' NAGIOS-NOTIFY-MIB::nSvcNotify nSvcNotifyType s "" nSvcNotifyNum i 1 nSvcAckAuthor
s "" nSvcAckComment s "" nHostname s "TS-03" nHostStateID i 0 nSvcDesc s "RAM Status" nSvcStateID i 1 nSvcAttempt i 3 nSvcD
urationSec i 659 nSvcGroupName s "$" nSvcLastCheck i 1362021729 nSvcLastChange i 1362021103 nSvcOutput s "RAM Status WARNING RAM WARN
ING - 73% (6094 of 8257 MB) used"
==========================end ================
==========================start ================
192.168.10.189
public
/usr/bin/snmptrap -v 2c -c public 192.168.10.189 '' NAGIOS-NOTIFY-MIB::nSvcNotify nSvcNotifyType s "%type%" nSvcNotifyNum i %servicenot
ificationnumber% nSvcAckAuthor s "%ackAuthor%" nSvcAckComment s "%svcackcomment%" nHostname s "%host%" nHostStateID i %hoststateid%
nSvcDesc s "%service%" nSvcStateID i %servicestateid% nSvcAttempt i %currentattempt% nSvcDurationSec i %servicedurationsec% nSvcGroupNa
me s "%servicegroupname%" nSvcLastCheck i %lastservicecheck% nSvcLastChange i %lastservicestatechange% nSvcOutput s "%service% %servi
cestate% %serviceoutput%"
handler-type = service
Processes Command
/usr/bin/snmptrap -v 2c -c public 192.168.10.189 '' NAGIOS-NOTIFY-MIB::nSvcNotify nSvcNotifyType s "" nSvcNotifyNum i 1 nSvcAckAuthor
s "" nSvcAckComment s "" nHostname s "TS-03" nHostStateID i 0 nSvcDesc s "RAM Status" nSvcStateID i 1 nSvcAttempt i 3 nSvcD
urationSec i 659 nSvcGroupName s "$" nSvcLastCheck i 1362021729 nSvcLastChange i 1362021103 nSvcOutput s "RAM Status WARNING RAM WARN
ING - 73% (6094 of 8257 MB) used"
==========================end ================