Forwarding status and events from one server to another

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.
rjconroy
Posts: 38
Joined: Fri Feb 02, 2018 11:57 am

Re: Forwarding status and events from one server to another

Post by rjconroy »

yes I'm a little tunnel visioned myself and didn't catch that typo... here is the updated output from both:

parent:
parentserver:/usr/local/nrdp/clients# su - nagios
You have new mail in /var/mail/root
parentserver:/usr/local/nrdp/clients# umask
0022
parentserver:/usr/local/nrdp/clients# exit
exit


child:
childsensor:/usr/local/nrdp/clients# su - nagios
childsensor:/usr/local/nrdp/clients# umask
0022
childsensor:/usr/local/nrdp/clients# exit
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Forwarding status and events from one server to another

Post by dwhitfield »

By default, on many OSes, the access.conf is completely commented out. Do you have anything related to apache in there? Anything about apache in the sudoers?
rjconroy
Posts: 38
Joined: Fri Feb 02, 2018 11:57 am

Re: Forwarding status and events from one server to another

Post by rjconroy »

yes, access.conf appeared to be completely commented out
sudoers didn't have "apache" per se, however, the web services are run thru another account and it was there.
There were no entries relevant to any of the Nagios folders though.
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Forwarding status and events from one server to another

Post by tgriep »

Can you run your send_nrdp.php test from your previous post, please show the output of the command.

If nothing shows up in the nagios.log file, check the Apache log files for any errors when the test was ran.
Be sure to check out our Knowledgebase for helpful articles and solutions!
rjconroy
Posts: 38
Joined: Fri Feb 02, 2018 11:57 am

Re: Forwarding status and events from one server to another

Post by rjconroy »

The command has no output, when run from the client server it simply returns me to the command prompt and I observe the packets using tcpdump on server side.
rjconroy
Posts: 38
Joined: Fri Feb 02, 2018 11:57 am

Re: Forwarding status and events from one server to another

Post by rjconroy »

added, I see a bunch of files in the checkresults folder, but they appear to all be blank. Unsure if related just seemed out of place that files were created but nothing was written to them
rjconroy
Posts: 38
Joined: Fri Feb 02, 2018 11:57 am

Re: Forwarding status and events from one server to another

Post by rjconroy »

update...
found following error in apache error.log:
[Mon Feb 12 10:23:27.567137 2018] [:error] [pid 6889] [client 192.168.1.102:57903] PHP Warning: Invalid argument supplied for foreach() in /usr/local/nrdp/server/plugins/nagioscorepassivecheck/nagioscorepassivecheck.inc.php on line 161, referer: https://192.168.1.81/nrdp/

Here is that line and the section in the file listed
else if ($method == "json") {
foreach ($json["checkresults"] as $cr) {

// Get check result type
$type = "host";
foreach ($cr["checkresult"] as $var => $val) { This is line 161
if ($var == "type") {
$type = strval($val);
}
}


I also observed this in main apache.log:
a.v.c.d - - [12/Feb/2018:11:00:09 -0800] "POST /nrdp/ HTTP/1.1" 200 509 "https://w.x.y.z/nrdp/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0"
...but this wouldn't seem to indicate an issue if I'm reading it right.
rjconroy
Posts: 38
Joined: Fri Feb 02, 2018 11:57 am

Re: Forwarding status and events from one server to another

Post by rjconroy »

one more thing I found that I didn't observe previously or overlooked...
when I run the json test it shows result OK, however, in the Nagios.log there is a notification similar to this:
[1518465861] Warning: Check result queue contained results for host '', but the host could not be found! Perhaps you forgot to define the host in your config files?
This is appearing even though the host is defined and does appear in the GUI.

For example here is the conf for one of them:
define host{
host_name somehost
alias somehost
address 10.10.10.1
use generic-host
}
It would appear that the issue is that somehow its not associating the input with the correct host.
rjconroy
Posts: 38
Joined: Fri Feb 02, 2018 11:57 am

Re: Forwarding status and events from one server to another

Post by rjconroy »

added note again:
If I run the nrdp xml check the status updates, the json does not.
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Forwarding status and events from one server to another

Post by tgriep »

The send_nrpd.php script should be sending the data in XML format.
Can you disable SSL on the Nagios server so we can run tcpdump in Ascii mode so we can see what is being sent to the Nagios Server?

Run this as root on the Nagios server

Code: Select all

tcpdump -i any port 80 -A -vv
Run the send_nrpd.php command again and post the output of the tcpdump so we can see what is being received.

I haven't dome much testing but it does look like the JSON interface is not working.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked