Truncating the Nagios logs

BOLLENGIER Eric ebollengier at sigma.fr
Thu Nov 13 09:58:48 CET 2003


Hi,

It's a bad idea to move the logfile... you MUST truncate.
You can do something like

#!/bin/sh
cat > /var/log/nagios/process_data.log << EOF
EOF

or you can use program like logrotate or cfengine

bye

> #!/bin/sh
> DATE=`date +%d%m%Y`
> mv /var/log/nagios/process_data.log /var/log/nagios/archives/process_data_$DATE.log
> echo "`date +%c` [NAGIOS] Rotation du fichier nagios_perdata.log" >> /var/log/messages
> 




-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list