Posts Tagged ‘snmp’

Learning Perl with SNMP Part I

Ok my first stab at it was great (snmp.pl) #!/usr/bin/perl $SNMP_GET_CMD = “snmpget -v1 -c public -Ovq”; $SNMP_TARGET = “1.1.1.2″; chomp($model = `${SNMP_GET_CMD} ${SNMP_TARGET} 1.3.6.1.2.1.1.3.0`); chomp($serial = `${SNMP_GET_CMD} ${SNMP_TARGET} 1.3.6.1.2.1.1.4.0`); $model =~ s/\”//g;      # Ditch the quotes. $serial =~ s/\”//g;

Using SNMPget or SNMPwalk witha vendor MIB file

First, copy your .mib file into the directory where your script is located. Then use snmpget in the following format: snmpget [address] -c [community string] -v 1 -m [mib name] [object to scan] Then use snmpwalk in the following format: snmpwalk [address] -c [community string] -v 1 -m [mib name] [object to scan]

Subscribe to RSS Feed Follow me on Twitter!