python script as event handler won't write to file

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

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

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

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

Post 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.
Former Nagios Employee
aramisbackwards
Posts: 13
Joined: Tue Nov 29, 2016 1:48 am

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

Post by aramisbackwards »

Got it, thank you for digging through all that!
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

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

Post by rkennedy »

No problem! Would you mind if we lock this thread up?
Former Nagios Employee
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

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

Post by tmcdonald »

Closing. PM if you need it re-opened.
Former Nagios employee
Locked