https://support.nagios.com/forum/viewto ... 4&start=10
My NRDS config works fine until I add the powershell command to the config
This is my config.ini file before adding the powershell script
Code: Select all
[settings]
CONFIG_VERSION=1.4
CONFIG_OS=Windows (64-bit)
CONFIG_NAME=test
URL=https://ap-dco67-mon.bel.centric.lan/nrdp/
TOKEN=MyToken
PLUGIN_DIR=C:\Program Files\Nagios\NRDS_Win\plugins
SEND_NRDP=
TMPDIR=
COMMAND_PREFIX=
LOG_FILE=C:\Program Files\Nagios\NRDS_Win\logs\NRDS_Debug.log
IGNORE_SSL_CERTIFICATE_ERRORS=1
UPDATE_CONFIG=1
UPDATE_PLUGINS=1
[services]
command[__HOST__] = $PLUGIN_DIR$\check_winping.exe -H 10.75.1.21 --warning 200,40% --critical 400,80%
command[nrpe_process] = $PLUGIN_DIR$\cpuload_nrpe_nt.exe 70 90
command[Windows : SVC spooler] = $PLUGIN_DIR$\service_nrpe_nt.exe "Print Spooler"
command[Windows : Diskspace C 90-95] = $PLUGIN_DIR$\check_pdm.exe --disk --drive C: -w 90 -c 95
command[Windows : Diskspace D 90-95] = $PLUGIN_DIR$\check_pdm.exe --disk --drive D: -w 90 -c 95
command[Windows : Memory Usage] = $PLUGIN_DIR$\check_pdm.exe --memory -w 85 -c 90
command[Windows : Page file] = $PLUGIN_DIR$\check_pdm.exe --memory pagefile -w 80 -c 95
command[Windows : CPU Load] = $PLUGIN_DIR$\cpu_usage.ps1
[extensions]
vbs = cscript //nologo $CHECK_COMMAND$
ps1 = powershell -ExecutionPolicy Bypass -File $CHECK_COMMAND$
Code: Select all
command[Windows : CPU Load] = $PLUGIN_DIR$\cpu_usage.ps1The next time that the agent runs I get the following in the log file
Code: Select all
13/04/2016 17:44:00 ---Starting NRDS Transaction--- :
13/04/2016 17:44:00 Diagnostic mode : False
13/04/2016 17:44:00 base NRDP address locked and loaded : https://ap-dco67-mon.bel.centric.lan/nrdp//?token=MyToken&cmd=
13/04/2016 17:44:00 XML being passed to check for updates : https://ap-dco67-mon.bel.centric.lan/nrdp//?token=MyToken&cmd=updatenrds&XMLDATA=<?xml version='1.0' ?><configs><config><name>test</name><version>1.3</version></config></configs>
13/04/2016 17:44:00 running Post routine.. :
13/04/2016 17:44:00 ignoring certificate errors : 13056
13/04/2016 17:44:00 Post Data.... :
13/04/2016 17:44:00 address..... : https://ap-dco67-mon.bel.centric.lan/nrdp//?token=MyToken&cmd=updatenrds&XMLDATA=<?xml version='1.0' ?><configs><config><name>test</name><version>1.3</version></config></configs>
13/04/2016 17:44:00 NRDP response to update query : <?xml version="1.0" encoding="utf-8"?>
<result>
<status>1</status>
<message>Version 1.4 available</message>
<meta>
<output></output>
</meta>
<config>
CONFIG_VERSION=1.4
CONFIG_OS=Windows (64-bit)
CONFIG_NAME=test
URL=https://ap-dco67-mon.bel.centric.lan/nrdp/
TOKEN=MyToken
PLUGIN_DIR=C:\Program Files\Nagios\NRDS_Win\plugins
SEND_NRDP=
TMPDIR=
COMMAND_PREFIX=
LOG_FILE=C:\Program Files\Nagios\NRDS_Win\logs\NRDS_Debug.log
IGNORE_SSL_CERTIFICATE_ERRORS=1
UPDATE_CONFIG=1
UPDATE_PLUGINS=1
command[__HOST__] = $PLUGIN_DIR$\check_winping.exe -H 10.75.1.21 --warning 200,40% --critical 400,80%
command[nrpe_process] = $PLUGIN_DIR$\cpuload_nrpe_nt.exe 70 90
command[Windows : SVC spooler] = $PLUGIN_DIR$\service_nrpe_nt.exe "Print Spooler"
command[Windows : Diskspace C 90-95] = $PLUGIN_DIR$\check_pdm.exe --disk --drive C: -w 90 -c 95
command[Windows : Diskspace D 90-95] = $PLUGIN_DIR$\check_pdm.exe --disk --drive D: -w 90 -c 95
command[Windows : Memory Usage] = $PLUGIN_DIR$\check_pdm.exe --memory -w 85 -c 90
command[Windows : Page file] = $PLUGIN_DIR$\check_pdm.exe --memory pagefile -w 80 -c 95
[b]command[Windows : CPU Load] = $PLUGIN_DIR$\cpu_usage.ps1[/b]
</config>
</result>
13/04/2016 17:44:00 Config update availability : True
13/04/2016 17:44:00 downloading new config : https://ap-dco67-mon.bel.centric.lan/nrdp//?token=MyToken&cmd=getconfig&configname=test&os=Windows&os_ver=6.1.7601&arch=AMD64
13/04/2016 17:44:00 downloading new file : https://ap-dco67-mon.bel.centric.lan/nrdp//?token=MyToken&cmd=getconfig&configname=test&os=Windows&os_ver=6.1.7601&arch=AMD64
13/04/2016 17:44:00 running Post routine.. :
13/04/2016 17:44:00 ignoring certificate errors : 13056
13/04/2016 17:44:00 Post Data.... :
13/04/2016 17:44:00 address..... : https://ap-dco67-mon.bel.centric.lan/nrdp//?token=MyToken&cmd=getconfig&configname=test&os=Windows&os_ver=6.1.7601&arch=AMD64
13/04/2016 17:44:00 new plugins available : cpu_usage.ps1
13/04/2016 17:44:00 downloading plugin to : C:\PROGRA~1\Nagios\NRDS_Win\plugins\cpu_usage.ps1
13/04/2016 17:44:00 downloading new plugin : cpu_usage.ps1
13/04/2016 17:44:00 new plugin URL : https://ap-dco67-mon.bel.centric.lan/nrdp//?token=MyToken&cmd=getplugin&plugin=cpu_usage.ps1&os=Windows&os_ver=6.1.7601&arch=AMD64
13/04/2016 17:44:00 downloading new file : https://ap-dco67-mon.bel.centric.lan/nrdp//?token=MyToken&cmd=getplugin&plugin=cpu_usage.ps1&os=Windows&os_ver=6.1.7601&arch=AMD64
13/04/2016 17:44:00 running Post routine.. :
13/04/2016 17:44:00 ignoring certificate errors : 13056
13/04/2016 17:44:00 Post Data.... :
13/04/2016 17:44:00 address..... : https://ap-dco67-mon.bel.centric.lan/nrdp//?token=MyToken&cmd=getplugin&plugin=cpu_usage.ps1&os=Windows&os_ver=6.1.7601&arch=AMD64
Code: Select all
drwxrwx--- 2 nagios nagios 4096 Nov 28 2012 AMD64
-rwxrwx--- 1 nagios nagios 1306708 May 18 2011 check_pdm.exe
-rwxrwx--- 1 nagios nagios 1220692 Jul 23 2012 check_winping.exe
-rwxrwx--- 1 nagios nagios 1220692 Jul 23 2012 check_winprocess.exe
-rwxrwx--- 1 nagios nagios 61440 Jul 23 2012 cpuload_nrpe_nt.exe
-rwxrwx--- 1 nagios nagios 406 Apr 13 11:31 cpu_usage.ps1
-rwxrwx--- 1 nagios nagios 57344 Jul 23 2012 diskspace_nrpe_nt.exe
-rwxrwx--- 1 nagios nagios 57344 Jul 23 2012 eventlog_nrpe_nt.exe
-rwxrwx--- 1 nagios nagios 49152 Jul 23 2012 memload_nrpe_nt.exe
drwxrwx--- 2 nagios nagios 4096 Nov 28 2012 plugin_documents
-rwxrwx--- 1 nagios nagios 49152 Jul 23 2012 service_nrpe_nt.exe
drwxrwx--- 2 nagios nagios 4096 Nov 28 2012 x86
Can someone help me out pls ?