how to create services of various OIDs of a mib file in one

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
alef1_nagiosxi
Posts: 7
Joined: Thu Apr 02, 2015 4:27 am

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

Post 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
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

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

Post 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"
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked