Web Hosting Talk







View Full Version : SNMP Query in PHP


MyFocal
03-30-2006, 10:12 AM
Anyone know how to do a simple SNMP query on a Cisco 3700 Series and Cisco 1700 Series with PHP? I have not been very successful in finding this. I know Nagios does this, but I'm not entirely sure how it works. This is what I need to get out of these routers (will need more later):

1) Router Serial Number
2) Router Interfaces and Names
3) Router Interface Cards and Card Serial Numbers

If anyone knows of a tutorial where they show you how to do simple SNMP queries, if you could let me know I would appreciate it VERY much! Thanks!

zoid
03-30-2006, 10:57 AM
Have a look at the SNMP functions (http://www.php.net/manual/en/ref.snmp.php).

MyFocal
03-30-2006, 11:25 AM
Yeah, I did. I tried using the snmpget() and snmpwalk() and they kept giving me 'undefined' errors. I then realized I had skipped over the part that says I have to install the 'NET-SNMP' package, so I'll do that and be on my merry way (hopefully). Thanks for your post!