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.
Nagios Core does use the /tmp directory for certain check results, but that is the case even if it's not using NRDP.
Is this a source install of Nagios core, or was it installed from a package manager like yum or apt?
[EDIT]
I just pulled up the source, I'm wondering if you need to update some file locations in your nrdp/config.inc.php file. This config file has directory locations assigned for a source install, but if you've got nagios installed from apt or yum, you may need to update the following locations in that file:
// full path to Nagios external command file
$cfg["command_file"]="/usr/local/nagios/var/rw/nagios.cmd";
// full path to check results spool directory
$cfg["check_results_dir"]="/usr/local/nagios/var/spool/checkresults";
// 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/nagios/var/tmp";
[root@centralnagios ~]# ps ax | grep nagios
1302 ? Ssl 0:02 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
[root@centralnagios ~]# grep /tmp /usr/local/nagios/etc/nagios.cfg
temp_path=/usr/local/nagios/var/tmp
#host_perfdata_file=/tmp/host-perfdata
#service_perfdata_file=/tmp/service-perfdata
[root@centralnagios ~]# cat /usr/local/nrdp/server/config.inc.php
<?php
// NRDP Config File
// Copyright (c) 2010 Nagios Enterprises, LLC.
// License: Nagios Open Software License <http://www.nagios.com/legal/licenses>
//
// $Id: config.inc.php 12 2010-06-19 04:19:35Z egalstad $
// an array of one or more tokens that are valid for this NRDP install
// a client request must contain a valid token in order for the NRDP to response or honor the request
// NOTE: tokens are just alphanumeric strings - make them hard to guess!
$cfg['authorized_tokens'] = array(
//"xxxxxxxxxx", // <-- a better token (don't use this exact one, make your own)
"yyyyyyyyyy","zzzzzzzzz" );
// do we require that HTTPS be used to access NRDP?
// set this value to 'false' to disable HTTPS requirement
$cfg["require_https"]=false;
// do we require that basic authentication be used to access NRDP?
// set this value to 'false' to disable basic auth requirement
$cfg["require_basic_auth"]=false;
// what basic authentication users are allowed to access NRDP?
// comment this variable out to allow all authenticated users access to the NRDP
$cfg["valid_basic_auth_users"]=array(
"nrdpuser"
);
// the name of the system group that has write permissions to the external command file
// this group is also used to set file permissions when writing bulk commands or passive check results
// NOTE: both the Apache and Nagios users must be a member of this group
$cfg["nagios_command_group"]="nagcmd";
// full path to Nagios external command file
$cfg["command_file"]="/usr/local/nagios/var/rw/nagios.cmd";
// full path to check results spool directory
$cfg["check_results_dir"]="/usr/local/nagios/var/spool/checkresults";
// 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/nagios/var/tmp";
///////// DONT MODIFY ANYTHING BELOW THIS LINE /////////
$cfg['product_name']='nrdp';
$cfg['product_version']='1.0'
?>
Is there something that would have been configured during the install for source pointing to /tmp?
I think Nagios core by default has the temp directory as /tmp. Just for fun can you try a 777 permissions on the NRDP temp directory and see if anything changes?
Also, can you post a sample of what you're submitting? I'll run some local tests with it as well and see if I can come up with anything.
I ran a local test again today, and I was able to make it work ok. I had an issue at first where my hostname was wrong (doh), but I had a running tail on the nagios.log to let me know on that one. Try submitting the check from the web interface, and then closely watching the /usr/local/nagios/var/spool/checkresults directory to verify that the file is getting sent to the results spool. If the file is there, but nothing is getting recieved, try it again while watching the nagios.log. The problem should show up somewhere (I hope ).
I did however since my last test install nagios fusion on the same box, any chance that somehow fixed whatever issue I was having, I'm pretty sure I haven't changed anything else since my last test.
Doing a clean install now to see if I get the same problem I had originally.
Wanna take bets on it being an SELinux issue? The Fusion installer turns it off, and I had a really weird and unrelated issue this weekend where PHP couldn't create a file even with 0777 perms because SELinux was turned on. SELinux, the silent killer.
mguthrie wrote:Wanna take bets on it being an SELinux issue? The Fusion installer turns it off, and I had a really weird and unrelated issue this weekend where PHP couldn't create a file even with 0777 perms because SELinux was turned on. SELinux, the silent killer.