Page 1 of 1

check_snmp string output regex to integer ?

Posted: Mon Feb 27, 2017 5:14 pm
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?

Re: check_snmp string output regex to integer ?

Posted: Mon Feb 27, 2017 5:49 pm
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