1820882 Members
3469 Online
109628 Solutions
New Discussion юеВ

Re: snmpwalk parameters

 
SOLVED
Go to solution
'chris'
Super Advisor

snmpwalk parameters

hi

on my Debian Sarge Stable I cannot do:

# snmpwalk 192.168.0.3 public

this command was working in the older versions of linux

but if I put some options:

snmpwalk -sO -c public -v 1 192.168.0.3

it seems to work.
knows someone why ?

and what mean exactly these options:

-sO -c -v 1 ?

kind regards
chris
10 REPLIES 10
Rick Garland
Honored Contributor
Solution

Re: snmpwalk parameters

The -c option you provide a community string. By default this is 'public'. If a system has a different get-community you can substitute here.

The -v 1 says you are using version 1 of the snmp utility.

The -sO I am not sure. I see a -0s which means to retrive all the variables under system OID (object identifier):

sysDescr.0
sysObjectID.0
sysUpTime.0
sysContact.0
sysName.0
sysLocation.0
sysServices.0

Stuart Browne
Honored Contributor

Re: snmpwalk parameters

Are you sure it's '-sO' and not '-Os' ? '-Os' (which is more expected) just shows the last portion of the OID, just to make it easier to read.

As for the others... '-c' is the community to query.

'-v 1' says to use SNMP version 1 protocol.

What does 'snmpwalk -v1 192.168.0.3 public' do? I'd expect it would probably still need to have the '-c' though (I honestly haven't used snmp much).

See 'man snmpcmd' for details on the se flags.
One long-haired git at your service...
'chris'
Super Advisor

Re: snmpwalk parameters

yes

# snmpwalk -v1 192.168.0.3 public

dosn't work, but

# snmpwalk -v1 -c public 192.168.0.3

works.

It seems, it needs to work both options:
-v1 and -c

greetings
chris
Rick Garland
Honored Contributor

Re: snmpwalk parameters

True:

I do 'snmpwalk -v1 -c secret 1.1.1.1'

My belief is that this will also work;

snmpwalk -v2c -c secret 1.1.1.1

Using version 2 of snmp
The 'secret' is my community name.

Can also do 'snmpwalk -v2c -c secret 1.1.1.1 system

This will output only the OID info for system.

SNMPv2-MIB::sysDescr.0
SNMPv2-MIB::sysObjectID.0
SNMPv2-MIB::sysUpTime.0
SNMPv2-MIB::sysContact.0
SNMPv2-MIB::sysName.0
SNMPv2-MIB::sysLocation.0
SNMPv2-MIB::sysServices.0
SNMPv2-MIB::sysORLastChange.0



'chris'
Super Advisor

Re: snmpwalk parameters

hi Rick

# snmpwalk -v2c -c secret 1.1.1.1

is not working under Debian Sarge or freeBSD 5.4

greetings
chris
Rick Garland
Honored Contributor

Re: snmpwalk parameters

The secret is the get-community-name. If you have not changed yours it would still be the default of 'public'

I have changed mine and by habit I use use the 'secret' in postings.

# snmpwalk -v2c -c public 1.1.1.1

Substitute the 1.1.1.1 IP address with a valid IP from your environment.
'chris'
Super Advisor

Re: snmpwalk parameters

ofcource I've changed and it doesn't work:

bsd# snmpwalk -v2c -c public 192.168.0.3
Timeout: No Response from 192.168.0.3
Rick Garland
Honored Contributor

Re: snmpwalk parameters

You may not have version 2 of snmp
J._1
Advisor

Re: snmpwalk parameters

Chris,

Nobody has cleared up your original question though...

"knows someone why?"

Check the snmp package that you have installed. On your "older" versions, you're using the older ucd-snmp packages. On your new Debian system, you're using net-snmp.

You can use snmpconf to create your own "snmp.conf" file that specifies default values (i.e. output, version, and community string options). Place this file in your $HOME/.snmp directory. This makes things much simpler: your snmpwalk command could then be as simple as: "snmpwalk "

Do a "man 5 snmp_config" for more info.

Enjoy,
J
The faster you run, the faster you're done.
Steven E. Protter
Exalted Contributor

Re: snmpwalk parameters

Chris,

Side note: Beware that snmp, at least older versions does some of its authentication in a way that is shall we say less than secure.

You need to be current on patching and make sure you keep on eye on snmp exploits and such while using the product.

SEP
Rapid City, SD
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com