Page 1 of 2

setting up nrdp

Posted: Tue Feb 04, 2014 6:37 pm
by jssingh
I'm trying to switch from nsca to nrdp. I'm sure I'm missing some really obvious step somewhere, but how do I get NRDP to connect to the Nagios installation? I installed NRDP and I can see the test API page. And I get this error: "COMMAND FILE UNWRITEABLE". I'm guessing because I didn't link NRDP to the nagios command file ... how do I do that?

thanks,
-janice

Re: setting up nrdp

Posted: Wed Feb 05, 2014 12:47 pm
by lmiltchev
Can you post the "config.inc.php" file? Hide the sensitive info - the tokens, etc.

Re: setting up nrdp

Posted: Thu Feb 06, 2014 8:40 am
by Xperteks
You might try to check your nagios.cfg file as well.

Check for the section labeled: EXTERNAL COMMAND OPTION and see if that is a '1' or a '0' - it has to be '1' to enable the external commands which is how NRDP sends data to Nagios. (I think, I'm new)

Re: setting up nrdp

Posted: Thu Feb 06, 2014 11:35 am
by jssingh
Thanks for the replies. I looked at the config file again and realized I missed this line:
NOTE: both the Apache and Nagios users must be a member of this group
I've requested a new group (I can't just edit /etc/group), but it's taking awhile for it to get created. Hopefully it will be created soon and I can try again!

Re: setting up nrdp

Posted: Thu Feb 06, 2014 1:05 pm
by slansing
Awesome, let us know, that is likely the issue.

Re: setting up nrdp

Posted: Tue Feb 11, 2014 7:09 pm
by jssingh
So I *finally* was able to get the group account and I'm still having problems. I did a chgrp -R on the entire /usr/local/nagios4 directory, just to be sure. Here is my config file:

Code: Select all

cat 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(
	//"mysecrettoken",  // <-- not a good token
	//"90dfs7jwn3",   // <-- a better token (don't use this exact one, make your own)
    "*************"
	);
	
// 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(
	"******"
	);
	
// 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"]="****";

// full path to Nagios external command file
$cfg["command_file"]="/usr/local/nagios4/var/rw/nagios.cmd";

// full path to check results spool directory
$cfg["check_results_dir"]="/usr/local/nagios4/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/nagios4/var/tmp";

	
///////// DONT MODIFY ANYTHING BELOW THIS LINE /////////

$cfg['product_name']='nrdp';
$cfg['product_version']='1.0'


?>

This is the error I get:
COMMAND FILE UNWRITEABLE
And my nagios.cfg file does allow external commands.


Any thoughts?

Re: setting up nrdp

Posted: Wed Feb 12, 2014 11:39 am
by slansing
What is the output of:

Code: Select all

ls -la /usr/local/nagios4/var/rw/nagios.cmd

Re: setting up nrdp

Posted: Wed Feb 12, 2014 5:05 pm
by jssingh
I have to redact the user and group name, but the group name is the same as the one in the config file:

Code: Select all

$ ls -la /usr/local/nagios4/var/rw/nagios.cmd
prw-rw---- 1 ****** **** 0 Oct 31 14:10 /usr/local/nagios4/var/rw/nagios.cmd
$

Re: setting up nrdp

Posted: Wed Feb 12, 2014 5:55 pm
by lmiltchev
Normally, the "nagios.cmd" should be owned by nagios:nagcmd. What is the output of the following command?

Code: Select all

grep nag /etc/group

Re: setting up nrdp

Posted: Wed Feb 12, 2014 6:04 pm
by jssingh
I can't post that output ... but nagios.cmd is owned by the user dedicated for nagios. And I chose the group based on this comment:
// 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