Page 2 of 3

Re: NRDP checks not reporting to main Nagios XI install

Posted: Fri Feb 07, 2020 5:01 pm
by cdienger
Run the following on the sending device:

Code: Select all

curl -XPOST https://monitor.c1.net.au/nrdp/ -d 'cmd=submitcheck&token=NRDP_TOKEN&JSONDATA=%7B%0A%20%20%20%20%22checkresults%22%3A%20%5B%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%22checkresult%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22type%22%3A%20%22host%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22checktype%22%3A%20%221%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22hostname%22%3A%20%22somehost%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22state%22%3A%20%220%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22output%22%3A%20%22Everything%20looks%20okay!%20%7C%20perfdata%3D1%3B%22%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%5D%0A%7D%0A' -k -v
and:

Code: Select all

curl -XPOST http://monitor.c1.net.au/nrdp/ -d 'cmd=submitcheck&token=NRDP_TOKEN&JSONDATA=%7B%0A%20%20%20%20%22checkresults%22%3A%20%5B%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%22checkresult%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22type%22%3A%20%22host%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22checktype%22%3A%20%221%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22hostname%22%3A%20%22somehost%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22state%22%3A%20%220%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22output%22%3A%20%22Everything%20looks%20okay!%20%7C%20perfdata%3D1%3B%22%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%5D%0A%7D%0A' -v
Make sure to replace NRDP_TOKEN with your actual token. The receiving XI appears to be recognizing the nrpd interface on http. If you point your browser to https://monitor.c1.net.au/nrdp/, does the page open?

Re: NRDP checks not reporting to main Nagios XI install

Posted: Sun Feb 09, 2020 4:09 pm
by benh
The commands to directly check from sender were both sitting there doing nothing.

But it did reveal that even though I had put an IP address directly into the sender config, that it was then trying to use a FQDN for the post command, and that it was resolving the external address and not the internal one.

Once I dropped a host entry into the sender and re-ran those http/https checks they immediately came back with success post as below.

Am waiting to see if anything appears in unconfigured objects currently.

About to connect() to <FQDN> port 443 (#0)
* Trying <IP>...
* Connected to <FQDN> (<IP>) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* skipping SSL peer certificate verification
* SSL connection using TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
* Server certificate:
* subject: E=[email protected],CN=localhost.localdomain,OU=SomeOrganizationalUnit,O=SomeOrganization,L=SomeCity,ST=SomeState,C=--
* start date: Aug 22 16:21:40 2012 GMT
* expire date: Aug 22 16:21:40 2013 GMT
* common name: localhost.localdomain
* issuer: E=[email protected],CN=localhost.localdomain,OU=SomeOrganizationalUnit,O=SomeOrganization,L=SomeCity,ST=SomeState,C=--
> POST /nrdp/ HTTP/1.1
> User-Agent: curl/7.29.0
> Host: <FQDN>
> Accept: */*
> Content-Length: 695
> Content-Type: application/x-www-form-urlencoded
>
* upload completely sent off: 695 out of 695 bytes
< HTTP/1.1 200 OK
< Date: Sun, 09 Feb 2020 20:55:03 GMT
< Server: Apache/2.2.15 (CentOS)
< X-Powered-By: PHP/5.3.3
< Content-Length: 87
< Connection: close
< Content-Type: application/json
<
{ "result" : { "status" : "0", "message" : "OK", "output" : "1 checks processed." } }
* Closing connection 0


About to connect() to <FQDN> port 80 (#0)
* Trying <IP>...
* Connected to <FQDN> (<IP>) port 80 (#0)
> POST /nrdp/ HTTP/1.1
> User-Agent: curl/7.29.0
> Host: <FQDN>
> Accept: */*
> Content-Length: 695
> Content-Type: application/x-www-form-urlencoded
>
* upload completely sent off: 695 out of 695 bytes
< HTTP/1.1 200 OK
< Date: Sun, 09 Feb 2020 20:55:09 GMT
< Server: Apache/2.2.15 (CentOS)
< X-Powered-By: PHP/5.3.3
< Content-Length: 87
< Connection: close
< Content-Type: application/json
<
{ "result" : { "status" : "0", "message" : "OK", "output" : "1 checks processed." } }
* Closing connection 0

Re: NRDP checks not reporting to main Nagios XI install

Posted: Mon Feb 10, 2020 8:15 am
by scottwilkerson
That looks correct, may we mark this resolved?

Re: NRDP checks not reporting to main Nagios XI install

Posted: Mon Feb 10, 2020 3:35 pm
by benh
Hi Scott,

As there is still no objects coming through in unconfigured I don't think we can.

All I know is that the sender is correctly comm'ing tot he receiver, but nothing is showing up still.

Re: NRDP checks not reporting to main Nagios XI install

Posted: Mon Feb 10, 2020 4:19 pm
by scottwilkerson
benh wrote:Hi Scott,

As there is still no objects coming through in unconfigured I don't think we can.

All I know is that the sender is correctly comm'ing tot he receiver, but nothing is showing up still.
Do you have a host configured called "somehost"?

Re: NRDP checks not reporting to main Nagios XI install

Posted: Mon Feb 10, 2020 4:23 pm
by benh
I see a "somehost" in the unconfigured objects on the receiving server

However the sending NAgiosXI instance has 120 differnet hosts configured, none with that name.

Re: NRDP checks not reporting to main Nagios XI install

Posted: Mon Feb 10, 2020 5:23 pm
by Box293
So are these 120 objects actually working and updating? For instance if the checks were not being scheduled they would not be returning data and hence NRDP would not be sending anything to the other server.

Re: NRDP checks not reporting to main Nagios XI install

Posted: Mon Feb 10, 2020 5:31 pm
by benh
Yes the sending server is online and actively checking.

I've attached a screenshot showing that checks were performed only a few minutes ago.

Re: NRDP checks not reporting to main Nagios XI install

Posted: Mon Feb 10, 2020 7:35 pm
by Box293
On the sending server tail the log file with this command:

Code: Select all

tail /usr/local/nagiosxi/var/cmdsubsys.log -f
Do you get any information about outbound checks?

Re: NRDP checks not reporting to main Nagios XI install

Posted: Mon Feb 10, 2020 10:48 pm
by benh
I'm not seeing anything about outboundchecks.

On a hunch I forced a host check as below.

[root@localhost ~]# tail /usr/local/nagiosxi/var/cmdsubsys.log -f
PROCESSED 0 COMMANDS
...........................................................
PROCESSED 0 COMMANDS
.............................................................
PROCESSED 0 COMMANDS
............................................................
PROCESSED 0 COMMANDS
..........................................................
PROCESSED 0 COMMANDS
...........................................................
PROCESSED 0 COMMANDS
...............................PROCESSING COMMAND ID 44...
Setting new htaccess credentials
Updating password for user bh_admin
OUTPUT=
RETURNCODE=0
.........................PROCESSING COMMAND ID 45...
PROCESS COMMAND: CMD=16, DATA={"host_name":"C1-LLW-ESX01","cmd":98,"start_time":1581392755}
COMMAND DATA: {"host_name":"C1-LLW-ESX01","cmd":98,"start_time":1581392755}
CMDARR:
Array
(
[host_name] => C1-LLW-ESX01
[cmd] => 98
[start_time] => 1581392755
)
CORE CMD: SCHEDULE_FORCED_HOST_CHECK;C1-LLW-ESX01;1581392755
SUBMITTING A NAGIOSCORE COMMAND...
....
PROCESSED 2 COMMANDS