# SNMP not so simple.  Can't get it to work

## moshiach

SNMP obviously hates me.  I've tried several of the tutorials on gentoo-wiki and net-snmp all to no avail.  The best answer I am able to get when querying my localhost for system information is 

```
urd mibs # snmpget -c public  localhost system.sysUpTime.0

snmpget: Timeout (Sub-id not found: (top) -> system)

```

Same message when I query my supposedly snmp compatible linksys wrv200 router.  Any pointers would be helpful.  To start, here are my (sanitized) configs:

/etc/snmp/snmpd.conf

```

syslocation  URD

syscontact  root@home

sysservices 76

rwuser  snmpuser priv 

rouser  snmpreader auth 

rocommunity  public 127.0.0.1/32 

rwcommunity  private 192.168.1.0/24 

trap2sink  localhost public 

trapcommunity  public

authtrapenable  1

proc  snmpd 1 1

load  100 80 50

agentuser  snmp

agentgroup  snmp

agentaddress  tcp:161

com2sec local     127.0.0.1/32    public

com2sec local     192.168.1.0/24   public

group MyRWGroup v1         local

group MyRWGroup v2c        local

group MyRWGroup usm        local

view all    included  .1                               80

access MyROGroup ""      any       noauth    exact  all    none   none

includeAllDisks 90%

```

/etc/snmp/snmp.conf

```

defaultport  161

defversion  3

defcommunity  public

defsecurityname  snmpuser

defcontext  ""

defsecuritylevel  authNoPriv

defauthpassphrase  $snmpuser_pass

defprivtype  AES

defprivpassphrase  $snmpuser_pass

dodebugging  0

```

/etc/conf.d/snmp

```

SNMPD_FLAGS="-C -c /etc/snmp/snmpd.conf  "

SNMPD_FLAGS="${SNMPD_FLAGS} -a"

SNMPD_FLAGS="${SNMPD_FLAGS} -Lsd -Lf /dev/null"

```

All but conf.d/snmpd generated by snmpconf, although I've tried by hand, by using the included examples and by just changing the parts mentioned in several of the wiki guides.  No joy in mudville.  I cannot get snmp to return a single meaningful value.  Anyone have an idea what I am doing wrong?

Oh, and I tried net-snmp-5.4.1-r1, but ran into runtime errors complaining about net_Assert duplications.  Changing to the ~x86 version of 5.4.1-r3 at least got rid of those errors and allowed me to start snmpd.

Waiting anxiously for your expert assistance.

----------

## geforce

SNMP v3 requires username && password.

Here's what I did for my SNMP server:

```

net-snmp-config --create-snmpv3-user -a "PASSWORD" USERNAME

ln -s /usr/share/snmp/snmpd.conf /etc/snmp/snmpd.conf

echo "rouser USERNAME" > /etc/snmp/snmpd.conf

/etc/init.d/snmpd restart
```

rouser is for read-only user btw.

----------

## moshiach

 *geforce wrote:*   

> SNMP v3 requires username && password.
> 
> Here's what I did for my SNMP server:
> 
> ```
> ...

 

Did that as well.  Both snmpuser and snmpreader listed in snmpd.conf were created with net-snmp-config.

----------

## arndawg

Yeah i've been struggling to. I just gave up and used snmp v.1 instead. No hassle, just works.

----------

