Page 1 of 1

how to stop check_log writing log files to /tmp?

Posted: Wed May 04, 2016 6:30 am
by sputnik1
Hi all.

I'm getting problems with the nagios check_log plugin writing a lot of log information to the /tmp directory.

/tmp
check_log.DNDTRJRMKH │160672K│May 1 02:21

I don't really need all this logging as it's filling up the root partition - so is there a way to turn off this logging to the /tmp directory please?

I've just had to manually delete about 5 GB worth of these files.

TIA

Keith

Re: how to stop check_log writing log files to /tmp?

Posted: Wed May 04, 2016 2:20 pm
by ssax
You could but then it would not work properly, the reason why it keeps those files is because it is literally a copy of the log file from the previous run. (taken from the help section of the plugin) It uses those files so that on the next run it knows what the new entries are, otherwise it would show you all of them every time it runs (even the previous ones).

My recommendation would be for you to setup check_logfiles since it creates seekfiles instead of copies of the logs so it won't eat up all that space. It's a bit more complicated to setup but it's worth your while:

https://labs.consol.de/nagios/check_logfiles/index.html

Re: how to stop check_log writing log files to /tmp?

Posted: Thu May 05, 2016 5:11 am
by sputnik1
Hi ssax,

Thanks for your reply. I will certainly keep the newer plugin in mind for future use.

I deleted all the old log files - but kept the most recent ones for 4th May.

It looks like the plugin has used those and continued with it's checking OK.

Doing a manual check using 'df -h' I see that matches what the plugin is reporting.

There are also newer logfiles for the 5th May being written to /tmp - so I think all is well so far.

Kind Regards,

Keith

Re: how to stop check_log writing log files to /tmp?

Posted: Thu May 05, 2016 9:47 am
by rkennedy
Glad to hear it's working! Are we good to mark this one as resolved then?

Re: how to stop check_log writing log files to /tmp?

Posted: Thu May 05, 2016 9:48 am
by ssax
I would say that if your log files are being rotated then you could also set up a cron job to delete the old check_log output at that time as well.