Tuesday, January 17, 2006
Tips for the week: Jan 16 2006
Q: How do I test the SNMP utilities shipped with Emanate Lite? (getone, getmany etc)
A: First you need to have an agent running. (OSE4.5.2 example)
$OSE_ROOT/examples/emanate_lite/obj/MOTO*/emanate_lite.elf
Get this going on a target and verify ose_snmp process is running.
Then ensure your host environment is correct:
$ env | grep SR
SR_MGR_CONF_DIR=C:\OSE\OSE5.1\cygwin\etc\srconf\mgr
ll $SR_MGR_CONF_DIR
-rw-r--r-- 1 Administ None 663 Jan 12 15:36 mgr.cnf
-rw-r--r-- 1 Administ None 75916 Jan 13 10:37 snmpinfo.dat
Now you can issue a basic host command using getone:
$OSE_ROOT/3part/emanate_lite/md5nodes/w32.bin/getone.exe
Use args for SNMPv1 and SNMPv2:
getone -v1 10.11.1.20 public sysDescr.0
getone -v2c 10.11.1.20 public sysDescr.0
Both these should return same:
sysDescr.0 = SNMPv1/SNMPv2c/SNMPv3 agent from SNMP Research, Inc.
You can try out the SNMPv3 version but it requires authentication. If you know the password, try it!
Q: Okay I tried it all out, but it doesn't work. I get this error:
OpenConfigFile: Can't open C:\OSE\OSE5.1\cygwin\etc\srconf\mgr/snmpinfo.dat for
reading: No such file or directory
at line 192 in file k_fileio.c
Failure in snmpinfo.dat
A: This means your environment isn't right. You need to set up the SR_MGR_CONF_DIR variable to point somewhere that exists (preferable within /etc/srconf), and you need to have at a minimum mgr.cnf and snmpinfo.dat files. Both are included with the Emanate Lite distribution within OSE in $OSE_ROOT/3part/md5nodes/config/mgr/ directory. You will find several versions of snmpinfo.dat elsewhere as well.
Q: I didn't even get that far, I got this error:
retrying . . .
at line 185 in file getone.c
A: That's even worse - means your host is not communicating with your target running the agent. Check the connection with the target.
Q: Okay, I'm not really using the OSE demo but I still need to run a quick test. How can I find fields in the code that are relevant and which I can use with host commands like getone?
A: Check in the source files for something like this:
"community public 0.0.0.0 read 4",
The "community" tells you this is a SNMPv1 entry, and the "public" is the community username. A common MIB-2 object every system has to implement is sysDescr.0 so you can use that for the test variable_name .
A: First you need to have an agent running. (OSE4.5.2 example)
$OSE_ROOT/examples/emanate_lite/obj/MOTO*/emanate_lite.elf
Get this going on a target and verify ose_snmp process is running.
Then ensure your host environment is correct:
$ env | grep SR
SR_MGR_CONF_DIR=C:\OSE\OSE5.1\cygwin\etc\srconf\mgr
ll $SR_MGR_CONF_DIR
-rw-r--r-- 1 Administ None 663 Jan 12 15:36 mgr.cnf
-rw-r--r-- 1 Administ None 75916 Jan 13 10:37 snmpinfo.dat
Now you can issue a basic host command using getone:
$OSE_ROOT/3part/emanate_lite/md5nodes/w32.bin/getone.exe
Use args for SNMPv1 and SNMPv2:
getone -v1 10.11.1.20 public sysDescr.0
getone -v2c 10.11.1.20 public sysDescr.0
Both these should return same:
sysDescr.0 = SNMPv1/SNMPv2c/SNMPv3 agent from SNMP Research, Inc.
You can try out the SNMPv3 version but it requires authentication. If you know the password, try it!
Q: Okay I tried it all out, but it doesn't work. I get this error:
OpenConfigFile: Can't open C:\OSE\OSE5.1\cygwin\etc\srconf\mgr/snmpinfo.dat for
reading: No such file or directory
at line 192 in file k_fileio.c
Failure in snmpinfo.dat
A: This means your environment isn't right. You need to set up the SR_MGR_CONF_DIR variable to point somewhere that exists (preferable within /etc/srconf), and you need to have at a minimum mgr.cnf and snmpinfo.dat files. Both are included with the Emanate Lite distribution within OSE in $OSE_ROOT/3part/md5nodes/config/mgr/ directory. You will find several versions of snmpinfo.dat elsewhere as well.
Q: I didn't even get that far, I got this error:
retrying . . .
at line 185 in file getone.c
A: That's even worse - means your host is not communicating with your target running the agent. Check the connection with the target.
Q: Okay, I'm not really using the OSE demo but I still need to run a quick test. How can I find fields in the code that are relevant and which I can use with host commands like getone?
A: Check in the source files for something like this:
"community public 0.0.0.0 read 4",
The "community" tells you this is a SNMPv1 entry, and the "public" is the community username. A common MIB-2 object every system has to implement is sysDescr.0 so you can use that for the test variable_name .
free invisible web counter