Page 3 of 3
Re: Windows hosts passive checks with Nagios NRDP
Posted: Sun Jul 03, 2016 11:33 pm
by Box293
sidserra wrote:That's my windows.cfg in use in my Nagios:
Please upload that file here into the forums so we can review it's contents.
What
@nozlaf has said is the cause of your issue.
Re: Windows hosts passive checks with Nagios NRDP
Posted: Mon Jul 04, 2016 9:41 am
by sidserra
I searched in all Nagios Server config files (.cfg) by "passive-checks" or "passive_checks" and I didn't find any reference about it.
I changed my windows.cfg in this weekend:
When I restart Nagios service (service nagios restart), all works fine (the Nagios, not the passive services) with this windows.cfg, but in the syslog server stills showing "Unable to find service" to cpu and memory usage services, I mean, the Nagios Nrdp server is receiving the passive checks coming from Windows host but it isn't processing it. I don't want to monitor any services posted here, I just want that Windows hosts are listed as alive (UP) and nothing else...
Re: Windows hosts passive checks with Nagios NRDP
Posted: Mon Jul 04, 2016 8:40 pm
by Box293
sidserra wrote:but in the syslog server stills showing "Unable to find service" to cpu and memory usage services,
You will need to update your NRDP configuration on the client so it doesn't do the cpu and memory checks, this is why you are seeing these errors in the logs as there is no service in Nagios to match the incoming passive check result.
Re: Windows hosts passive checks with Nagios NRDP
Posted: Tue Jul 05, 2016 9:14 am
by sidserra
Hmm, I understand what you mean, I will comment the lines in the NCPA client (below my ncpa.cfg) as below:
[listener]
uid = nagios
certificate = adhoc
loglevel = info
ip = 0.0.0.0
gid = nagcmd
logfile = var/ncpa_listener.log
port = 5693
pidfile = var/ncpa_listener.pid
# Available versions: PROTOCOL SSLv2, SSLv3, TLSv1
ssl_version = TLSv1
[passive]
uid = nagios
handlers = nrds,nrdp
loglevel = info
gid = nagcmd
sleep = 600
logfile = var/ncpa_passive.log
pidfile = var/ncpa_passive.pid
[nrdp]
token = mytoken
hostname = SectTest
parent =
http://x.x.x.x/nrdp/
[nrds]
URL =
CONFIG_VERSION =0
TOKEN =
CONFIG_NAME =
CONFIG_OS = None
PLUGIN_DIR=plugins/
UPDATE_CONFIG=1
UPDATE_PLUGINS=1
[api]
community_string =mytoken
[plugin directives]
plugin_path = plugins/
.sh = /bin/sh $plugin_name $plugin_args
.ps1 = powershell -ExecutionPolicy Bypass -File $plugin_name $plugin_args
.vbs = cscript $plugin_name $plugin_args //NoLogo
.exe = cmd /c $plugin_name $plugin_args
[passive checks]
#%HOSTNAME%|CPU USAGE = /cpu/percent --warning 20 --critical 30
#%HOSTNAME%|SWAP USAGE = /memory/swap/percent --warning 40 --critical 80
#%HOSTNAME%|MEMORY USAGE = /memory/virtual/percent --warning 60 --critical 80
But one question: how the nrdp server will list the Windows hosts as alive without a passive check sent by NCPA? I mean, using the send_nrdp script (Linux hosts) to send passive checks, a xml file is created and sent to NRDP Nagios server and all Linux hosts are listed as alive. Well, changing the ncpa.cfg as above, the Windows host stills down... I think to give up to use NCPA, I'm losting a lot of time with a thing that I do in a blink of eyes with Linux...
Re: Windows hosts passive checks with Nagios NRDP
Posted: Tue Jul 05, 2016 9:26 am
by sidserra
To complete the problems, below the ncpa_passive.log (Windows host side):
ParseError: syntax error: line 1, column 0
2016-07-05 11:12:29,437:INFO:__init__:Establishing passive handler: Handler
2016-07-05 11:12:29,437:INFO:connectionpool:Starting new HTTP connection (1): xxx.xxx.xxx.xxx
2016-07-05 11:12:29,723:ERROR:__init__:syntax error: line 1, column 0
Traceback (most recent call last):
File "C:\ncpa\agent\ncpa_windows.py", line 192, in run_all_handlers
File "C:\Program Files (x86)\Nagios\NCPA\passive\nrdp.py", line 112, in run
self.submit_to_nagios(checkresults)
File "C:\Program Files (x86)\Nagios\NCPA\passive\nrdp.py", line 166, in submit_to_nagios
Handler.log_result(ret_xml)
File "C:\Program Files (x86)\Nagios\NCPA\passive\nrdp.py", line 132, in log_result
tree = xml.dom.minidom.parseString(ret_xml)
File "C:\Python27\lib\xml\dom\minidom.py", line 1928, in parseString
File "C:\Python27\lib\xml\dom\expatbuilder.py", line 940, in parseString
File "C:\Python27\lib\xml\dom\expatbuilder.py", line 223, in parseString
ExpatError: syntax error: line 1, column 0
2016-07-05 11:17:29,723:INFO:__init__:Establishing passive handler: Handler
2016-07-05 11:17:29,723:INFO:connectionpool:Starting new HTTP connection (1): xxx.xxx.xxx.xxx
2016-07-05 11:17:29,989:ERROR:__init__:syntax error: line 1, column 0
Traceback (most recent call last):
File "C:\ncpa\agent\ncpa_windows.py", line 192, in run_all_handlers
File "C:\Program Files (x86)\Nagios\NCPA\passive\nrds.py", line 37, in run
if self.config_update_is_required(nrds_url, nrds_token, nrds_config, nrds_config_version):
File "C:\Program Files (x86)\Nagios\NCPA\passive\nrds.py", line 137, in config_update_is_required
response_xml = ET.fromstring(url_request)
File "C:\Python27\lib\xml\etree\ElementTree.py", line 1300, in XML
File "C:\Python27\lib\xml\etree\ElementTree.py", line 1642, in feed
File "C:\Python27\lib\xml\etree\ElementTree.py", line 1506, in _raiseerror
ParseError: syntax error: line 1, column 0
2016-07-05 11:17:29,989:INFO:__init__:Establishing passive handler: Handler
2016-07-05 11:17:29,989:INFO:connectionpool:Starting new HTTP connection (1): xxx.xxx.xxx.xxx
2016-07-05 11:17:30,269:ERROR:__init__:syntax error: line 1, column 0
Traceback (most recent call last):
File "C:\ncpa\agent\ncpa_windows.py", line 192, in run_all_handlers
File "C:\Program Files (x86)\Nagios\NCPA\passive\nrdp.py", line 112, in run
self.submit_to_nagios(checkresults)
File "C:\Program Files (x86)\Nagios\NCPA\passive\nrdp.py", line 166, in submit_to_nagios
Handler.log_result(ret_xml)
File "C:\Program Files (x86)\Nagios\NCPA\passive\nrdp.py", line 132, in log_result
tree = xml.dom.minidom.parseString(ret_xml)
File "C:\Python27\lib\xml\dom\minidom.py", line 1928, in parseString
File "C:\Python27\lib\xml\dom\expatbuilder.py", line 940, in parseString
File "C:\Python27\lib\xml\dom\expatbuilder.py", line 223, in parseString
ExpatError: syntax error: line 1, column 0
Oh God, hehehe...
Re: Windows hosts passive checks with Nagios NRDP
Posted: Tue Jul 05, 2016 11:51 am
by tgriep
Is there a non-printable character in the ncpa.cfg file?
Re: Windows hosts passive checks with Nagios NRDP
Posted: Tue Jul 05, 2016 1:36 pm
by sidserra
No, there isn't any non-printable character in ncpa.cfg file, what I posted here is the complete file with all characters.
Re: Windows hosts passive checks with Nagios NRDP
Posted: Tue Jul 05, 2016 1:46 pm
by tgriep
FYI, the agent does not send a host check, only service checks.
What you could do is enable one if the service checks, turn on freshness checking for that service and if it doesn't check in at the freshness time, then alert / send a notification.
Would that work for you?
Re: Windows hosts passive checks with Nagios NRDP
Posted: Tue Jul 05, 2016 2:52 pm
by sidserra
tgriep,
I know this, I was trying to compare two passive checks solutions, one to Linux and one to Windows. Linux works fine, but Windows... I just wanted to know how the NCPA processes the information before to send it to Nrdp server and how the Nrdp server processes it. The send_nrdp script is awsome and I changed it to work in Crontab (I posted the changes here too) then I thought that NCPA worked with same way, I mean, without any direct command or things like this.
Re: Windows hosts passive checks with Nagios NRDP
Posted: Tue Jul 05, 2016 4:11 pm
by tgriep
Another option is the NSCLient++, it can be setup for passive checks and may have what you are looking for.