Page 1 of 1

Nagios Core passive checks with NRDP

Posted: Thu Nov 06, 2014 12:03 pm
by mlasala
Hello,

Have been a few weeks since I started to try to monitor a device I have behind a firewall.
After reading some information I decided to use NRDP in my Nagios Core 3.5.1 on a CentOS 6.5 and the client in a machine that has visibility with the device I want to monitor.

I've configured the NRDP server with this configuration (config.inc.php):

Code: Select all

<?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)
        "************", <-- the token is hidden
	);
	
// do we require that HTTPS be used to access NRDP?
// set this value to 'false' to disable HTTPS requirement
$cfg["require_https"]=true;

// 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"]=true;

// 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(
	"nagiosadmin",
	);
	
// 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"]="nagios";

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

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

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

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


?>
I'm in the same LAN that the Nagios server and If I try to check the config from:
https://mynagiosserver.com/nrdp
I can see the XML form and both submits work. I can see it in /var/log/nagios/nagios.log

The issue is from the remote server, there I have two clients send_nrdp.php & send_nrdp.sh

I'm trying with this:
send_nrdp.sh -u https://nagiosadmin:*******@mynagiosserver.com/nrdp/ -t *********** -f files/myfile.ping.xml
php send_nrdp.php --url=https://nagiosadmin:**********@mm1.bcn. ... .com/nrdp/ --token=********* --host=myhost --state=0 --output='PING OK'

But I see nothing at all in the nagios log :'(

I would appreciate a lot some help!!

Re: Nagios Core passive checks with NRDP

Posted: Thu Nov 06, 2014 4:27 pm
by lmiltchev
Is port 443 open? Is selinux disabled? Have you tested it without using ssl?

Re: Nagios Core passive checks with NRDP

Posted: Wed Nov 12, 2014 4:06 am
by mlasala
Port 443 is opened, moreover, if I try to send the "Submit Nagios Command" from the testing form in https://mynagiosserver.mycompany.com/nrdp I can see the message in nagios.log.
Selinux is in permissive mode.
I've tried with and without ssl & auth but no success so far :(

Re: Nagios Core passive checks with NRDP

Posted: Wed Nov 12, 2014 10:04 am
by tmcdonald
Are we sure the NRDP results are even reaching the Nagios server? Try running a tcpdump then send the NRDP results from the remote machine.

Nagios server

Code: Select all

tcpdump port 80
Remote server

Code: Select all

send_nrdp.sh -u http://nagiosadmin:*******@mynagiosserver.com/nrdp/ -t *********** -f files/myfile.ping.xml