Page 1 of 1

problem with snmp and php

PostPosted: 09. October 2008 12:28
by djamols
hello;

i install xampp server and modify the file php.ini in /apache/bin directory to load the php-snmp module,
but when i launch the script to see how is going well i got a error message, that is:

Warning: snmpwalk() [function.snmpwalk]: No response from 127.0.0.1 in C:\Program Files\xampp\htdocs\yan\snmpwalk.php on line 2

Warning: Invalid argument supplied for foreach() in C:\Program Files\xampp\htdocs\yan\snmpwalk.php on line 4


for the script,

Code: Select all
<?php
$a = snmpwalk("127.0.0.1", "public", "");

foreach ($a as $val) {
    echo "$val\n";
}

?>


i don't inderstand why the localhost don't give response to that request, may i have a answer, thx

PostPosted: 09. October 2008 12:48
by Wiedmann
i want to use php for monitoring a cisco switch with
Code: Select all
Warning: snmpwalk() [function.snmpwalk]: No response from 127.0.0.1

"127.0.0.1" can't be the IP from the cisco switch.

problem with snmp and php

PostPosted: 09. October 2008 13:09
by djamols
sorry, for the beginning, i try i for the loopback , i forgot to say it, if it running for the localhost, it will run probably for the switch, when i change the ip address,