Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re: Need help to parse the text

by eXile (Priest)
on Jun 17, 2004 at 05:38 UTC ( #367538=note: print w/replies, xml ) Need Help??

in reply to Need help to parse the text


Another approach to solve your problem is using the SNMP (Simple Network Management Protocol). If you are allowed to run snmp-daemons on the servers you want to check, its quite easy and you'll get uniform results regardless of the OS (in theory at least). Using tools like 'snmpwalk' you could get the information you want from a remote host like this:

prompt$ snmpwalk -c mylittlesecret -v 1 remotehost | egrep 'ifDescr|if +AdminStatus' IF-MIB::ifDescr.1 = STRING: sis0 IF-MIB::ifDescr.2 = STRING: vr0 IF-MIB::ifDescr.3 = STRING: lo0 IF-MIB::ifDescr.4 = STRING: faith0 IF-MIB::ifAdminStatus.1 = INTEGER: up(1) IF-MIB::ifAdminStatus.2 = INTEGER: up(1) IF-MIB::ifAdminStatus.3 = INTEGER: up(1) IF-MIB::ifAdminStatus.4 = INTEGER: down(2)
Just be sure you do this on a well protected intranet (I guess so because you use telnet to connect to the remote host), or use SNMP version 3 which has much better security than the standard version 1 (which I used in the example above, by using '-v 1')

Of course you could use Net::SNMP instead of 'snmpwalk' to query remote snmp-daemons.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://367538]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2022-08-10 05:29 GMT
Find Nodes?
    Voting Booth?

    No recent polls found