check_snmp string output regex to integer ?

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
User avatar
nozlaf
Posts: 172
Joined: Sun Nov 09, 2014 9:50 pm
Location: Victoria, Australia

check_snmp string output regex to integer ?

Post by nozlaf »

I am trying to monitor an LTE modem signal strength
through snmp I can retrieve the signal

Code: Select all

SNMPv2-SMI::enterprises.39699.1.1.5.6.0 = STRING: "(19,-75dBm)"
however as you see its a string and not really useful for graphing etc..

is there an easy way with check_snmp to strip out the crap using regex? or should I write my own plugin?
Looking forward to seeing you all at #NagiosCon2019?
-Dedicated Lover of Nconf,PNP4Nagios and Nagvis
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: check_snmp string output regex to integer ?

Post by avandemore »

You can write a wrapper around it if you don't want to start from scratch. Here is some info on custom plugins and perf data:
https://nagios-plugins.org/doc/guidelines.html
https://mathias-kettner.de/checkmk_localchecks.html
http://www.yourownlinux.com/2014/06/how ... cript.html
Previous Nagios employee
Locked