Link to home
Start Free TrialLog in
Avatar of trazodone
trazodoneFlag for Thailand

asked on

snmp error in packet. reason noaccess

Hello Expert,

I try to use snmpset with below command

snmpset -v 3 -c public -u netadmin -l authPriv -a MD5 -A password localhost .1.3.6.1.4.1.88888.1.9.1.1.2 s "111111"

the OID .1.3.6.1.4.1.88888.1.9.1.1.2 is read-write

Thank you.
SOLUTION
Avatar of arnold
arnold
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of trazodone

ASKER

I used command sudo ./snmpwalk -v 3 -u netadmin -l authPriv -a MD5 -A password -x DES -X password localhost .1.3.6.1.4.1.88888.1

and I have got info SNMPv2-SMI::enterprises.88888.1.7.1.0 = Hex-STRING: 00

Next, I tried to snmpset the OID .1.3.6.1.4.1.88888.1.7.1.0

sudo ./snmpset -v 3 -u netadmin -l authPriv -a MD5 -A password -x DES -X password localhost .1.3.6.1.4.1.88888.1.7.1.0 s "OPEN"
Error in packet.
Reason: noAccess
Failed object: SNMPv2-SMI::enterprises.88888.1.7.1.0

without -c public. I have got the same error

I am wondering it seems OID .1.3.6.1.4.1.88888.1.7.1.0 dows not exist?

Thank you.
Additional

I tried snmpget and seems OID .1.3.6.1.4.1.88888.1.7.1.0 exist

sudo ./snmpget -v 3 -u netadmin -l authPriv -a MD5 -A password -x DES -X password localhost .1.3.6.1.4.1.88888.1.7.1.0
SNMPv2-SMI::enterprises.88888.1.7.1.0 = Hex-STRING: 00
Data types ids hex-string so I tried with option x

sudo ./snmpset -v 3 -u netadmin -l authPriv -a MD5 -A password -x DES -X password localhost .1.3.6.1.4.1.88888.1.7.1.0 x "OPEN"
.1.3.6.1.4.1.88888.1.7.1.0: Bad value notation (OPEN)

and

sudo ./snmpset -v 3 -u netadmin -l authPriv -a MD5 -A password -x DES -X password localhost .1.3.6.1.4.1.88888.1.7.1.0 x "0x2D"
Error in packet.
Reason: noAccess

Not success :)
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Without sudo

 ./snmpset -v 3 -u netadmin -l authPriv -a MD5 -A password -x DES -X password localhost .1.3.6.1.4.1.88888.1.7.1.0 x "01"
Error in packet.
Reason: noAccess
Failed object: SNMPv2-SMI::enterprises.88888.1.7.1.0

without sudo with -v 2c

./snmpset -v 2c -c public -u netadmin -l authPriv -a MD5 -A password -x DES -X password localhost .1.3.6.1.4.1.88888.1.7.1.0 x "01"
Timeout: No Response from localhost

look better but timeout

Will you plese guide how  to configure a read/write community?

Thank you
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
./snmpset -v 2c -c public -u netadmin -l authPriv -a MD5 -A password -x DES -X password localhost .1.3.6.1.4.1.88888.1.7.1.0 x "0x2D"
Timeout: No Response from localhost
My snmpd.conf contains

rouser netadmin
rouser netadmin
rwcommunity public

Restart snmpd and snmpset is timeout

Thanks
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
No I don't have rwuser netadmin and the snmpd.conf is empty file
I just modified rwuser netadmin. Restart snmpd and result is timeout. How do I add com2sec?

Thank you.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I add

#       sec.name  source          community
com2sec local     localhost       COMMUNITY

to snmpd.conf

Result=timeout
Command

 ./snmpwalk -v 2c -c public localhost
Timeout: No Response from localhost

Location of file snmpd.conf

/usr/local/share/snmp/snmpd.conf

This file may not be a correct snmpd.conf I am finding other snmpd.conf
I found snmpd.conf example file which contains com2sec. How can I bring this file to be a snmpd.conf of snmpd application?

File located here
/home/tee/alarmbox/applications/net-snmp-5.7.3/python/netsnmp/tests/snmpd.conf
My linux

uname -a
Linux ubuntu 3.13.0-74-generic #118~precise1-Ubuntu SMP Fri Dec 18 10:39:27 UTC 2015 i686 i686 i386 GNU/Linux
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I used snmpconf which create snmpd.conf at path

/usr/local/share/snmp

snmpd.conf content below

###########################################################################
#
# snmpd.conf
#
#   - created by the snmpconf configuration program
#









###########################################################################
# 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  netadmin

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

rwcommunity  public
Update

tee@ubuntu:~/alarmbox/applications/net-snmp-5.7.3/apps$ ./snmpset -v 2c -c public -u netadmin -l authPriv -a MD5 -A password -x DES -X password 127.0.0.1 .1.3.6.1.4.1.88888.1.7.1.0 x "0x2D"
Error in packet.
Reason: notWritable (That object does not support modification)
Failed object: SNMPv2-SMI::enterprises.88888.1.7.1.0

I can confirm that files .c and .h config this OID read-write. Do you know how to check if OID can be modify?

Thank you.
My mistake the OID is read-only. Let me modify MIB file .c and .h and try again.

Thank you.
Hello I found another error

tee@ubuntu:/opt/snmp/bin$ ./snmpget -v 3 -u netadmin -l authPriv -a MD5 -A password -x DES -X password localhost .1.3.6.1.4.1.88888.1.7.1.0
SNMPv2-SMI::enterprises.88888.1.7.1.0 = STRING: "UNKNOWN_STATUS"

tee@ubuntu:/opt/snmp/bin$ ./snmpset -v 2c -c public -u netadmin -l authPriv -a MD5 -A password -x DES -X password 127.0.0.1 .1.3.6.1.4.1.88888.1.7.1 s "OPEN"
Error in packet.
Reason: noCreation (That table does not support row creation or that object can not ever be created)
Failed object: SNMPv2-SMI::enterprises.88888.1.7.1

Thank you.
Finally

./snmpset -v 2c -c public -u netadmin -l authPriv -a MD5 -A password -x DES -X password 127.0.0.1 .1.3.6.1.4.1.88888.1.7.1.0 s "OPEN"
SNMPv2-SMI::enterprises.88888.1.7.1.0 = STRING: "OPEN"

Seems it is working but when I tried snmpget

tee@ubuntu:/opt/snmp/bin$ ./snmpget -v 2c -c public -u netadmin -l authPriv -a MD5 -A password -x DES -X password localhost .1.3.6.1.4.1.88888.1.7.1.0
SNMPv2-SMI::enterprises.88888.1.7.1.0 = STRING: "UNKNOWN_STATUS"
tee@ubuntu:/opt/snmp/bin$

Do you have idea why it is "UNKNOWN_STATUS"

Thank you.
In prior, the definition as hex string, open, is not valid. Your other attempts had 0x2D does setting that make a difference?
Hello

It is difference <mib>.c file so the x "0x2D" is not exist anymore. The new one is s "OPEN"

tee@ubuntu:/opt/snmp/bin$ ./snmpget -v 2c -c public -u netadmin -l authPriv -a MD5 -A password -x DES -X password localhost .1.3.6.1.4.1.88888.1.7.1.0
SNMPv2-SMI::enterprises.88888.1.7.1.0 = STRING: "UNKNOWN_STATUS"
tee@ubuntu:/opt/snmp/bin$
I do not know which MIB you are using, in your prior response, the field type was indicated as HEX: String....
nor whether this SNMP OID when open is set, triggers an event at which point the status of the item is unknown.
Hello Arnold,

Finally I is working once I config the snmpd.config with com2sec. Thank you. I will soon close this topic. Do you have additional info?
Info? I have, ir think I have broad knowledge, need to understand what additional info or concern, considerations you have in mind.
Thank you.