File tree 2 files changed +7
-10
lines changed
2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -1997,6 +1997,13 @@ PHP_MINIT_FUNCTION(snmp)
1997
1997
{
1998
1998
netsnmp_log_handler * logh ;
1999
1999
2000
+ /* Disable logging, use exit status'es and related variabled to detect errors */
2001
+ shutdown_snmp_logging ();
2002
+ logh = netsnmp_register_loghandler (NETSNMP_LOGHANDLER_NONE , LOG_ERR );
2003
+ if (logh ) {
2004
+ logh -> pri_max = LOG_ERR ;
2005
+ }
2006
+
2000
2007
init_snmp ("snmpapp" );
2001
2008
/* net-snmp corrupts the CTYPE locale during initialization. */
2002
2009
zend_reset_lc_ctype_locale ();
@@ -2006,13 +2013,6 @@ PHP_MINIT_FUNCTION(snmp)
2006
2013
netsnmp_ds_set_boolean (NETSNMP_DS_LIBRARY_ID , NETSNMP_DS_LIB_DONT_PERSIST_STATE , 1 );
2007
2014
#endif
2008
2015
2009
- /* Disable logging, use exit status'es and related variabled to detect errors */
2010
- shutdown_snmp_logging ();
2011
- logh = netsnmp_register_loghandler (NETSNMP_LOGHANDLER_NONE , LOG_ERR );
2012
- if (logh ) {
2013
- logh -> pri_max = LOG_ERR ;
2014
- }
2015
-
2016
2016
memcpy (& php_snmp_object_handlers , & std_object_handlers , sizeof (zend_object_handlers ));
2017
2017
php_snmp_object_handlers .read_property = php_snmp_read_property ;
2018
2018
php_snmp_object_handlers .write_property = php_snmp_write_property ;
Original file line number Diff line number Diff line change @@ -6,8 +6,5 @@ require_once (dirname(__FILE__).'/snmp_include.inc');
6
6
//snmpget ( string $hostname , string $community ,
7
7
//string $object_id [, int $timeout [, int $retries ]] )
8
8
9
- // net-snmp will just log to STDERR without asking. Close STDERR to prevent
10
- // the error output from marking the SKIPIF section as BORKed.
11
- fclose (STDERR );
12
9
if (@snmpget ($ hostname , $ community , '.1.3.6.1.2.1.1.1.0 ' , $ timeout ) === false )
13
10
die ('skip NO SNMPD on this host or community invalid ' );
You can’t perform that action at this time.
0 commit comments