Polling Cisco Router with PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
xt07t
Forum Newbie
Posts: 19
Joined: Mon Apr 19, 2004 4:01 pm

Polling Cisco Router with PHP

Post by xt07t »

I want to accomplish something simple, but I'm having trouble getting it to work. I want to poll a router for all of its interfaces and their descriptions. Then list these on a web page. I'm not sure how to go about doing this, so any help would be greatly appreciated. Thanks!

xtort
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

meaby have a look at the http://www.php.net/snmp functions??

i wouldn't know a more appropriate to talk with routers....
hedge
Forum Contributor
Posts: 234
Joined: Fri Aug 30, 2002 10:19 am
Location: Calgary, AB, Canada

Post by hedge »

most routers have a mini-web server built into them, just use curl or a similar method to pull content from the router.
xt07t
Forum Newbie
Posts: 19
Joined: Mon Apr 19, 2004 4:01 pm

Post by xt07t »

timvw wrote:meaby have a look at the http://www.php.net/snmp functions??

i wouldn't know a more appropriate to talk with routers....
Thanks I will read this section carefully.
xt07t
Forum Newbie
Posts: 19
Joined: Mon Apr 19, 2004 4:01 pm

Post by xt07t »

I am unable to use the snmpget functions, even though I added them during install. When I try I get the following error

Fatal error: Call to undefined function: snmpget() in /var/www/test1.php on line 19

I'm not sure if I installed PHP correctly, or even how to figure out if the snmp functions are included. I added phpinfo() to see what was in there.

Included in the configure command output section is

'--with-mysql=shared,/usr' '--with-pgsql=shared' '--with-snmp=shared,/usr' '--with-snmp=shared'

I thought this meant that I installed with the --with-snmp option.

xt07t wrote:
timvw wrote:meaby have a look at the http://www.php.net/snmp functions??

i wouldn't know a more appropriate to talk with routers....
Thanks I will read this section carefully.
User avatar
smpdawg
Forum Contributor
Posts: 292
Joined: Thu Jan 27, 2005 3:10 pm
Location: Houston, TX
Contact:

Post by smpdawg »

Does snmp show up when you do a phpinfo()?
xt07t
Forum Newbie
Posts: 19
Joined: Mon Apr 19, 2004 4:01 pm

Post by xt07t »

It doesn't show up as a heading, is that what you mean? Like MySQL or Calendar or ftp. Does that mean I nead to recompile it?
smpdawg wrote:Does snmp show up when you do a phpinfo()?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

that'd very likely mean it isn't enabled/installed/compiled-in
xt07t
Forum Newbie
Posts: 19
Joined: Mon Apr 19, 2004 4:01 pm

Post by xt07t »

I'm trying to ./configure a make file, but it keeps crashing out with...


checking lex output file root... ./configure: line 2420: lex: command not found
configure: error: cannot find output from lex; giving up
feyd wrote:that'd very likely mean it isn't enabled/installed/compiled-in
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

it appears you don't have lex installed..
Post Reply