TECHZEN Zenoss User Community ARCHIVE  

Getting exit code and string from SNMP data source

Subject: Getting exit code and string from SNMP data source
Author: [Not Specified]
Posted: 2014-12-03 08:10

I want to get a string error with notification via SNMP.

I had created MIB which execute a script:

#!/bin/sh

if [ mycommand ]
then
echo 'some error'
exit 2
fi
exit 0

Result of MIB:

SNMPv2-SMI::enterprises.982.4.1.0 = INTEGER: 1
SNMPv2-SMI::enterprises.982.4.2.1.2.6.97.115.116.108.111.103 = STRING: "/script.sh"
SNMPv2-SMI::enterprises.982.4.2.1.3.6.97.115.116.108.111.103 = ""
SNMPv2-SMI::enterprises.982.4.2.1.4.6.97.115.116.108.111.103 = ""
SNMPv2-SMI::enterprises.982.4.2.1.5.6.97.115.116.108.111.103 = INTEGER: 5
SNMPv2-SMI::enterprises.982.4.2.1.6.6.97.115.116.108.111.103 = INTEGER: 1
SNMPv2-SMI::enterprises.982.4.2.1.7.6.97.115.116.108.111.103 = INTEGER: 1
SNMPv2-SMI::enterprises.982.4.2.1.20.6.97.115.116.108.111.103 = INTEGER: 4
SNMPv2-SMI::enterprises.982.4.2.1.21.6.97.115.116.108.111.103 = INTEGER: 1
SNMPv2-SMI::enterprises.982.4.3.1.1.6.97.115.116.108.111.103 = STRING: "some error"
SNMPv2-SMI::enterprises.982.4.3.1.2.6.97.115.116.108.111.103 = STRING: "some error"
SNMPv2-SMI::enterprises.982.4.3.1.3.6.97.115.116.108.111.103 = INTEGER: 1
SNMPv2-SMI::enterprises.982.4.3.1.4.6.97.115.116.108.111.103 = INTEGER: 2
SNMPv2-SMI::enterprises.982.4.4.1.2.6.97.115.116.108.111.103.1 = STRING: "some error"

It is possible to get it work on Zenoss How to handle exit code with a message



Subject: I hate to suggest this as it
Author: Andrew Kirch
Posted: 2014-12-08 16:06

I hate to suggest this as it's a bit lame, hack the script to always return 1, then hack it to always return 0, see what changes, I'm betting you're looking for SNMPv2-SMI::enterprises.982.4.1.0

Andrew Kirch

akirch@gvit.com

Need Zenoss support, consulting or custom development Look no further. Email or PM me!

Ready for Distributed Topology (collectors) for Zenoss 5 Coming May 1st from GoVanguard



< Previous
Zenoss refusing to load after power failure(A Zenoss error has occurred)
  Next
events won't load when selecting tree in Infrastructure view
>