Re: snmptrapd does not write to log after logrotate

Joel Hansell <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <CAChT3kuYXA_o9QkC5uR4e5ituXVwBMWmmO8skxrdcDmJXH3BEA@mail.gmail.com>
Hi Stefan,

If you issue a SIGHUP (Hangup signal) to the snmptrapd process, it will
re-read its config and also start logging to the rotated (empty) file. You
should add this step to the logrotate job.

Watch out for a bug in some older versions (5.6.1.1 notably) where
snmptrapd will fail to re-read the config efter 4096 SIGHUPs are received...

BR,
Joel Hansell


On Mon, Mar 31, 2014 at 10:32 AM, Stefan Billeb <[email protected]>wrote:

> Hello,
>
> I am using snmptrapd along with snmptt on my server.
> I recently did the following configuration on my server:
>
> * Set the listening of snmptrapd to 0.0.0.0 udp/1602 in the init-script
> * Duplicating incoming snmp traps with "samplicate", sent to own server
> ip/1602 and other host/162
> * Logrotate, log-target etc. still the same like it is for nearly a year
> now
>
> Since this configuration was done it seems that snmptrapd does not write
> to /var/log/net-snmpd.log when logrotate did rotate the logfile.
> Even though the rights are correct, after a logrotate was issued the
> snmptrapd daemon does not log to the file.
> Restarting the service appears to solve it. The log file is again filled
> with entries.
>
> I am not sure if this is really a logrotate problem - but I can't figure
> out what the problem really is, as with restart of service no
> permissions or anything change on /var/log/net-snmpd.log
> But I have seen this for days now that the log-file is empty after a
> logrotate was done until I restart the snmptrapd.
>
> Init-Script start options:
>
> OPTIONS="-Lf /var/log/net-snmpd.log -p /var/run/snmptrapd.pid
> udp:0.0.0.0:1602"
>
> Note that samplicate works as it should and traps are in any way
> received and processed correctly with snmptrapd and snmptt. It is just a
> problem with log-file.
>
> Regards,
> Stefan
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Net-snmp-users mailing list
> [email protected]
> Please see the following page to unsubscribe or change other options:
> https://lists.sourceforge.net/lists/listinfo/net-snmp-users
>

------------------------------------------------------------------------------

_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.