Page 2 of 2

Re: python script as event handler won't write to file

Posted: Tue Feb 07, 2017 10:50 am
by rkennedy
I'll verify with our developers, but it may just be used for Nagios related files.

Code: Select all

Format:	temp_path=<dir_name>
Example:	temp_path=/tmp
This is a directory that Nagios can use as scratch space for creating temporary files used during the monitoring process. You should run tmpwatch, or a similiar utility, on this directory occassionally to delete files older than 24 hours.
Digging through some other documentation here - https://assets.nagios.com/downloads/nag ... e-3-en.pdf - I did find a mention that to call to it, you need to pass $TEMPPATH$ through somewhere.

Code: Select all


$TEMPPATH$ The directory specified by the temp path variable. 

Re: python script as event handler won't write to file

Posted: Tue Feb 07, 2017 11:15 am
by rkennedy
Looks like that's what it is, see the response below -

Code: Select all

temp_path and temp_file are used ONLY while writing out status.dat and retention.dat. It is passed along with macros to checks and event handlers. But before any check or handler is run, the system changes directory to /tmp.

Re: python script as event handler won't write to file

Posted: Tue Feb 07, 2017 11:32 pm
by aramisbackwards
Got it, thank you for digging through all that!

Re: python script as event handler won't write to file

Posted: Wed Feb 08, 2017 10:27 am
by rkennedy
No problem! Would you mind if we lock this thread up?

Re: python script as event handler won't write to file

Posted: Wed Mar 01, 2017 2:14 pm
by tmcdonald
Closing. PM if you need it re-opened.