Hello everyone, first post on this forum.
I'm in the process of developing a web app to manage CPEs throughout a network using PHP and SNMP. Two questions:
1. With SNMP, is it possible to communicate with a end-device aside from using a static hostname or IP address.
2. I am using NET SNMP to issue commands. So far I haven't been successful in retrieving the correct data from my CPE. Only the snmpwalk command has been able to retrieve data [only downside is I cannot specify an attribute so I receive a long list of parameters]
For example:
//get system name
$sysname = snmpget($host, $community, "system.sysName.0");
echo " Router Name: " . $sysname . "";
Warning: snmpget() [function.snmpget]: Invalid object identifier: system.sysName.0 in
^ will error out. This same command issue via CLI will work properly.
//try snmpwalk
$swalk = snmpwalk($host, $community, "");
print "<h2>Stats for ". $host ."</h2>
SNMPWalk: <br /> " . $swalk . "<br>" ;
foreach ($swalk as $val) {print "$val</br>";}
^ my only solution so far, but then I get a really long list of data.
Any help is greatly appreciated. Thanks.