Don Cohen wrote:
> > I'm really not talking about the input to the shell but the input
> > to snmptrapd. In one case it got a string and in the other case a
> > string and an integer. It could tell the difference. But the
> > distinction was lost in the output it generated.
>
> Ok, now I understand what you are asking.
>
> What OS and what version of Net-SNMP are you using? In my syslog and
> also when logging to the console (snmptrapd -Lo -f) my strings are quoted:
> SNMPv2-SMI::enterprises.534.1.11.3.0 = STRING: "Alex"
>
> I tested with Net-SNMP 5.2.1.2.
I was using 5.0.9. It doesn't seem to understand -Lo.
I now try 5.1.3.1 and I do get quotes. Good.
And it does understand -Lo - I gather that corresponds to -P in 5.0.9.
But now when I try to use 5.1.3.1 I can't get anything else to work:
Somehow this quoting feature is sensitive to -M ?
# ./net-snmp-5.1.3.1/apps/snmptrapd -f -Lo
Cannot find module (IP-MIB): At line 0 in (none)
... many more of those complaints
In order to get rid of them I want to use -M
2005-09-07 17:27:44 NET-SNMP version 5.1.3.1 Started.
2005-09-07 17:27:51 number3 [10.0.0.1] (via 10.0.0.1) TRAP, SNMP v1,
community private
iso.3.6.1.4.1.2021.13.991 Enterprise Specific Trap (117)
Uptime: 145 days, 20:56:01.17
iso.3.6.1.2.1.1.6.0 = STRING: "XXX iso.2.3.4 = INTEGER:
1234"
2005-09-07 17:29:31 NET-SNMP version 5.1.3.1 Stopped.
# ./net-snmp-5.1.3.1/apps/snmptrapd -f -Lo -M /root/net-snmp-5.1.3.1/mibs/
[no complaints, so -M did what it was meant to]
2005-09-07 17:29:48 NET-SNMP version 5.1.3.1 Started.
2005-09-07 17:29:52 number3 [10.0.0.1] (via 10.0.0.1) TRAP, SNMP v1,
community private
UCD-SNMP-MIB::ucdExperimental.991 Enterprise Specific Trap
(117) Uptime: 145 days, 20:58:01.51
SNMPv2-MIB::sysLocation.0 = STRING: XXX iso.2.3.4 = INTEGER:
1234
but now the same input results in no quotes?
Then I try to get a configuration file to specify how to treat traps:
# ./net-snmp-5.1.3.1/apps/snmptrapd -f -c /tmp/snmptrapd.conf
where /tmp/snmptrapd.conf contains:
traphandle default /tmp/snmptraphandler
and I get
No log handling enabled - turning on stderr logging
Cannot find module (IP-MIB): At line 0 in (none)
...
and output similar to the first case above without -c,
but no call to /tmp/snmptraphandler.
This did work in 5.0.9.
Try calling it with -Dread_config so you can see what configuration
files it is loading. Maybe it is loading a snmp.conf file that has an
option specified that is disabling the quote (not sure if there is one).
Also try calling it with -C to prevent it from loading any other
configuration files except the ones you list. On my system, when I run
snmptrapd with:
snmptrapd -C -Lo -f -M /usr/local/share/snmp/mibs/ -Dread_config -c
/usr/local/share/snmp/snmptrapd.conf
I get:
read_config: Reading optional config file:
"/usr/local/share/snmp/snmptrapd.conf"
read_config: Reading configuration /usr/local/share/snmp/snmptrapd.conf
read_config: /usr/local/share/snmp/snmptrapd.conf:23 examining:
traphandle default /root/traphandle-help default
read_config: Found a parser. Calling it: traphandle / default
/root/traphandle-help default
read_config:traphandle: registering handler for: default
any the quoting works. This is with 5.2.1.2 on Linux and 5.1.3.1 on
Windows.
Windows: snmptrapd -C -Lo -f -M "c:/program
files/net-snmp/share/snmp/mibs" -Dread_config -c "c:/Program
Files/net-snmp/etc/snmp/snmptrapd.conf
Can you do a proper install of 5.1.3.1 instead of running from your home
directory?
Alex
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
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