Bug #65422 [Fbk]: Error when calling multiple snmp3 functions

From: Date: Fri, 30 Aug 2013 17:30:42 +0000
Subject: Bug #65422 [Fbk]: Error when calling multiple snmp3 functions
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-181367@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=65422&edit=1

 ID:                 65422
 Updated by:         lytboris@php.net
 Reported by:        pkryon at yahoo dot com
 Summary:            Error when calling multiple snmp3 functions
 Status:             Feedback
 Type:               Bug
 Package:            SNMP related
 Operating System:   Debian Wheezy
 PHP Version:        5.5.1
 Assigned To:        lytboris
 Block user comment: N
 Private report:     N

 New Comment:

I have re-checked my configuration and stiil unable to reproduce it:

======================
<?php
echo snmp3_get('127.0.0.1', 'adminSHA', 'authNoPriv', 'sha',
'test1234', '', '', 'SNMPv2-MIB::sysLocation.0') .
"\n";
echo snmp3_get('77.[CUT]', 'adminSHA', 'authNoPriv', 'sha',
'test12345', '', '', 'SNMPv2-MIB::sysLocation.0') .
"\n";
?>
======================
Works fine for me.
Do you have a possibility to run tests bundled with php-snmp source?


Previous Comments:
------------------------------------------------------------------------
[2013-08-30 17:19:05] lytboris@php.net

Forget previous comment :)

------------------------------------------------------------------------
[2013-08-30 17:11:01] lytboris@php.net

Please note that you have 'sha' written in low case chars. Try replacing them to SHA (the
same way you use in snmpget).

------------------------------------------------------------------------
[2013-08-30 15:48:59] pkryon at yahoo dot com

Reopen

------------------------------------------------------------------------
[2013-08-30 15:31:04] pkryon at yahoo dot com

Were you by chance polling a single host multiple time to test?  Because that seems to work.  More
tests below...


bugtest1.php:

<?php

// bugtest1.php - Test using built-in snmp3_get to multiple hosts
// result: fail

echo
snmp3_get('cseoc1260','[REMOVED]','authNoPriv','sha','[REMOVED]','','','SNMPv2-MIB::sysLocation.0')."\n";

echo
snmp3_get('cseoc1264','[REMOVED]','authNoPriv','sha','[REMOVED]','','','SNMPv2-MIB::sysLocation.0')."\n";

echo
snmp3_get('cseoc2260','[REMOVED]','authNoPriv','sha','[REMOVED]','','','SNMPv2-MIB::sysLocation.0')."\n";

?>

Result:

[REMOVED]:/var/www/scripts$ php bugtest1.php
STRING: EOC Building 1 (Room 1260)
PHP Warning:  snmp3_get(): No response from 172.19.12.12 in /var/www/scripts/bugtest1.php on line 8

PHP Warning:  snmp3_get(): No response from 172.19.12.21 in /var/www/scripts/bugtest1.php on line 10


bugtest2.php:

<?php

// bugtest2.php - Test using built-in snmp3_get to same host
// result: pass

echo
snmp3_get('cseoc1260','[REMOVED]','authNoPriv','sha','[REMOVED]','','','SNMPv2-MIB::sysLocation.0')."\n";

echo
snmp3_get('cseoc1260','[REMOVED]','authNoPriv','sha','[REMOVED]','','','SNMPv2-MIB::sysLocation.0')."\n";

echo
snmp3_get('cseoc1260','[REMOVED]','authNoPriv','sha','[REMOVED]','','','SNMPv2-MIB::sysLocation.0')."\n";

?>

Result:
[REMOVED]:/var/www/scripts$ php bugtest2.php
STRING: EOC Building 1 (Room 1260)
STRING: EOC Building 1 (Room 1260)
STRING: EOC Building 1 (Room 1260)


bugtest3.php:

<?php

// bugtest3.php - Test using NetSNMP snmpget on multiple hosts
// result: pass

echo shell_exec("snmpget -O v -v 3 -l AuthNoPriv -u [REMOVED] -a SHA -A [REMOVED] cseoc1260
SNMPv2-MIB::sysLocation.0");

echo shell_exec("snmpget -O v -v 3 -l AuthNoPriv -u [REMOVED] -a SHA -A [REMOVED] cseoc1264
SNMPv2-MIB::sysLocation.0");

echo shell_exec("snmpget -O v -v 3 -l AuthNoPriv -u [REMOVED] -a SHA -A [REMOVED] cseoc2260
SNMPv2-MIB::sysLocation.0");

?>

Result:
[REMOVED]:/var/www/scripts$ php bugtest3.php
STRING: EOC Building 1 (Room 1260)
STRING: EOC Building 1 (Room 1264)
STRING: EOC Building 2 (Room 2260)


bugtest4.php:

<?php

// bugtest4.php - Test using built-in snmpget on multiple hosts
// result: pass

echo
snmpget('cseoc1260','[REMOVED]','SNMPv2-MIB::sysLocation.0')."\n";

echo
snmpget('cseoc1264','[REMOVED]','SNMPv2-MIB::sysLocation.0')."\n";

echo
snmpget('cseoc2260','[REMOVED]','SNMPv2-MIB::sysLocation.0')."\n";

?>

Result:

[REMOVED]:/var/www/scripts$ php bugtest4.php
STRING: EOC Building 1 (Room 1260)
STRING: EOC Building 1 (Room 1264)
STRING: EOC Building 2 (Room 2260)

------------------------------------------------------------------------
[2013-08-30 06:09:25] lytboris@php.net

Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.


I can not reproduce this bug in my test environment.
Please post Net-SNMP snmpget commands with their results prooving that your 2nd & 3rd hosts are
configured to work with SNMPv3 the same way that your 1st host.

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=65422


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=65422&edit=1


Thread (10 messages)

« previous php.bugs (#181367) next »