System Command and snmp commands
| From: | Mulley, Nikhil | Date: | Tue, 26 Oct 2004 07:11:24 +0000 |
| Subject: | System Command and snmp commands | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-200324@lists.php.net to get a copy of this message | ||
Hi All,
I want to use system command to perform snmp queries on a remote machine and the problem is that I
want to store the output /result in an Array , so that I can later use it for parsing purposes.I
know I could use exec and passthru statements actually,But I am unable to store the result in the
array or I am unsure whether the result is not getting stored in the array
Here is the code
<?php
exec(' snmpget -v 2c -c public 10.103.16.14 sysUpTime.0',$ret);
list($a)=split('[,]',$ret);
echo $a[0];
?>
Point me , if any thing wrong in the code
Please help me.
Thanks,
Nikhil.