NRDP v1.5.1 passive check issue with Nagios Core v4.3.4

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.
Locked
bayramka
Posts: 6
Joined: Tue May 08, 2018 6:36 am

NRDP v1.5.1 passive check issue with Nagios Core v4.3.4

Post by bayramka »

Hi All,

I'm facing an issue during sending remote host check result with nrdp client to nagios core.
I've installed NRDP server onto Nagios Core server and successfully tested with http://nagios_core_ip/nrdp/ link by sending external command.
But I can not successfully tested with send command both from web link and from remote nrdp client.

when i use nrdp client i seee below message and debug log that check result is successfully sending to nagios core server.
But there is no update seen from nagios core web interface nor nagios.log.

What am i missing?

./send_nrdp.py -t xxxxxx -u http://nagios_core_ip/nrdp -H nrdphost -S 0 -o ammana -c 1

Code: Select all

Sent 1 checks to http://nagios_core_ip/nrdp/
nrdp debug message on nagios core server--

Code: Select all

[Tue, 08 May 2018 14:53:34 +0300] nagioscorecmd_process_request(cbtype = PROCESS_REQUEST, args[cmd] = submitcheck
[Tue, 08 May 2018 14:53:34 +0300] nagioscorecmd_process_request() had no registered callbacks, returning
[Tue, 08 May 2018 14:53:34 +0300] nagioscorepassivecheck_process_request(cbtype = PROCESS_REQUEST, args[cmd] = submitcheck
[Tue, 08 May 2018 14:53:34 +0300] REQUEST: [token] xxxxxxxxxxxxxxxxxxxx
[Tue, 08 May 2018 14:53:34 +0300] REQUEST: [cmd] submitcheck
[Tue, 08 May 2018 14:53:34 +0300] REQUEST: [XMLDATA] <?xml version='1.0'?>
                                  <checkresults>
                                  <checkresult type='host'  checktype='1'><hostname>nrdphost</hostname><state>0</state><output>ammana</output></checkresult></checkresults>
[Tue, 08 May 2018 14:53:34 +0300] have xml
[Tue, 08 May 2018 14:53:34 +0300] our xml: SimpleXMLElement Object
                                  (
                                      [checkresult] => SimpleXMLElement Object
                                          (
                                              [@attributes] => Array
                                                  (
                                                      [type] => host
                                                      [checktype] => 1
                                                  )
                                  
                                              [hostname] => nrdphost
                                              [state] => 0
                                              [output] => ammana
                                          )
                                  
                                  )
                                  
[Tue, 08 May 2018 14:53:34 +0300] nrdp_write_check_output_to_cmd(hostname=nrdphost, servicename=, state=0, type=host, output=ammana
[Tue, 08 May 2018 14:53:34 +0300] nrdp_write_check_output_to_cmd() successful
[Tue, 08 May 2018 14:53:34 +0300] all nrdp (xml) checks have been written
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: NRDP v1.5.1 passive check issue with Nagios Core v4.3.4

Post by cdienger »

Have you configured any passive host or service checks for the 'nrdphost' ? It's not clear in the initial post if this was done, but passive checks still require host and service definitions:

https://assets.nagios.com/downloads/nag ... hecks.html
http://www.admin-magazine.com/Archive/2 ... ive-Checks

Please attach these configs if the are already configured. You'll also want to make sure that nagios.cfg is configured to load these as well as accept passive checks(https://assets.nagios.com/downloads/nag ... ice_checks).
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
bayramka
Posts: 6
Joined: Tue May 08, 2018 6:36 am

Re: NRDP v1.5.1 passive check issue with Nagios Core v4.3.4

Post by bayramka »

sorry for long delay,

I've configured host and services to accept only passive checks and i can see check results can able to written in /usr/local/nagios/var/spool/checkresults/ successfully but i can not see any update on nagios core web interface nor nagios.log

I'm concerning about file or folder permissions but not sure.

please see below configurations--

#ls -al /usr/local/nagios/var/spool/checkresults/ Wed Jun 13 01:39:18 2018
total 24
drwxrwsrwx 2 nagios nagcmd 4096 Jun 13 01:39 .
drwxr-sr-x 3 root nagios 4096 Apr 18 18:13 ..
-rwxrwx--- 1 www-data nagcmd 243 Jun 13 01:39 cdR8HmV
-rw-r--r-- 1 www-data nagcmd 0 Jun 13 01:39 cdR8HmV.ok
-rwxrwx--- 1 www-data nagcmd 243 Jun 13 01:39 cfqgDzK
-rw-r--r-- 1 www-data nagcmd 0 Jun 13 01:39 cfqgDzK.ok
-rwxrwx--- 1 www-data nagcmd 203 Jun 13 01:39 cPK5urw
-rw-r--r-- 1 www-data nagcmd 0 Jun 13 01:39 cPK5urw.ok
-rwxrwx--- 1 www-data nagcmd 203 Jun 13 01:39 cQfF8Xk
-rw-r--r-- 1 www-data nagcmd 0 Jun 13 01:39 cQfF8Xk.ok

# cat /usr/local/nagios/etc/objects/hosts.cfg

define host {
host_name nrdphost
alias nrdphost
active_checks_enabled 0
passive_checks_enabled 1
check_freshness 0
freshness_threshold 300
icon_image_alt Linux
icon_image linux40.gif
statusmap_image linux40.gd2
check_command check_dummy
check_period 24x7
notification_period 24x7
contact_groups +admins
use nrdp-host-template
}

# cat /usr/local/nagios/etc/objects/services.cfg

define service {
service_description nrdpservice
check_command check_dummy2!
host_name nrdphost
check_period 24x7
notification_period 24x7
active_checks_enabled 0
passive_checks_enabled 1
check_freshness 0
freshness_threshold 300
event_handler_enabled 0
use generic-nrdp-service
contact_groups +admins
}

# cat /usr/local/nagios/etc/objects/host_templates.cfg

define host {
name nrdp-host-template
register 0
max_check_attempts 1
check_interval 1
retry_interval 1
notification_interval 1
active_checks_enabled 0
passive_checks_enabled 1
check_freshness 0
freshness_threshold 600
check_period 24x7
notification_period 24x7
check_command check_dummy
}

# cat /usr/local/nagios/etc/objects/service_templates.cfg

define service {
name generic-nrdp-service
register 0
max_check_attempts 1
check_interval 5
retry_interval 1
notification_interval 60
active_checks_enabled 0
passive_checks_enabled 1
check_freshness 0
freshness_threshold 300
check_period 24x7
notification_period 24x7
}


# cat /usr/local/nrdp/server/config.inc.php

<?php
//
// NRDP Config File
//
// Copyright (c) 2010-2017 - Nagios Enterprises, LLC.
// License: Nagios Open Software License <http://www.nagios.com/legal/licenses>
//

// 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)
"blablabla",
);

// By default, all authorized tokens are allowed to submit any
// external command (unless it's disable below)
// This is a deny mapping in the form of COMMAND => TOKEN or TOKENS
// You can specify a whole command, or use * as a wildcard
// Or you can specify 'all' to stop any token from using any external command
// the tokens specified can either be a string with 1 token, or an array of 1 or more tokens
$cfg['external_commands_deny_tokens'] = array(
// "ACKNOWLEDGE_HOST_PROBLEM" => array("mysecrettoken", "myothertoken"),
// "ACKNOWLEDGE_SVC_PROBLEM" => "mysecrettoken",
// "all" => array("mysecrettoken", "myothertoken"),
// "ACKNOWLEDGE_*" => "mysecrettoken",
// "*_HOST_*" => array("mysecrettoken", "myothertoken"),
);


// 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";

// Should we allow external commands? Set to true or false (Boolean, not a string)
$cfg["disable_external_commands"] = false;

// Allows Nagios XI to send old check results directly into NDO if configured
$cfg["allow_old_results"] = false;

// Enable debug logging
$cfg["debug"] = true;

// Where should the logs go?
$cfg["debug_log"] = "/usr/local/nrdp/server/debug.log";


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

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


?>
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: NRDP v1.5.1 passive check issue with Nagios Core v4.3.4

Post by scottwilkerson »

this is not owned by the correct user

Code: Select all

chown nagios.nagios /usr/local/nagios/var/spool/
Also, in your nagios.cfg you need to verify that you have the following set

Code: Select all

check_result_path=/usr/local/nagios/var/spool/checkresults
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
bayramka
Posts: 6
Joined: Tue May 08, 2018 6:36 am

Re: NRDP v1.5.1 passive check issue with Nagios Core v4.3.4

Post by bayramka »

thanks for your help.
it was file permission issue as you recommended.
now it's working fine
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: NRDP v1.5.1 passive check issue with Nagios Core v4.3.4

Post by scottwilkerson »

bayramka wrote:thanks for your help.
it was file permission issue as you recommended.
now it's working fine
glad it is working!

Locking
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked