Passive Alerts With NSCA not working
Re: Passive Alerts With NSCA not working
I took a look at the ncpa_passive.log file and for some reason, it looks like the NCPA agent is running the checks every second and not every 300 seconds like it should.
Can you upload the ncpa.cfg file and all of the files in the ncpa.cfg.d folder from the remote host so we can view them?
Thanks.
Can you upload the ncpa.cfg file and all of the files in the ncpa.cfg.d folder from the remote host so we can view them?
Thanks.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Passive Alerts With NSCA not working
@tgriep see attached.
- Attachments
-
- ncpa.cfg.7z
- (2.77 KiB) Downloaded 178 times
Re: Passive Alerts With NSCA not working
Thanks for the config files. You have the passive commands in both the ncpa.cfg file and the nrdp.cfg file and that could be causing the checks to run every second as they are duplicated.
What I would do is to remove this section from the ncpa.cfg file
And I would edit the nrdp.cfg file and change this line from
to
(That is changing the check to monitor the root partition and not the C Drive as it doesn't exist.)
Save the files a restart both the ncpa_passive and ncpa_listener services.
Then in the ncpa_passive.log file, you should see the passive services trying to send data to the Nagios server every 5 minutes and not every second.
What I would do is to remove this section from the ncpa.cfg file
Code: Select all
[passive checks]
%HOSTNAME%|__HOST__ = system/agent_version
%HOSTNAME%|Disk Usage = disk/logical/C:|/used_percent --warning 80 --critical 90 --units Gi
%HOSTNAME%|CPU Usage = cpu/percent --warning 60 --critical 80 --aggregate avg
%HOSTNAME%|Swap Usage = memory/swap --warning 60 --critical 80 --units Gi
%HOSTNAME%|Memory Usage = memory/virtual --warning 80 --critical 90 --units Gi
%HOSTNAME%|Process Count = processes --warning 300 --critical 400
%HOSTNAME%|Disk Used = disk/logical/|/used_percent --warning 80 --critical 90
Code: Select all
%HOSTNAME%|Disk Usage = disk/logical/C:|/used_percent --warning 80 --critical 90 --units Gi
Code: Select all
%HOSTNAME%|Disk Usage = disk/logical/|/used_percent --warning 80 --critical 90 --units Gi
Save the files a restart both the ncpa_passive and ncpa_listener services.
Then in the ncpa_passive.log file, you should see the passive services trying to send data to the Nagios server every 5 minutes and not every second.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Passive Alerts With NSCA not working
Hi @tgriep
I reverted the ncpa.cfg since I didn't had them in the first place. And restarted the services. It is still trying to connect every second.
I reverted the ncpa.cfg since I didn't had them in the first place. And restarted the services. It is still trying to connect every second.
Re: Passive Alerts With NSCA not working
I took a look at the code and I think when debugging is turned on, it is logging every second.
Did, after cleaning up the duplicate checks, did the checks get sent to the Nagios server at the 5 minute interval?
Did, after cleaning up the duplicate checks, did the checks get sent to the Nagios server at the 5 minute interval?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Passive Alerts With NSCA not working
Turned debugging off and restarted the services.
The ncpa_passive.log is showing this error:
And no, no checks were sent to Nagios server at all.
The ncpa_passive.log is showing this error:
Code: Select all
2018-01-09 11:31:21,817 7722 INFO Running check: processes --warning 300 --critical 400
2018-01-09 11:31:21,959 7722 INFO Running check: disk/logical/|/used_percent --warning 80 --critical 90
2018-01-09 11:31:22,063 7722 ERROR no element found: line 1, column 0
Traceback (most recent call last):
File "ncpa_passive.py", line 45, in run_all_handlers
File "/root/ncpa/agent/passive/nrdp.py", line 124, in run
File "/root/ncpa/agent/passive/nrdp.py", line 179, 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
2018-01-09 11:32:59,572 7722 INFO stopped
2018-01-09 11:33:00,199 7837 INFO started
2018-01-09 11:33:00,207 7837 INFO Running check: system/agent_version
2018-01-09 11:33:00,218 7837 INFO Did not receive normal values. Unable to find meaningful check.
2018-01-09 11:33:00,244 7837 INFO Running check: disk/logical/|/used_percent --warning 80 --critical 90 --units Gi
2018-01-09 11:33:00,273 7837 INFO Running check: cpu/percent --warning 60 --critical 80 --aggregate avg
2018-01-09 11:33:01,301 7837 INFO Running check: memory/swap --warning 60 --critical 80 --units Gi
2018-01-09 11:33:01,344 7837 INFO Running check: memory/virtual --warning 80 --critical 90 --units Gi
2018-01-09 11:33:01,372 7837 INFO Running check: processes --warning 300 --critical 400
2018-01-09 11:33:01,520 7837 INFO Running check: disk/logical/|/used_percent --warning 80 --critical 90
2018-01-09 11:33:01,632 7837 ERROR no element found: line 1, column 0
Traceback (most recent call last):
File "ncpa_passive.py", line 45, in run_all_handlers
File "/root/ncpa/agent/passive/nrdp.py", line 124, in run
File "/root/ncpa/agent/passive/nrdp.py", line 179, 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
2018-01-09 11:35:55,683 7837 INFO stopped
2018-01-09 11:35:56,303 7923 INFO started
2018-01-09 11:35:56,313 7923 INFO Running check: system/agent_version
2018-01-09 11:35:56,324 7923 INFO Did not receive normal values. Unable to find meaningful check.
2018-01-09 11:35:56,359 7923 INFO Running check: disk/logical/|/used_percent --warning 80 --critical 90 --units Gi
2018-01-09 11:35:56,394 7923 INFO Running check: cpu/percent --warning 60 --critical 80 --aggregate avg
2018-01-09 11:35:57,419 7923 INFO Running check: memory/swap --warning 60 --critical 80 --units Gi
2018-01-09 11:35:57,453 7923 INFO Running check: memory/virtual --warning 80 --critical 90 --units Gi
2018-01-09 11:35:57,484 7923 INFO Running check: processes --warning 300 --critical 400
2018-01-09 11:35:57,626 7923 INFO Running check: disk/logical/|/used_percent --warning 80 --critical 90
2018-01-09 11:35:57,731 7923 ERROR no element found: line 1, column 0
Traceback (most recent call last):
File "ncpa_passive.py", line 45, in run_all_handlers
File "/root/ncpa/agent/passive/nrdp.py", line 124, in run
File "/root/ncpa/agent/passive/nrdp.py", line 179, 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
Which Linux OS and release number are you using on the system you have installed NCPA on?
Please run the following on that system and post the output.
Please run the following on that system and post the output.
Code: Select all
uname -a
cat /etc/*release*
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Passive Alerts With NSCA not working
Here you go:
uname -a
cat /etc/*release*
uname -a
Code: Select all
Linux hanjin 4.10.0-40-generic #44-Ubuntu SMP Thu Nov 9 14:49:09 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Code: Select all
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=17.04
DISTRIB_CODENAME=zesty
DISTRIB_DESCRIPTION="Ubuntu 17.04"
NAME="Ubuntu"
VERSION="17.04 (Zesty Zapus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 17.04"
VERSION_ID="17.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=zesty
UBUNTU_CODENAME=zesty
Re: Passive Alerts With NSCA not working
I just spun up a Ubuntu 17.04 system and installed the NCPA agent version 2.1.1 on it and it worked without any errors.
What I suggest is to remove the NCPA Agent and to reinstall it by following this procedure.
Login to the server as root and remove the existing agent and delete all of the files and folders in the /usr/local/ncpa folder
Next, change to the /tmp folder
Download the NCPA Agent by running
Install it by running
Then, go to the /usr/local/ncpa/etc/ncpa.cfg.d folder and edit the example.cfg file.
Uncomment out all of the settings for the passive check and for the Disk Usage check, remove the C: as the system does not have a C: Drive.
If should look like this
Save the file.
Then edit the /usr/local/ncpa/etc/ncpa.cfg file and update the following settings to the following
Under the [api] section change this option
Under the [passive] section change this option
Under the [nrdp] section change these option
Save the file and restart the ncpa_passive service and see if that works for you.
What I suggest is to remove the NCPA Agent and to reinstall it by following this procedure.
Login to the server as root and remove the existing agent and delete all of the files and folders in the /usr/local/ncpa folder
Next, change to the /tmp folder
Code: Select all
cd /tmp
Code: Select all
wget https://assets.nagios.com/downloads/ncpa/ncpa-2.1.1.amd64.deb
Code: Select all
dpkg -i ncpa-2.1.1.amd64.deb
Uncomment out all of the settings for the passive check and for the Disk Usage check, remove the C: as the system does not have a C: Drive.
If should look like this
Code: Select all
%HOSTNAME%|Disk Usage = disk/logical/|/used_percent --warning 80 --critical 90 --units Gi
Then edit the /usr/local/ncpa/etc/ncpa.cfg file and update the following settings to the following
Under the [api] section change this option
Code: Select all
community_string = Str0ngT0k3n
Code: Select all
handlers = nrdp
Code: Select all
parent = http://54.165.9.118/nrdp/
token = cda35gtdfu72
hostname = hanjin
Save the file and restart the ncpa_passive service and see if that works for you.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Passive Alerts With NSCA not working
Re-installed and made the changes. It is still not working.
Check the attached logs.
Check the attached logs.
- Attachments
-
- ncpa_passive.log
- (6.1 KiB) Downloaded 464 times