1
votes

I'm trying to send a trap using snmptrap. It works fine if I run as root.

If I run as a non-root user, I get lots of errors about "Cannot find module (XYZ): At line 0 in (none)". eg, HOST-RESOURCES-MIG, HOST-RESOURCES-TYPES, UCD-DISKIO-MIB, ...

I assume there's some files it can't read. Is there a simple way to run snmptrap as non-root? Or is there a better alternative?

1

1 Answers

0
votes

Those errors don't look related to requiring root privileges. Likely you have different environment (specifically net-snmp default paths to MIBs) for the different users ?

Try

net-snmp-config --default-mibdirs

for each users. In my own setup I see output something like this:

/Users/some_user/.snmp/mibs:/usr/share/snmp/mibs

See netsnmp page for more detail on use of -M and -m flags to set up environment per user.