|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2006-06-20 14:10 UTC] tony2001@php.net
  [2006-06-21 16:38 UTC] sdw06 at health dot state dot ny dot us
  [2006-06-22 17:36 UTC] tony2001@php.net
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 17:00:02 2025 UTC | 
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.