On Mon, Jan 12, 2015 at 3:54 PM, Carlos E. R. <robin.listas@telefonica.net> wrote:
On 2015-01-12 08:28, Per Jessen wrote:
Carlos E. R. wrote:
Could snmptrapd be used to simply write what it gets to a text file, so that I can look and find out if there is anything interesting there?
Yep, absolutely. In /etc/snmp/snmptrapd.conf you specify which script should be called for which trap, e.g.:
traphandle IF-MIB::linkUp <script> <arguments> traphandle IF-MIB::linkDown <script> <arguments>
traphandle default <script-to-write-to-log>
To have traps sent from other Linux boxes, install net-snmp and put "trapsink <your snmptrapd machine>" in /etc/snmp/snmpd.conf.
I simply have:
authCommunity log,execute,net public authCommunity log,execute,net private
I thought that would write things to the log.
No, it simply enables snmptrapd to perform selected actions for selected community strings. How exactly it performs these actions is defined by other options.
The log is created (/var/log/net-snmpd.log) but is empty. I noticed a packet coming, I saw it on the firewall log.
Yes, my experience with net-snmp is that it logs not that much by default. You may need to tweak logging options. But I must admit configuring net-snmp is not for the faint of heart ... :)
I can't write a script to handle writing myself to the log if I absolutely have no idea what script to write or what is coming (I have no idea what the router sends, it is not documented at all)... I thought that the daemon would do the logging itself.
-- Cheers / Saludos,
Carlos E. R. (from 13.1 x86_64 "Bottle" at Telcontar)
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org