Discussion:
snmptrapd options
a***@wanex.ge
2003-04-12 09:26:01 UTC
Permalink
I have written trap handling script that collects all trap information
that I need.
I want to receive numeric oids but not verbal (like 1.3.6.1.4.1. ... and
not enterprises. ...).
As it is written in man pages and help of snmptrapd, snmptrapd has an
option "-O n" - print oids numerically
but it doesn't work. With this option it sends oids as usual (not numeric).
Can anybody help?
Dave Shield
2003-04-14 07:05:02 UTC
Permalink
Post by a***@wanex.ge
I want to receive numeric oids but not verbal (like 1.3.6.1.4.1. ... and
not enterprises. ...).
As it is written in man pages and help of snmptrapd, snmptrapd has an
option "-O n" - print oids numerically
but it doesn't work.
I've just tried this - both with a v4 line version of snmptrapd (4.2.4)
and with a v5 line version (5.0.8).
In both cases, I'm invoking it as
snmptrapd -P -f -On
and
snmptrapd -P -f -O n

and in all cases, I'm seeing the OIDs displayed in numeric format, as
expected.

What version of the command are you using, and how are you invoking it?

Dave
a***@wanex.ge
2003-04-14 12:36:07 UTC
Permalink
snmptrapd -v /var/run/snmptrapd.pid -Ofn -n -o /snmp/logs/raw.log

I tried running with -P and -f (after stopping deamon) but everything is
same.
[ First - *please* don't mail me privately, without copying
any responses to the mailing list. I don't have the time
or inclination to offer private, unpaid, SNMP consultancy.
Keep discussions to the list, where others can both learn
and offer advice. Thanks. ]
I'm using v 4.2.4 but without -P and -f options.
My trap handling script is never getting numeric oids.
OK - then there's two things we can try.
Firstly, I'll try running things the way you have them on my machine.
What's the *exact* command that you're using to fire up the trap handler?
Secondly, can you try running the trap handler using '-P -f' (so it's
running as a "normal" command rather than a daemon), and see whether
it translates things sensibly or not.
Dave
Dave Shield
2003-04-14 13:26:02 UTC
Permalink
Post by a***@wanex.ge
snmptrapd -v /var/run/snmptrapd.pid -Ofn -n -o /snmp/logs/raw.log
I assume that '-v' is meant to be a '-u' ?

$ sudo snmptrapd -u /var/run/snmptrapd.pid -Ofn -n -o /tmp/snmp.raw.log
$ sudo snmpd -f -L -d
Sending 44 bytes to 127.0.0.1:162
[snip]
UCD-SNMP version 4.2.4
^C
Received TERM or STOP signal... shutting down...
Sending 44 bytes to 127.0.0.1:162
[snip]
$ cat /tmp/snmp.raw.log
2003-04-14 16:15:31 UCD-snmp version 4.2.4 Started.
2003-04-14 16:18:15 daves.staff.csc.liv.ac.uk [138.253.185.91]
(via localhost [127.0.0.1]) TRAP, SNMP v1, community public
.1.3.6.1.4.1.2021.250.10 Cold Start Trap (0) Uptime: 0:00:00.63

2003-04-14 16:19:35 daves.staff.csc.liv.ac.uk [138.253.185.91]
(via localhost [127.0.0.1]) TRAP, SNMP v1, community public
.1.3.6.1.4.1.2021.251 Enterprise Specific Trap (2) Uptime: 0:01:20.66


I'm stumped as to why it's not working for you, I'm afraid.
It looks fine at this end.


The only other suggestion I can make is to turn on debugging.
Either "snmptrapd -Dread-config ....." (in case there's a config setting
that's overriding the -On command line flag), or "snmptrapd -Dall"
(and plough through the flood of output, looking for something odd!)

Sorry not to be more help.

Dave

Loading...