how to stop check_log writing log files to /tmp?

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
sputnik1
Posts: 4
Joined: Tue Apr 05, 2016 8:22 am

how to stop check_log writing log files to /tmp?

Post 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
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

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

Post 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
sputnik1
Posts: 4
Joined: Tue Apr 05, 2016 8:22 am

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

Post 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
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

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

Post by rkennedy »

Glad to hear it's working! Are we good to mark this one as resolved then?
Former Nagios Employee
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

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

Post 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.
Locked