0

Suppose we have 3 servers A, B and C. A is our monitoring server. I'm trying to find an OID on server B to ping server C to find out whether server C is reachable from point of view of server B. I found this OID in IBM Knowledge Center. Is there an OID of doing this in LINUX?

Thanks in advance

  • If you can't find a built-in method of doing this, you can easily extend SNMP with a script which gets executed whenever you poll a certain OID. – EEAA Jun 29 '17 at 14:36

1 Answers1

0

Finally, I have used NET-SNMP-EXTEND-MIB and also I wrote a ping script which takes IP as its argument.

snmpset -v2c -c public  -m +NET-SNMP-EXTEND-MIB localhost 'nsExtendStatus."remotePing"'  = createAndGo 'nsExtendCommand."remotePing"' = /etc/snmp/scripts/pingScript.sh 'nsExtendArgs."remotePing"' = 'google.com'

Don't forget to place pingScript.sh file under /etc/snmp/scripts. Here I entered google.com as default then from my program I change this literal with appropriate IP address at runtime. By getting nsExtendOutput1Table.nsExtendOutputFull it is possible to read the ping time or whatever your scripts returns.