Can we change this information?

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
phyo
Posts: 162
Joined: Sun Dec 01, 2013 10:50 pm

Can we change this information?

Post by phyo »

Hi all,

We monitored Cisco Catalyst 4510+E switch ports status via SNMP Traps. We want to edit the status information.

Image

Instead of this information, I want to show "GigabitEhternet2/2/7:UP".

Can we change it?

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

Re: Can we change this information?

Post by sreinhardt »

You can absolutely change it, that can be handled either in how the trap is interpreted in snmptt.conf with the exec line, or in the snmptrapsender.py script that ends up forwarding the trap to nagios via nagios.cmd file. However my guess is that this is a single string from the trap and would need to be regexed or something similar to mangle it how you would like.
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.
b2m
Posts: 71
Joined: Tue Jun 11, 2013 9:18 am

Re: Can we change this information?

Post by b2m »

Hi,

no there is no RegEx necessary in this case. I changed my /etc/snmp/snmptt.conf to

Code: Select all

...
EVENT linkDown .1.3.6.1.6.3.1.1.5.3 "Status Events" Warning
FORMAT A linkDown trap signifies that the SNMP entity, acting in $*
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "Interface $2" "linkDown"
SDESC
A linkDown trap signifies that the SNMP entity, acting in
an agent role, has detected that the ifOperStatus object for
one of its communication links is about to enter the down
state from some other state (but not from the notPresent
state).  This other state is indicated by the included value
of ifOperStatus.
Variables:
  1: ifIndex
  2: ifAdminStatus
  3: ifOperStatus
EDESC
#
#
#
EVENT linkUp .1.3.6.1.6.3.1.1.5.4 "Status Events" Normal
FORMAT A linkUp trap signifies that the SNMP entity, acting in an $*
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "Interface $2" "linkUp"
SDESC
A linkUp trap signifies that the SNMP entity, acting in an
agent role, has detected that the ifOperStatus object for
one of its communication links left the down state and
transitioned into some other state (but not into the
notPresent state).  This other state is indicated by the
included value of ifOperStatus.
Variables:
  1: ifIndex
  2: ifAdminStatus
  3: ifOperStatus
EDESC
...
Nagios will show the traps as "linkUp / Interface TenGigE0/0/0/6" for example. We have tested this with Cisco IOS / IOS XR Switches / Routers.

Best wishes

b2m
phyo
Posts: 162
Joined: Sun Dec 01, 2013 10:50 pm

Re: Can we change this information?

Post by phyo »

Thanks b2m.

I just followed your guide. Then the status information changed to what I want to see.
SNMP Traps Ok 2m 44s 1/1 2014-03-20 16:33:40 LinkUp / Interface GigabitEthernet2/2/6
Have a nice day!
Locked