LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-16-2009, 03:30 PM   #1
aptget
LQ Newbie
 
Registered: Sep 2009
Posts: 4

Rep: Reputation: 0
snmpwalk 400 switches for switch port status


Hi,

Can anyone point me in right direction for a perl script that will snmpwalk the MIB for switch port status (ifOperStatus) whether "up" or "down" including total number of ports available?

I have approximately 400 switches that I would like to query via script and pipe the results to a file.

Any pointers will be greatly appreciated.

regards
sky
 
Old 11-17-2009, 04:34 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
If you don't find one, you may be able to enlist assistance on one of the coder sites - rentacoder.com, elance.com etc

cheers
 
Old 11-17-2009, 07:46 PM   #3
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
You don't snmpwalk in that case, just MIB-for-MIB.

My suggestion would be to put all the router names in a file, read the file line by line, and use that in a snmpget command. I assume you are reading just one or two MIBs from any router, and that they all are equal. If they are not equal, put the MIB in the file containing router addresses as well.

This can be done in Perl if you happen to speak that, but as easy in Bash. If you have to query multiple MIBs in one router, do that in one call to smnpget as creating the snmpget command is expensive in terms of processor time.

The slower execution of Bash (as compared to Perl?) is negligable related to the execution of the snmpget command.

jlinkels
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
sshd port switches back to default 22 astbis Linux - Server 2 09-28-2009 03:30 PM
LXer: LD Port Report Project aka Switch Port Mapper Tool LXer Syndicated Linux News 0 05-10-2009 07:11 PM
Which 24-Port GIgabit switches would you recommend for Ubuntu 8.04 Server? rozilla Linux - Networking 6 07-29-2008 09:18 AM
Tomcat6 Mod_jk - Service finished with status=400 for worker=ajp13 HiOctane21 Linux - Server 0 02-14-2008 01:00 PM
8-port Switches problem hiteshmaisheri Linux - Networking 3 03-13-2004 11:16 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration