Here is the output I want from my snmpd

something like this

#snmpgetnext -v1 -On -c public 127.0.0.1 1.3.6.1.4.1.2699.1.2
.1.3.6.1.4.1.2699.1.2.1.1.1.0 = STRING: "en-US"
#snmpget -v1 -On -c public 127.0.0.1 1.3.6.1.4.1.2699.1.2.1.1.2.0
.1.3.6.1.4.1.2699.1.2.1.1.2.0 = Gauge32: 1
#snmpget -v1 -On -c public 127.0.0.1 1.3.6.1.4.1.2699.1.2.1.2.1.1.2.1
.1.3.6.1.4.1.2699.1.2.1.2.1.1.2.1 = STRING: "MODEL"
#snmpget -v1 -On -c public 127.0.0.1 1.3.6.1.4.1.2699.1.2.1.3.1.1.6.1.1
.1.3.6.1.4.1.2699.1.2.1.3.1.1.6.1.1 = INTEGER: 9100

I can not figure out how to get snmpd to respond with anything much
less the above.

Here is what I tried.

first I had a look at the config file
/etc/snmp/snmpd.conf

down in the file I see

# exec .1.3.6.1.4.1.2021.50 shelltest /bin/sh /tmp/shtest

so I think maybe I can make mine like that so I put in

exec .1.3.6.1.4.1.2699.1.2.1.1.1.0 lang /scripts/response.sh lang
exec .1.3.6.1.4.1.2699.1.2.1.2.1.1.2.1 model /scripts/response.sh model

when I restart snmpd it gives the error

Error: ERROR: This output format has been deprecated - Please use the
'extend' directive instead

so I looked at the man page and extend has the same syntax as exec
so I change exec to extend

extend .1.3.6.1.4.1.2699.1.2.1.1.1.0 lang /scripts/response.sh lang
extend .1.3.6.1.4.1.2699.1.2.1.2.1.1.2.1 model /scripts/response.sh model

and restarted snmpd with no errors
so then I try a query

# snmpget -v1 -On -c public 127.0.0.1 1.3.6.1.4.1.2699.1.2.1.1.1.0
Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: .1.3.6.1.4.1.2699.1.2.1.1.1.0

so I look on the web for

snmpd.conf "extend .1.3.6.1.4.1"

this page http://www.observium.org/wiki/NetSNMPd_Client_Configuration
looked promising

I edited /etc/sysconfig/snmpd and added

OPTIONS="-Lsd -Lf /dev/null -p /var/run/snmpd.pid"

I edited /etc/snmp/snmpd.conf and added where it was commented out

view all    included  .1                               80

restarted snmpd and tried my query again with the same result?

I have no idea what to try next.

here is my config file without comments and blank lines

#cat /etc/snmp/snmpd.conf |grep -v "^#"|grep -v "^$"
com2sec notConfigUser  default       public
group   notConfigGroup v1           notConfigUser
group   notConfigGroup v2c           notConfigUser
view    systemview    included   .1.3.6.1.2.1.1
view    systemview    included   .1.3.6.1.2.1.25.1.1
access  notConfigGroup ""      any       noauth    exact  systemview none none
view all    included  .1                                80
syslocation Unknown (edit /etc/snmp/snmpd.conf)
syscontact Root <root@localhost> (configure /etc/snmp/snmp.local.conf)
dontLogTCPWrappersConnects yes
extend .1.3.6.1.4.1.2699.1.2.1.1.1.0 lang /scripts/response.sh lang
extend .1.3.6.1.4.1.2699.1.2.1.2.1.1.2.1 model /scripts/response.sh model

here is my /scripts/response.sh

#!/bin/bash

case "$1" in
"lang")
echo en-US
;;
"model")
echo "HP Color LaserJet 2500"
;;
esac

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to