Page 5 of 6

Re: Passive Alerts With NSCA not working

Posted: Wed Jan 10, 2018 2:16 pm
by tgriep
Can you run the following and post it here so we can view the installed packages on your server?

Code: Select all

yum list --installed

Re: Passive Alerts With NSCA not working

Posted: Thu Jan 11, 2018 9:07 am
by cybergene
See attached @tgriep

Re: Passive Alerts With NSCA not working

Posted: Thu Jan 11, 2018 9:13 am
by tgriep
Another user reported having the same error that you are having and found that it was a missing package on the Nagios Core server and not the remote system.
Try installing this package on the Nagios Core server and let us know if it fixes the issue.

Code: Select all

php-simplexml

Re: Passive Alerts With NSCA not working

Posted: Thu Jan 11, 2018 12:06 pm
by cybergene
Installed the following

Code: Select all

sudo apt-get install php7.0-xml
as this is the latest versions ,on the remote and the Nagios core and restarted ncpa_passive

and the error persists and no checks are going to Nagios Core:

Code: Select all

2018-01-11 12:02:52,435 20542 INFO stopped
2018-01-11 12:02:53,115 28578 INFO started
2018-01-11 12:02:53,120 28578 INFO Running check: system/agent_version
2018-01-11 12:02:53,132 28578 INFO Did not receive normal values. Unable to find meaningful check.
2018-01-11 12:02:53,157 28578 INFO Running check: disk/logical/|/used_percent --warning 80 --critical 90 --units Gi
2018-01-11 12:02:53,176 28578 INFO Running check: cpu/percent --warning 60 --critical 80 --aggregate avg
2018-01-11 12:02:53,699 28578 INFO Running check: memory/swap --warning 60 --critical 80 --units Gi
2018-01-11 12:02:53,723 28578 INFO Running check: memory/virtual --warning 80 --critical 90 --units Gi
2018-01-11 12:02:53,753 28578 INFO Running check: processes --warning 300 --critical 400
2018-01-11 12:02:53,981 28578 ERROR no element found: line 1, column 0
Traceback (most recent call last):
  File "/root/ncpa/agent/passive/nrdp.py", line 198, in submit_to_nagios
  File "/root/ncpa/agent/passive/nrdp.py", line 145, in log_result
  File "/usr/local/lib/python2.7/xml/dom/minidom.py", line 1928, in parseString
  File "/usr/local/lib/python2.7/xml/dom/expatbuilder.py", line 940, in parseString
  File "/usr/local/lib/python2.7/xml/dom/expatbuilder.py", line 223, in parseString
ExpatError: no element found: line 1, column 0

Re: Passive Alerts With NSCA not working

Posted: Thu Jan 11, 2018 1:21 pm
by tgriep
We are thinking that the issue is with NRDP that is running on the Core system.
I am going to see about recreating the issue.

Re: Passive Alerts With NSCA not working

Posted: Fri Jan 12, 2018 8:55 am
by cybergene
Hi @tgriep,

Thanks for all the help.

I came in this morning and the commands seems to work somehow...

Nagios Core logs are showing the passive checks:

Code: Select all

[1515762271] PASSIVE SERVICE CHECK: hanjin;Disk Usage;2;CRITICAL: Used_percent was 90.60 %
[1515762271] PASSIVE SERVICE CHECK: hanjin;Process Count;0;OK: Process count was 222
[1515762271] PASSIVE SERVICE CHECK: hanjin;CPU Usage;0;OK: Percent was 0.00 %
[1515762571] PASSIVE SERVICE CHECK: hanjin;Disk Usage;0;OK: Used_percent was 78.80 %
[1515762571] SERVICE ALERT: hanjin;Disk Usage;OK;HARD;1;OK: Used_percent was 78.80 %
[1515762571] SERVICE NOTIFICATION: ibrahim;hanjin;Disk Usage;OK;notify-service-by-email;OK: Used_percent was 78.80 %
[1515762571] PASSIVE SERVICE CHECK: hanjin;Memory Usage;0;OK: Used memory was 2.90 % (Available: 30.52 GiB, Total: 31.41 GiB, Free: 12.26 GiB, Used: 0.43 GiB)
[1515762571] PASSIVE SERVICE CHECK: hanjin;CPU Usage;0;OK: Percent was 0.00 %
[1515762571] Error: Got check result for service 'Swap Usage' on host 'hanjin'. Unable to find service
[1515762571] PASSIVE HOST CHECK: hanjin;0;OK: Agent_version was ['2.1.1']
[1515762571] PASSIVE SERVICE CHECK: hanjin;Process Count;0;OK: Process count was 225
[1515762871] PASSIVE SERVICE CHECK: hanjin;CPU Usage;0;OK: Percent was 0.00 %
[1515762871] PASSIVE SERVICE CHECK: hanjin;Disk Usage;0;OK: Used_percent was 77.70 %
[1515762871] PASSIVE HOST CHECK: hanjin;0;OK: Agent_version was ['2.1.1']
[1515762871] PASSIVE SERVICE CHECK: hanjin;Process Count;0;OK: Process count was 228
[1515762871] PASSIVE SERVICE CHECK: hanjin;Memory Usage;0;OK: Used memory was 2.80 % (Available: 30.53 GiB, Total: 31.41 GiB, Free: 14.14 GiB, Used: 0.43 GiB)
[1515762871] Error: Got check result for service 'Swap Usage' on host 'hanjin'. Unable to find service
[1515763171] Error: Got check result for service 'Swap Usage' on host 'hanjin'. Unable to find service
[1515763171] PASSIVE SERVICE CHECK: hanjin;Memory Usage;0;OK: Used memory was 2.90 % (Available: 30.51 GiB, Total: 31.41 GiB, Free: 14.12 GiB, Used: 0.45 GiB)
[1515763172] PASSIVE SERVICE CHECK: hanjin;Process Count;0;OK: Process count was 231
[1515763172] PASSIVE SERVICE CHECK: hanjin;Disk Usage;0;OK: Used_percent was 77.70 %
[1515763172] PASSIVE HOST CHECK: hanjin;0;OK: Agent_version was ['2.1.1']
[1515763172] PASSIVE SERVICE CHECK: hanjin;CPU Usage;0;OK: Percent was 0.00 %
[1515763472] PASSIVE SERVICE CHECK: hanjin;Disk Usage;0;OK: Used_percent was 78.80 %
[1515763472] PASSIVE SERVICE CHECK: hanjin;Memory Usage;0;OK: Used memory was 2.90 % (Available: 30.51 GiB, Total: 31.41 GiB, Free: 12.26 GiB, Used: 0.43 GiB)
[1515763472] PASSIVE SERVICE CHECK: hanjin;CPU Usage;0;OK: Percent was 0.00 %
[1515763472] PASSIVE HOST CHECK: hanjin;0;OK: Agent_version was ['2.1.1']
[1515763472] PASSIVE SERVICE CHECK: hanjin;Process Count;0;OK: Process count was 226
[1515763472] Error: Got check result for service 'Swap Usage' on host 'hanjin'. Unable to find service
[1515763772] PASSIVE SERVICE CHECK: hanjin;CPU Usage;0;OK: Percent was 26.45 %
[1515763772] PASSIVE SERVICE CHECK: hanjin;Process Count;0;OK: Process count was 229
[1515763772] PASSIVE SERVICE CHECK: hanjin;Memory Usage;0;OK: Used memory was 2.90 % (Available: 30.51 GiB, Total: 31.41 GiB, Free: 5.95 GiB, Used: 0.44 GiB)
[1515763772] Error: Got check result for service 'Swap Usage' on host 'hanjin'. Unable to find service
[1515763772] PASSIVE SERVICE CHECK: hanjin;Disk Usage;1;WARNING: Used_percent was 80.80 %
[1515763772] SERVICE ALERT: hanjin;Disk Usage;WARNING;HARD;1;WARNING: Used_percent was 80.80 %
[1515763772] SERVICE NOTIFICATION: ibrahim;hanjin;Disk Usage;WARNING;notify-service-by-email;WARNING: Used_percent was 80.80 %
[1515763772] PASSIVE HOST CHECK: hanjin;0;OK: Agent_version was ['2.1.1']
[1515764072] PASSIVE SERVICE CHECK: hanjin;Disk Usage;1;WARNING: Used_percent was 84.40 %
[1515764072] PASSIVE HOST CHECK: hanjin;0;OK: Agent_version was ['2.1.1']
[1515764072] Error: Got check result for service 'Swap Usage' on host 'hanjin'. Unable to find service
[1515764072] PASSIVE SERVICE CHECK: hanjin;Memory Usage;0;OK: Used memory was 2.90 % (Available: 30.51 GiB, Total: 31.41 GiB, Free: 0.26 GiB, Used: 0.44 GiB)
[1515764072] PASSIVE SERVICE CHECK: hanjin;CPU Usage;0;OK: Percent was 25.50 %
[1515764072] PASSIVE SERVICE CHECK: hanjin;Process Count;0;OK: Process count was 229
NCPA logs on the remote host:

Code: Select all

2018-01-12 08:29:30,597 28578 INFO Meta output from NRDP server: 6 checks processed.
2018-01-12 08:34:30,143 28578 INFO Running check: system/agent_version
2018-01-12 08:34:30,148 28578 INFO Did not receive normal values. Unable to find meaningful check.
2018-01-12 08:34:30,184 28578 INFO Running check: disk/logical/|/used_percent --warning 80 --critical 90 --units Gi
2018-01-12 08:34:30,301 28578 INFO Running check: cpu/percent --warning 60 --critical 80 --aggregate avg
2018-01-12 08:34:30,860 28578 INFO Running check: memory/swap --warning 60 --critical 80 --units Gi
2018-01-12 08:34:31,011 28578 INFO Running check: memory/virtual --warning 80 --critical 90 --units Gi
2018-01-12 08:34:31,188 28578 INFO Running check: processes --warning 300 --critical 400
2018-01-12 08:34:31,622 28578 INFO Message from NRDP server: OK
2018-01-12 08:34:31,622 28578 INFO Meta output from NRDP server: 6 checks processed.
2018-01-12 08:39:30,146 28578 INFO Running check: system/agent_version
2018-01-12 08:39:30,151 28578 INFO Did not receive normal values. Unable to find meaningful check.
2018-01-12 08:39:30,225 28578 INFO Running check: disk/logical/|/used_percent --warning 80 --critical 90 --units Gi
2018-01-12 08:39:30,328 28578 INFO Running check: cpu/percent --warning 60 --critical 80 --aggregate avg
2018-01-12 08:39:30,939 28578 INFO Running check: memory/swap --warning 60 --critical 80 --units Gi
2018-01-12 08:39:31,047 28578 INFO Running check: memory/virtual --warning 80 --critical 90 --units Gi
2018-01-12 08:39:31,168 28578 INFO Running check: processes --warning 300 --critical 400
2018-01-12 08:39:31,509 28578 INFO Message from NRDP server: OK
2018-01-12 08:39:31,509 28578 INFO Meta output from NRDP server: 6 checks processed.
2018-01-12 08:44:31,039 28578 INFO Running check: system/agent_version
2018-01-12 08:44:31,044 28578 INFO Did not receive normal values. Unable to find meaningful check.
2018-01-12 08:44:31,058 28578 INFO Running check: disk/logical/|/used_percent --warning 80 --critical 90 --units Gi
2018-01-12 08:44:31,080 28578 INFO Running check: cpu/percent --warning 60 --critical 80 --aggregate avg
2018-01-12 08:44:31,602 28578 INFO Running check: memory/swap --warning 60 --critical 80 --units Gi
2018-01-12 08:44:31,627 28578 INFO Running check: memory/virtual --warning 80 --critical 90 --units Gi
2018-01-12 08:44:31,652 28578 INFO Running check: processes --warning 300 --critical 400
2018-01-12 08:44:31,895 28578 INFO Message from NRDP server: OK
2018-01-12 08:44:31,896 28578 INFO Meta output from NRDP server: 6 checks processed.
2018-01-12 08:49:31,435 28578 INFO Running check: system/agent_version
2018-01-12 08:49:31,440 28578 INFO Did not receive normal values. Unable to find meaningful check.
2018-01-12 08:49:31,455 28578 INFO Running check: disk/logical/|/used_percent --warning 80 --critical 90 --units Gi
2018-01-12 08:49:31,479 28578 INFO Running check: cpu/percent --warning 60 --critical 80 --aggregate avg
2018-01-12 08:49:32,006 28578 INFO Running check: memory/swap --warning 60 --critical 80 --units Gi
2018-01-12 08:49:32,034 28578 INFO Running check: memory/virtual --warning 80 --critical 90 --units Gi
2018-01-12 08:49:32,063 28578 INFO Running check: processes --warning 300 --critical 400
2018-01-12 08:49:32,320 28578 INFO Message from NRDP server: OK
2018-01-12 08:49:32,320 28578 INFO Meta output from NRDP server: 6 checks processed.

Re: Passive Alerts With NSCA not working

Posted: Fri Jan 12, 2018 4:14 pm
by tgriep
That is strange. Did something get reset on the server like a firewall or the Apache server?

Re: Passive Alerts With NSCA not working

Posted: Mon Jan 15, 2018 7:59 am
by cybergene
Nope. All I did was restarting ncpa_passive and nagios service.Would be the xml that fixed it?

It has been working over the weekend, the Disk Usage service has been updating properly. I'm not sure what exactly fix the problem. But since the last re-install we did together and installing the xml, it seems to work.

Re: Passive Alerts With NSCA not working

Posted: Mon Jan 15, 2018 11:48 am
by tgriep
That was probably it. Installing the XML package on the Nagios server and restarting the processes, fixed the issue so the server can receive and process the XML data.
Glad it is working now.

Re: Passive Alerts With NSCA not working

Posted: Mon Jan 15, 2018 2:09 pm
by cybergene
Before we close this, I'm wondering how to use custom plugins with NCPA.

If I have a script that check if a service is running (e.g. nginx), where should I place the scripts?
Here : /usr/local/ncpa/etc/ncpa.cfg.d/
Or /usr/local/ncpa/plugins ?

And when I st up the commands; is it the same as NRPE? (pointing to the script location with arguments and soon)

Is there any documentation that I check for this?