Forwarding status and events from one server to another

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

Re: Forwarding status and events from one server to another

Postby rjconroy » Thu Feb 08, 2018 5:18 pm

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

Re: Forwarding status and events from one server to another

Postby dwhitfield » Thu Feb 08, 2018 5:19 pm

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?
dwhitfield
Former Nagios Staff
 
Posts: 4568
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN

Re: Forwarding status and events from one server to another

Postby rjconroy » Thu Feb 08, 2018 5:28 pm

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

Re: Forwarding status and events from one server to another

Postby tgriep » Fri Feb 09, 2018 2:54 pm

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!
User avatar
tgriep
Madmin
 
Posts: 6447
Joined: Thu Oct 30, 2014 9:02 am

Re: Forwarding status and events from one server to another

Postby rjconroy » Mon Feb 12, 2018 11:43 am

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: 33
Joined: Fri Feb 02, 2018 11:57 am

Re: Forwarding status and events from one server to another

Postby rjconroy » Mon Feb 12, 2018 11:49 am

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: 33
Joined: Fri Feb 02, 2018 11:57 am

Re: Forwarding status and events from one server to another

Postby rjconroy » Mon Feb 12, 2018 2:02 pm

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: 33
Joined: Fri Feb 02, 2018 11:57 am

Re: Forwarding status and events from one server to another

Postby rjconroy » Mon Feb 12, 2018 3:09 pm

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: 33
Joined: Fri Feb 02, 2018 11:57 am

Re: Forwarding status and events from one server to another

Postby rjconroy » Mon Feb 12, 2018 3:39 pm

added note again:
If I run the nrdp xml check the status updates, the json does not.
rjconroy
 
Posts: 33
Joined: Fri Feb 02, 2018 11:57 am

Re: Forwarding status and events from one server to another

Postby tgriep » Mon Feb 12, 2018 5:28 pm

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!
User avatar
tgriep
Madmin
 
Posts: 6447
Joined: Thu Oct 30, 2014 9:02 am

PreviousNext

Return to Nagios Core

Who is online

Users browsing this forum: No registered users and 8 guests