Page 2 of 3

Re: Nagios Core - Passive checks no communication.

Posted: Tue May 22, 2018 12:31 pm
by eadmanday
Hey scottwilkerson,

I have added the below code to the bottom of templates.cfg file in /usr/local/nagios/etc/objects

Code: Select all

define service {
       name                                generic-service
       is_volatile                         0
       max_check_attempts                  3
       check_interval                      10
       retry_interval                      2
       active_checks_enabled               1
       passive_checks_enabled              1
       check_period                        24x7
       parallelize_check                   1
       obsess_over_service                 1
       check_freshness                     0
       event_handler_enabled               1
       flap_detection_enabled              1
       process_perf_data                   1
       retain_status_information           1
       retain_nonstatus_information        1
       notification_interval               60
       notification_period                 24x7
       notification_options                w,c,u,r,
       notifications_enabled               1
       contact_groups                      admins
       register                          0

}   
I re-ran my grep to check the log file and no errors, no errors are reported after a restart of the Nagios server and a restart of the NCPApassive agent.

I have left the machine for about 15 minutes and came back to check if anything has changed. Nothing changed other than clearing the errors out of the log file.
My main dashboard still shows my Webprint system greyed out and pending checks as seen in the attachment.

Re: Nagios Core - Passive checks no communication.

Posted: Tue May 22, 2018 4:22 pm
by scottwilkerson
Have you sent a result as the host? Usually there are just services. Are the services coming in?

Re: Nagios Core - Passive checks no communication.

Posted: Tue May 22, 2018 5:03 pm
by eadmanday
I am assuming you do that through the Nagios NRDP server URL? I have not done that yet today, or I might be confused on how to send that information.

Re: Nagios Core - Passive checks no communication.

Posted: Tue May 22, 2018 5:23 pm
by scottwilkerson
If you sent this at the NRDP URL in the submit data field it should set the host to OK

Code: Select all

<?xml version='1.0'?> 
<checkresults>
	<checkresult type='host'>
		<hostname>Webprint</hostname>
		<state>0</state>
		<output>Everything looks okay!</output>
	</checkresult>
</checkresults>

Re: Nagios Core - Passive checks no communication.

Posted: Tue May 22, 2018 6:03 pm
by eadmanday
Ahh yes, I have not done that test but will test it first thing tomorrow. My ACL's don't allow access while out of the office.

Re: Nagios Core - Passive checks no communication.

Posted: Wed May 23, 2018 7:20 am
by scottwilkerson
Let us know if you have problems.

Re: Nagios Core - Passive checks no communication.

Posted: Tue May 29, 2018 10:21 am
by eadmanday
Hey Scottwilkerson, sorry for the slow was sick and out of the office recovering.

I tested the XML code you gave me through the NRDP URL. Entered the token as well... No 'OK' was give and nothing gave any feedback of a successful command input.

I tested the same XML, but with the default values entered from the page load. Same issue after entering the correct token. So it seems like both the default and the XML code you provided are not providing the "OK" feedback and be successful.

Re: Nagios Core - Passive checks no communication.

Posted: Tue May 29, 2018 2:30 pm
by scottwilkerson
This leads me to believe that there is an error.

Can you watch the httpd error_log on the server when you submit the page again and report the errors.

My guess would be that there is a missing php function from addon, but seeing the error in the logs will help.

Re: Nagios Core - Passive checks no communication.

Posted: Wed May 30, 2018 1:12 pm
by eadmanday
Hey ScottWilkerson

I popped over to the ubuntu log location /var/log/apache2 and opened the error.log.

I found the following errors

Code: Select all

[Wed May 30 11:06:40.876445 2018] [:error] [pid 24479] [client 1.1.1.1:56836] PHP Fatal error:  Uncaught Error: Call to undefined function simplexml_load_string() in /usr/local/nrdp/server/plugins/nagio$
[Wed May 30 11:07:31.395677 2018] [:error] [pid 24476] [client 1.1.1.1:56837] PHP Fatal error:  Uncaught Error: Call to undefined function simplexml_load_string() in /usr/local/nrdp/server/plugins/nagio$
* 1.1.1.1 ip replaced the client machines IP address


This error is taking up the log file and is really all I see.

Re: Nagios Core - Passive checks no communication.

Posted: Wed May 30, 2018 2:10 pm
by scottwilkerson
all right now we are getting somewhere, run

Code: Select all

apt-get install php-simplexml
then restart apache