Page 2 of 2

Re: how to create services of various OIDs of a mib file in

Posted: Fri Apr 10, 2015 1:21 am
by alef1_nagiosxi
These oids are custom for AlefmobitechProducts and represents various KPIs for Cache and Packet processing modules.

Please suggest me how to use such custom wrapper script to strip off "c" character from last.

See this below logs

2015-04-08 11:10:26 [10146] [1] Found Performance Data for CacheServerDevKol / alefCacheJpegBytesIn (SNMPv2-SMI::enterprises.45390.1.3.1.12.1.1.3.0=1736441c)

Please suggest,

Thanks
Rajesh

Re: how to create services of various OIDs of a mib file in

Posted: Fri Apr 10, 2015 11:16 am
by abrist
The two methods for dealing with are:
1. Find an integer oid for this metric.
2. Build a wrapper script (WARNING: this is an untested scratch):
snmp_wrapper.sh:

Code: Select all

#!/bin/bash
HOST="$1"
COMMUNITY="$2"
PROTO="$3"
OID="$4"
OUTPUT=$(/usr/local/nagios/libexec/check_snmp -H "$HOST" -C "$COMMUNITY" -P "$PROTO" -o "$OID")
EXIT=$(echo $?)
echo "$OUTPUT" | sed 's/c$//g'
exit $EXIT
You would then call it like:

Code: Select all

./snmp_wrapper.sh 192.168.50.170 public 2c ".1.3.6.1.4.1.45390.1.3.1.2.0"