|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19601 snmp_set_quick_print doesn't work
Submitted: 2002-09-25 13:54 UTC Modified: 2002-11-01 01:00 UTC
Avg. Score:4.7 ± 0.5
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:2 (66.7%)
From: cbowman at amtelecom dot ca Assigned:
Status: No Feedback Package: SNMP related
PHP Version: 4.2.1 OS: RedHat Linux 7.3
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: cbowman at amtelecom dot ca
New email:
PHP Version: OS:


 [2002-09-25 13:54 UTC] cbowman at amtelecom dot ca
OS:  RedHat Linux 7.3 (Linux version 2.4.18-10) i386
PHP RPM:  php-4.1.2-7.3.4
PHP SNMP RPM:  php-snmp-4.1.2-7.3.4
UCD SNMP RPM:  ucd-snmp-4.2.5-7.73.0

Basically, all this fuction will do is remove the "=" sign between the OID & the value.

snmp_set_quick_print(0) = ""


snmp_set_quick_print(1) ""

I'm not sure why this happens, perhaps it is a bug in UCD & not PHP.

Any help appreciated.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-10-16 18:34 UTC]
Please try using this CVS snapshot:
For Windows:

 [2002-10-16 21:53 UTC]
Basically: snmp_set_quick_print(1) just makes the ucd-snmp library to return less informative values, so the snmp_set_quick_print() obviously works for you since the output changes. But there indeed might be some bug in the ucd-snmp libs. At least ucd-snmp-4.2.6 and net-snmp-5.0.6 behave differently.

I suggest you try the latest CVS snapshot of PHP with net-snmp-5.0.6.

 [2002-11-01 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over 2 weeks, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2003-03-31 08:37 UTC] domi at saargate dot de
I don't think this is a bug, neither in PHP or in the UCD SNMP library. Maybe the behaviour of the latter has changed between 4.2.3 and 4.2.5 - there were a lot of changes between the two versions, as far as I can know.

Apart from the "quick print" option, the SNMP API supports another option, which is described in the snmpcmd(1) manual page:

       -Ov    Output only the variable value, not the OID:
              snmpget -c public -Ov localhost ip.ipForwarding.0

Avoiding to print the OID is probably the problem stated in this case.

I managed to add two new functions to PHP 4.2.3 in order to toggle the value of this options (internally it is called "bare value"). They can be used just as snmp_[sg]et_quick_print() can be used:

diff -urN php-4.2.3.orig/ext/snmp/php_snmp.h php-4.2.3/ext/snmp/php_snmp.h
--- php-4.2.3.orig/ext/snmp/php_snmp.h	Thu Feb 28 09:26:42 2002
+++ php-4.2.3/ext/snmp/php_snmp.h	Mon Mar 31 16:36:22 2003
@@ -34,6 +34,8 @@
diff -urN php-4.2.3.orig/ext/snmp/snmp.c php-4.2.3/ext/snmp/snmp.c
--- php-4.2.3.orig/ext/snmp/snmp.c	Fri Mar  1 04:31:01 2002
+++ php-4.2.3/ext/snmp/snmp.c	Mon Mar 31 16:36:26 2003
@@ -88,6 +88,8 @@
 		PHP_FALIAS(snmpwalkoid, snmprealwalk, NULL)
 		PHP_FE(snmp_get_quick_print, NULL)
 		PHP_FE(snmp_set_quick_print, NULL)
+		PHP_FE(snmp_get_bare_value, NULL)
+		PHP_FE(snmp_set_bare_value, NULL)
 		PHP_FE(snmpset, NULL)
@@ -433,6 +435,32 @@
 /* }}} */
+/* {{{ proto bool snmp_get_bare_value(void)
+   Return the current status of bare_value */
+	if (ZEND_NUM_ARGS() != 0) {
+	}
+/* }}} */
+/* {{{ proto void snmp_set_bare_value(int bare_value)
+   Set the current status of bare_value */
+	int argc = ZEND_NUM_ARGS();
+	long a1;
+	if (zend_parse_parameters(argc TSRMLS_CC, "l", &a1) == FAILURE) {
+		return;
+	}
+	ds_set_boolean(DS_LIBRARY_ID, DS_LIB_PRINT_BARE_VALUE, (int)a1);
+/* }}} */
 /* {{{ proto int snmpset(string host, string community, string object_id, string type, mixed value [, int timeout [, int retries]]) 
    Set the value of a SNMP object */
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Mon Dec 11 18:01:30 2023 UTC