SNMP Plugin Output Not Written in InfluxDB When Output is Double Quoted

(Jmora2) #1

Hello Team,

I need a bit of help here, I am almost positive this issue has come up already, but I cannot find any information about it.

Basically, I have two checks. One comes back with an output like this:
SNMP OK - 2

The second output comes back like this:
SNMP OK - “747564”

The second is a string and it needs to be stored in influxdb as numeral, i checked the documentation, but I am almost clueless here. Could anybody please help me.

Regards,

(Jmora2) #2

Hi Team,

I was able to do a wrapper script to remove the quotes and get only the numerical values, but whats left is still not being written to influxdb. Any further help will be appreciated.

Regards,

(Alex) #3

Hi,

how does the plugin output look like when you execute it over the command line?

Greetz

(Roland Sommer) #4

Performance data needs to be in format as described here.

(Jmora2) #5

Hi,

This is what comes back:

/usr/lib/nagios/plugins/./check_snmp -L authPriv -U pdSNMP -a SHA -A “1234” -x AES -X “1234” -P 3 -H 10.100.145.7 -o 1.3.6.1.4.1.1916.1.32.2.2.1.3.1

SNMP OK - “746488” |

This second output has the wrapper, basically it does what is after the “|”, in the original cli command, it executes the wrapper then calls check_snmp, something like this:

/usr/lib/nagios/plugins/./check_snmp -L authPriv -U pdSNMP -a SHA -A “xa4vah4eij2Aikaey0ai” -x AES -X “chai9aesheiPeipago0e” -P 3 -H 10.100.145.7 -o 1.3.6.1.4.1.1916.1.32.2.2.1.3.1 | sed ‘s/"//g’

SNMP OK - 746488 |

the script looks like this:

#!/bin/bash

address="$1"
oid="$2"
seclevel="$3"
user="$4"
authproto="$5"
authpasswd="$6"
privproto="$7"
privpasswd="$8"
snmpversion="$9"
eval "/usr/lib/nagios/plugins/check_snmp  -H '$address' -o '$oid' -L '$seclevel' -U '$user' -a '$authproto' -A '$authpasswd' -x '$privproto' -X '$privpasswd' -P '$snmpversion' | sed 's/\"//g'"

I hope this makes sense.

Gruss,

#6

Please run an snmpget for these two OIDs and show the results. Please note that there is no performance data for type “STRING” so you might have to “create” your own.

(Jmora2) #7

Hi,

here is the output:

snmpget -v 2c -c 1234 10.100.145.7 1.3.6.1.4.1.1916.1.32.2.2.1.3.1

iso.3.6.1.4.1.1916.1.32.2.2.1.3.1 = STRING: “744940”

PS1: snmpv3 comes back with the same result.
PS2: I have another icinga2 in other location and the data is being stored even without the wrapper.

Regards,

#8

Please take a look at the performance data of the other check and show the snmpget result of the other location.

(Jmora2) #9

Hi,

I dont really know about the performance data, but both Icinga2s are configured the same way, even che checks are the same; I also checked the snmpget and I got the following results:

snmpget -v 2c -c 1234 172.23.1.70 1.3.6.1.4.1.1916.1.32.2.2.1.3.1

iso.3.6.1.4.1.1916.1.32.2.2.1.3.1 = STRING: “715616”

#10

Influx is a separate component. It relies on the data delivered by the monitoring process. Please check your Influx configuration which information is used to populate the Influx-DB.

(Jmora2) #11

In the config file, influxdb.conf everything is commented out (#) that means i should be using the default config [InfluxDB shell version: 1.7.8]. I still think the issue is not influx, the other icinga2 generates the data properly, if I see the plugin output in the webclient, i see that everything is being written without the quote marks. The snmpget/walk returns with and without quotes, depending on the OID, but I see it in the webclient without quotes.

I still think that the data is sent to the database improperly, but i have no way to proof this, because I am using the exact same configuration in all VMs.

(Jmora2) #12

This is what I mean, first screenshot has what i need:

123

The second one, has the exact same config, but it is displayed/written differently:

456

In the second screenshot you can see the quotes " "