The following Bugreport we got against our debian package:
snmpd can be queried for customized "extend"s.
A configured extend like
extend avail_mem /usr/local/bin/check_avail_mem.pl
can be queried as
snmpget -c public -v1 ds9 'nsExtendOutput1Line."avail_mem"'
NET-SNMP-EXTEND-MIB::nsExtendOutput1Line."avail_mem" = STRING: 749764
If you try to query this with check_snmp like
check_snmp -H $HOSTADDRESS$ -C public -o
'nsExtendOutput1Line."syslog-idletime"'
this results into
Could not open pipe: /usr/bin/snmpget -t 1 -r 5 -m ALL -v 1 -c public
ds9:161 nsExtendOutput1Line."syslog-idletime"
Unfortuantely, check_snmp contains code in popen.c that does not allow any
" chars in
the command line and bails out with above error.
I fixed this by commenting out the follwing block:
--- popen.c.old 2008-01-12 14:16:39.000000000 +0100
+++ popen.c 2008-01-12 14:16:54.000000000 +0100
@@ -133,8 +133,10 @@
strcpy (cmd, cmdstring);
/* This is not a shell, so we don't handle "???" */
+/*
if (strstr (cmdstring, "\""))
return NULL;
+*/
/* allow single quotes, but only if non-whitesapce doesn't occur on
both sides */
if (strstr (cmdstring, " ' ") || strstr (cmdstring, "'''"))
You can track the bugreport via
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=460405
Thanks and kind regards, Jan.
Ton Voon
Argument proccessing
CVS
Public
|
Date: 2009-03-18 11:58 Thanks John. I applied your latest patch. |
|
Date: 2009-03-17 22:34 I found a flaw in my patch: the MAX_OIDS limit was no longer being |
|
Date: 2009-03-14 01:29 Applied in git. Manually tested for an OID containing a double quote and |
|
Date: 2009-03-13 23:56 I just used the tests in t/check_snmp.t plus a few others more specific to |
|
Date: 2009-03-13 22:04 Thanks John! I look through this now. |
|
Date: 2009-03-13 21:14 tonvoon: I see, I thought you were referring to plugins/runcmd.c. |
|
Date: 2009-03-12 11:18 jbarbuto: Can you see the cmd_run and cmd_run_array in lib/utils_cmd.c? |
|
Date: 2009-03-11 21:24 I'm not sure if this is related or not, but I had a similar problem with |
|
Date: 2009-03-11 20:34 I looked into writing a patch using the runcmd library, but I don't see |
|
Date: 2009-02-20 00:11 I don't think this is a valid fix. Preferably check_snmp should be switched |
| Filename | Description | Download |
|---|---|---|
| check_snmp.patch | changes check_snmp to use lib/utils_cmd.c | Download |
| check_snmp_max_oids.patch | enforce MAX_OIDS limit | Download |
| Field | Old Value | Date | By |
|---|---|---|---|
| allow_comments | 0 | 2009-03-18 11:58 | dermoth |
| File Added | 318264: check_snmp_max_oids.patch | 2009-03-17 22:36 | jbarbuto |
| assigned_to | nobody | 2009-03-14 01:29 | tonvoon |
| close_date | - | 2009-03-14 01:29 | tonvoon |
| allow_comments | 1 | 2009-03-14 01:29 | tonvoon |
| status_id | Open | 2009-03-14 01:29 | tonvoon |
| File Added | 317729: check_snmp.patch | 2009-03-13 21:19 | jbarbuto |
| priority | 5 | 2009-01-30 21:45 | cyco_dd |
Copyright © 2009 Geeknet, Inc. All rights reserved. Terms of Use