#37819 [NEW]: SNMP contention issue

From: Date: Thu, 15 Jun 2006 16:45:41 +0000
Subject: #37819 [NEW]: SNMP contention issue
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-98399@lists.php.net to get a copy of this message
From:             sdw06 at health dot state dot ny dot us
Operating system: Windows 2003
PHP version:      5.1.4
PHP Bug Type:     SNMP related
Bug description:  SNMP contention issue

Description:
------------
I am developing an application that does certain scripted functions for
our helpdesk and networking groups and delivers the results via web
interface. An example of some of the functionality is port status of a
switch, router error tracking, performance monitoring, utilization...that
kind of stuff. I'm using snmp to do pretty much everything and it works
great and all is good *except* when 2 users try and do something invoking
snmp calls at the exact same time. I did a line sniff to see what the deal
was and this is what happens as an example:

User (A) requests port speed/duplex settings for a switch on the network,
php starts sending out the snmpget calls needed...

User (B) initiates a check for router errors a split second after User
(A), while User (A)'s script is still doing its thing. The instant
User(B)
does this User(A) stops making the needed snmp calls and just stops. They
then need to close out of their web browser and log back in.

User (B)'s request completes without a problem.

I am guessing this is caused by contention for the snmp port and php gets
confused. Am I trying to do something that snmp is not capable of?

What makes me think it is possibly a PHP issue is I tried to see if
another network application that uses SNMP would duplicate the same
problem. To my surprise, it didn't. For example we have the Solar winds
network management application running on the same machine as my web
server. Solar Winds has a circuit utilization gauge that works by making
SNMP calls to the router. I pretty much made an exact copy of this
functionality, i.e. gathering utilization of the router by making SNMP
calls to it. I was able to run both my utilization gauge and the
solarwinds utilization gauge at the exact same time and both worked with
no problem.

So it seems to happen only when PHP tries to make simultaneous SNMP calls.

Reproduce code:
---------------
Here is a small sample of some of the snmp calls I am making.

function snmppullsyslocation($target) {
include "C:\WicWeb\bin\wicwebnetwork.php";
return snmpget($target, $RWCOMSTRING, '.1.3.6.1.2.1.1.6.0', '1000000',
'5');
}

function snmppullsyscontact($target) {
include "C:\WicWeb\bin\wicwebnetwork.php";
return snmpget($target, $RWCOMSTRING, '.1.3.6.1.2.1.1.4.0', '1000000',
'5');
}

function snmppullsysobjectid($target) {
include "C:\WicWeb\bin\wicwebnetwork.php";
return snmpget($target, $RWCOMSTRING, '.1.3.6.1.2.1.1.2.0', '1000000',
'5');
}

function snmppullduplexstate($target) {
snmp_set_valueretrieval(SNMP_VALUE_PLAIN);
include "C:\WicWeb\bin\wicwebnetwork.php";
return snmpwalk($target, $RWCOMSTRING, '.1.3.6.1.4.1.9.9.87.1.4.1.1.31.0',
'1000000', '5');
}

function snmppullduplexstatus($target) {
include "C:\WicWeb\bin\wicwebnetwork.php";
return snmpwalk($target, $RWCOMSTRING, '.1.3.6.1.4.1.9.9.87.1.4.1.1.32.0',
'1000000', '5');
}


Expected result:
----------------
I expect to be able to have different php scrips make these snmp calls at
the same time.

Actual result:
--------------
One script's snmp call goes through, the other one never completes.

-- 
Edit bug report at http://bugs.php.net/?id=37819&edit=1
-- 
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=37819&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=37819&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=37819&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=37819&r=fixedcvs
Fixed in release:             http://bugs.php.net/fix.php?id=37819&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=37819&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=37819&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=37819&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=37819&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=37819&r=notwrong
Not enough info:              http://bugs.php.net/fix.php?id=37819&r=notenoughinfo
Submitted twice:              http://bugs.php.net/fix.php?id=37819&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=37819&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=37819&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=37819&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=37819&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=37819&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=37819&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=37819&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=37819&r=mysqlcfg


Thread (4 messages)

« previous php.bugs (#98399) next »