View Single Post
  #1   (View Single Post)  
Old 15th September 2011
badguy badguy is offline
Fdisk Soldier
 
Join Date: Jul 2009
Location: MD, USA
Posts: 59
Default SNMP config file test

So im trying to set up smnp on my openbsd box but i cant even get past the config file setup because i feel like i am not doing it right. here is what i have on my /etc/snmpd.conf


Code:
# $OpenBSD: snmpd.conf,v 1.2 2008/01/30 10:21:05 reyk Exp $

listen_addr="127.0.0.1"

# Restrict daemon to listen on localhost only
listen on $listen_addr
rwcommunity public

# Specify a number of trap receivers
#trap receiver nms.localdomain.local

# Adjust the local system information
system contact " Root (root@lab.com)"
system description " Realm "
system location " Lab "
system services 74

# Provide static user-defined SNMP OIDs
oid 1.3.6.1.4.1.30155.42.3.1 name testStringValue read-only string "Test"
oid 1.3.6.1.4.1.30155.42.3.4 name testIntValue read-write integer 1
Code:
root ~ # snmpd -n            
/etc/snmpd.conf:8: syntax error
I try starting snmpd and it starts but show this in the log. lsof also show open snmp stuff

Code:
tail /var/log/snmpd
Warning: no access control information configured.
  (Config search path: /etc/snmp:/usr/local/share/snmp:/usr/local/lib/snmp:/root/.snmp)
  It's unlikely this agent can serve any useful purpose in this state.
  Run "snmpconf -g basic_setup" to help you configure the snmpd.conf file for this agent.

I tried using the "snmpconf -g basic_setup"
and generated this randomly to test

Code:
############################
# SECTION: Access Control Setup
#   This section defines who is allowed to talk to your running snmp agent.

# rwuser: a SNMPv3 read-write user
#   arguments:  user [noauth|auth|priv] [restriction_oid]

rwuser  slim  

# rouser: a SNMPv3 read-only user
#   arguments:  user [noauth|auth|priv] [restriction_oid]

rouser  slim1  

# rocommunity: a SNMPv1/SNMPv2c read-only access community name
#   arguments:  community [default|hostname|network/bits] [oid]

rocommunity  slim3  

# rwcommunity: a SNMPv1/SNMPv2c read-write access community name
#   arguments:  community [default|hostname|network/bits] [oid]

rwcommunity  slim2
and the test shows

Quote:
root /etc/snmp # snmpd -nf /etc/snmp/snmpd.conf
/etc/snmp/snmpd.conf:16: syntax error
/etc/snmp/snmpd.conf:21: syntax error
/etc/snmp/snmpd.conf:26: syntax error
/etc/snmp/snmpd.conf:31: syntax error
I can start snmp and snmp logs show UDP connection. netstart shows port 161 open. So i am wondering if this config file test is just a waste of time.

Im wondering if there is any one very proficient with snmp that can confirm the correct way to set up the snmpd.conf and can also tell me how to verify that snmpd is correctly working. Thanks in adv

Last edited by badguy; 20th September 2011 at 04:47 AM.
Reply With Quote