[Nagiosplug-help] Check_snmp and Could not open pipe: error because popen.c BUG!!!!!!

Pietro Bandera pietrob at lansystems.it
Wed Jul 9 08:45:02 CEST 2003


Hi all i have found out a bug in the re-written (modified/not standard)
popen.c library that is included in both netsaint-plugins and
nagios-plugins.

Due to this library i have this "could not open a pipe" error:

What i need is to check some specific oid that unfortunatly uses
"commas" inside such as:

/usr/local/nagios/libexec/check_snmp 192.168.0.37 -C public -o
enterprises.ibm.ibmProd.ibmServeRaid.ibmServeRaidMIB.ibmServeRaidMibObje
cts.ibmServeRaidInfo.ibmServeRaidPhysDeviceTable.ibmServeRaidPhysDeviceE
ntry.ibmServeRaidPhysDeviceStatus.\"113\" -l Disco -s "online(2)"

As you can see in order to use commas i have to use this syntax \"113\"

But due to this when the program "check_snmp.c" pass the command string
to the "spopen" function defined in the "popen.c" in order to run the
command:

/usr/bin/snmpget 192.168.0.37 public
enterprises.ibm.ibmProd.ibmServeRaid.ibmServeRaidMIB.ibmServeRaidMibObje
cts.ibmServeRaidInfo.ibmServeRaidPhysDeviceTable.ibmServeRaidPhysDeviceE
ntry.ibmServeRaidPhysDeviceStatus.\"113\"

It doesn't do it right and so the "popen.c" pass to the "check_snmp.c" a
"NULL" value and so "check_snmp" command send me a "could not open a
pipe" as defined.



Unfortunatly i'm not a coder and i can't do more...i think...so there is
someone that could fix this?

Thanks 

Pietro

PS: if i do:
/usr/bin/snmpget 192.168.0.37 public
enterprises.ibm.ibmProd.ibmServeRaid.ibmServeRaidMIB.ibmServeRaidMibObje
cts.ibmServeRaidInfo.ibmServeRaidPhysDeviceTable.ibmServeRaidPhysDeviceE
ntry.ibmServeRaidPhysDeviceStatus.\"113\"

>From any command line i got a right result:

enterprises.ibm.ibmProd.ibmServeRaid.ibmServeRaidMIB.ibmServeRaidMibObje
cts.ibmServeRaidInfo.ibmServeRaidPhysDeviceTable.ibmServeRaidPhysDeviceE
ntry.ibmServeRaidPhysDeviceStatus."113" = online(2)

So the \"113\" works







More information about the Help mailing list