Page 1 of 1
glob service_perfdata_file
Posted: Mon Nov 03, 2014 2:12 pm
by skol
Is it possible to glob or otherwise dynamically set the service_perfdata_file?
Code: Select all
service_perfdata_file=/nagios/var/service_perfdata.log.$TIMET$
I was hoping that would work, or something similar. Any ideas? Background: I have a process which keeps state of where its at in the perfdata.log, and I'm trying to properly do log rotation, rather then create yet another process to call via
service_perfdata_file_processing_command.
Thanks!
Re: glob service_perfdata_file
Posted: Mon Nov 03, 2014 3:20 pm
by abrist
I would say yes, the $TIMET$ macro should be supported as it is used in other places in the config file. The real question is whether or not the perfdata reapers/npcd will work right with the changes. Let us know what happens!
Re: glob service_perfdata_file
Posted: Mon Nov 03, 2014 3:59 pm
by skol
It just writes to the literal file: /nagios/var/service_perfdata.log.$TIMET$ - looks like it isn't expanding it properly.. any ideas?
Re: glob service_perfdata_file
Posted: Mon Nov 03, 2014 4:06 pm
by abrist
Well, I just dug deeper and looks like you cannot use the $TIMET$ with certain options (the perfdata file directives seem to be some of them).
Just a curiosity, the perfdata file should be reaped very 15 seconds or so. Why are you trying to enable log rotation on it?
Re: glob service_perfdata_file
Posted: Mon Nov 03, 2014 6:00 pm
by skol
This is just for opensource core 4.x nagios - perfdata logs just grow continuously.
Re: glob service_perfdata_file
Posted: Mon Nov 03, 2014 6:01 pm
by abrist
What method of perfdata processing are you using? npcd? bulk mode? etc?
Could you post the command you are currently using for processing?
Re: glob service_perfdata_file
Posted: Mon Nov 03, 2014 6:13 pm
by skol
we're not running any processing on it - we just specify the filename (service_perfdata_file) and template. I'm trying to rotate the files without additional scripts (service_perfdata_file_processing_command) or use logrotate.
Re: glob service_perfdata_file
Posted: Tue Nov 04, 2014 11:25 am
by abrist
Well, you most likely need to use one of those (logrotate or service_perfdata_file_processing_command).
You could create a script that rotates the log file and run it from service_perfdata_file_processing_command - just set the interval to something much longer, like and hour/day/week/whatever.
Re: glob service_perfdata_file
Posted: Tue Nov 04, 2014 4:37 pm
by skol
Ok. Thanks for the help!
Re: glob service_perfdata_file
Posted: Tue Nov 04, 2014 4:40 pm
by cmerchant
Glad we could help. We'll go ahead and close this thread. Thanks.