Page 1 of 1
nrdp is filling up /tmp
Posted: Thu Aug 07, 2014 2:20 pm
by jssingh
I have nrdp running and it is working fine. However, it seems to be ignoring this setting in the config file:
Code: Select all
// full path to directory where temp scratch files can be written
// NOTE: the Apache user need to be able create files here, and the Nagios user needs to read/delete those same files, so the /tmp system directory won't work (it has a sticky bit on it)
$cfg["tmp_dir"]="/usr/local/nagios4/var/tmp";
and writing to /tmp. And since it can't delete from /tmp, /tmp is filling up.
I've checked the permissions on /usr/local/nagios4/var/tmp and it is writable by the nrdp user. Is there some other setting I need to be checking for?
Re: nrdp is filling up /tmp
Posted: Fri Aug 08, 2014 12:44 pm
by lmiltchev
// NOTE: the Apache user need to be able create files here, and the Nagios user needs to read/delete those same files
Can you show us the permissions of the tmp directory?
Re: nrdp is filling up /tmp
Posted: Mon Aug 11, 2014 11:01 am
by jssingh
With the usual modifications for user/group:
Code: Select all
$ ls -lad /usr/local/nagios4/var/tmp
drwxrwxr-x 2 <nagios_user> <nrdp_group> 4096 Feb 5 2014 /usr/local/nagios4/var/tmp
$
and I double checked, the Apache user is part of the nrdp group.
Re: nrdp is filling up /tmp
Posted: Mon Aug 11, 2014 2:55 pm
by jssingh
I cleaned out all Apache files in /tmp that are over a day old and now I don't see any of the nrdp files. NRDP seems to be working fine (everything is updating).
Do the files get read and deleted by NRDP so fast that I would never see them in an ls? I keep doing an ls on /usr/local/nagios4/var/tmp and I don't see any files ever, so I'm not 100% sure what's going on ... but it looks like the problem went away some time this weekend.
Re: nrdp is filling up /tmp
Posted: Mon Aug 11, 2014 3:40 pm
by scottwilkerson
NRDP uses the tempnam function when trying to write to the value set for
, in the config.inc.php.
From the
Manual
Creates a file with a unique filename, with access permission set to 0600, in the specified directory. If the directory does not exist, tempnam() may generate a file in the system's temporary directory, and return the full path to that file, including its name.
So it is possible that the files were created before this directory existed or the permissions were fixed.
Re: nrdp is filling up /tmp
Posted: Mon Aug 11, 2014 3:51 pm
by jssingh
oddly, the only change I made to the permissions on /usr/local/nagios4/var/tmp was to remove the write permission from other. So it went from 777 to 775. But whatever fixed it, I'm fine with that.
