Discussion:
Snmp v3 traps not recieved by application
(too old to reply)
Robert Story
2015-07-16 01:23:11 UTC
Permalink
On Fri, 29 May 2015 16:14:17 +0530 Ajit wrote:
AA> I have a application in C which receives snmp traps. There is a
AA> issue with v3 traps. Although I have done the necessary setup.
AA> I am able to receive v3 traps using the command "snmptrapd -Lo
AA> -n -f". But when I run my application , no traps are received.
AA>
AA> The reason may be that, my application is not reading a config
AA> file for snmp users and engineID unlike when I run snmptrapd
AA> which reads snmptrapd.conf.

[Note: CC/moving to coders list]

Hi Ajit,

Did you ever get this working? When you call init_snmp("myapp"),
the library should read myapp.conf and should generate an engineID.
You may need to set your persistent dir explicitly for the engineID
to be saved between runs (unless you're running as root). See
set_persistent_directory(const char *dir).


Robert
Ajit Ambekar
2015-07-16 05:44:50 UTC
Permalink
Hi Robert,

I used init_snmp("snmptrapd") and gave the engineIDs in this file of those
devices which are send me the traps.
This is working for me. But the problem is, first I need to manually enter
the engineID for every new device in the config file (snmptrapd.conf)

I will see the set_persistent_directory(const char *dir) API call as
suggested by you. Just let me know if this enables a trap from a device
who's engineID is not mentioned ? Basically my aim is to avoid the manual
task of adding the engineID. receiver should automatically identify any new
engineID and make an persistent entry.

A sample entry in the file would be like this,

createUser -e 0x80001f8880eef1d9395b355c5500000002 test

for noauthnopriv v3 traps with username as test.
Post by Robert Story
AA> I have a application in C which receives snmp traps. There is a
AA> issue with v3 traps. Although I have done the necessary setup.
AA> I am able to receive v3 traps using the command "snmptrapd -Lo
AA> -n -f". But when I run my application , no traps are received.
AA>
AA> The reason may be that, my application is not reading a config
AA> file for snmp users and engineID unlike when I run snmptrapd
AA> which reads snmptrapd.conf.
[Note: CC/moving to coders list]
Hi Ajit,
Did you ever get this working? When you call init_snmp("myapp"),
the library should read myapp.conf and should generate an engineID.
You may need to set your persistent dir explicitly for the engineID
to be saved between runs (unless you're running as root). See
set_persistent_directory(const char *dir).
Robert
--
Ambekar Ajit Shivaji
Mumbai.
Loading...