Note: Ive seen this issue with default snmpd that you get from “apt-get install snmpd” on Debian 7.4 (wheezy)

PROBLEM: not enough information with your snmpwalk

If you run an snmpwalk like this:

snmpwalk -v2c -c public localhost
# or like this:
snmpwalk -v1 -c public localhost

 

and you dont get as much information as you thought you were supposed to get. NOTE: I dont have an example here of the lack of information… but for example you only get like 10 lines out of output where as your supposed to get 100s of lines (pages of scrolls as id like to call it)

SOLUTION:

NOTE: I got the solution from observium configs, but they work all round

Then your snmpd.conf file is incorrect

# backup
cp /etc/snmp/snmpd.conf /etc/snmp/backup-snmpd.conf

# Clear the current snmpd file:
:> /etc/snmp/snmpd.conf

# edit
vim /etc/snmp/snmp.d

 

Put this in the config (yes I grabbed this from an example observium config):

com2sec readonly default public
group MyROGroup v1 readonly
group MyROGroup v2c readonly
group MyROGroup usm readonly
view all included .1 80
access MyROGroup "" any noauth exact all none none

# NOTE THERE ARE OTHER WAYS TO TALK ABOUT LOCATION
# syslocation Rack, Room, Building, City, Country [GPSX,Y]
# But this simple form works for me (and it works for observium as well)
syslocation city, state
syscontact your-name-here <your@email.com>

# NOTE ABOUT BELOW LINE - /usr/bin/distro:
# if you have observium you should definitely include the below line - if you dont, you can omit it, or make it work by downloading /usr/bin/distro

#This line allows Observium to detect the host OS if the distro script is installed

extend .1.3.6.1.4.1.2021.7890.1 distro /usr/bin/distro

 OPTIONAL – IF INCLUDED LAST LINE ABOUT DISTRO

If you want “distro” to work with observium:

As the following link explains: http://www.observium.org/wiki/NetSNMPd_Client_Configuration

Just download it from the observium svn repository (note you dont need svn, just wget for this part)

cd ~
wget http://www.observium.org/svn/observer/trunk/scripts/distro
mv distro /usr/bin/distro
chmod 755 /usr/bin/distro

Test it

/usr/bin/distro

For me since Im using debian 7.4 its output said:

Debian 7.4

NOTE: I wasnt able to get snmpwalk to display this information, and I wasnt able to get snmpget to display this information even with the all-passage snmpd configs from above

The way I tried to get them:

snmpget -v2c -c public localhost .1.3.6.1.4.1.2021.7890.1
snmpget -v1 -c public localhost .1.3.6.1.4.1.2021.7890.1
snmpwalk -v2c -c public localhost | grep -i debian
snmpwalk -v1-c public localhost | grep -i debian

None of the ways work

REBOOTING SNMPD

Now reboot snmpd, dont reload just restart

service snmpd restart
# Or like this:
/etc/init.d/snmpd restart

TEST

Test your walks

snmpwalk -v2c -c public localhost
# or like this:
snmpwalk -v1 -c public localhost

Now you should have pages of scrolls 🙂

NOTE: these configs should be enough for the likes of observium, as I used their example config

USELESS EXTRA NOTES:

Note that a similar config is inside observium, its actually located in /opt/observium/snmpd.conf.example. But in all actuallity, The config that I actually derived the above example from actually is here

http://www.observium.org/wiki/NetSNMPd_Client_Configuration

The example config and the one on the above site differ mostly on the top line

# From site:
com2sec readonly default <COMMUNITY>
# From example config:
com2sec readonly default 0bs3rv1um
# In my example:
com2sec readonly default public

I didnt have the 0bs3rv1um community even though I use observium, mine is called something else (but using “public” as in my example config at the top will work)

Leave a Reply

Your email address will not be published. Required fields are marked *