External check windows

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: External check windows

Post by rkennedy »

If it's not working, then allow arguments = 1 is in the wrong place. The document outlines specifically where it needs to be under which pertains directly to NRPE.

I would make sure it's there, and then restart the NSClient++ service. After doing so, attempt to run the check, and if it fails again please post your nsclient configuration file.
Former Nagios Employee
nagiosjam
Posts: 81
Joined: Thu Feb 04, 2016 2:47 am

Re: External check windows

Post by nagiosjam »

hello, finally works, thank you very much
at the end the problem is what we were saying, the nsclient.ini file must be very well ordered

so it did not work

Code: Select all

[/ Settings / NRPE / server]
NRPEServer = 1
allow arguments = 1
nasty_meta allow chars = 1
use SSL = 1
and so all ok

Code: Select all

NRPEServer = 1
[/ Settings / NRPE / server]
allow arguments = 1
nasty_meta allow chars = 1
use SSL = 1
thank you very much for the help, you can close the thread
Last edited by tmcdonald on Thu Oct 06, 2016 10:52 am, edited 1 time in total.
Reason: Please use [code][/code] tags around long output
nagiosjam
Posts: 81
Joined: Thu Feb 04, 2016 2:47 am

Re: External check windows

Post by nagiosjam »

Fixed external plugin check_tcp

But now I work the basic plugins check_nt
I get the following error
nSorolla address and connect to port 12489: Connection refused


For example: Server Uptime

CRITICAL 09-30-2016 9:13:26 0d 0h 8m 43s 3/3 nSorolla address and connect to port 12489: Connection refused

This is my configuration file nsclient.ini

Code: Select all

# If you want to fill this file avalible With all options run the following command:
# Nscp settings --add-defaults --generate --load-all
# If you want to activate a module and bring all its options in use:
# Nscp settings --activate-module <module name> --add-defaults
# For details run: nscp settings --help


; undocumented section
[/ Modules]

; undocumented key
CheckDisk = 1

; undocumented key
CheckEventLog = 1

; undocumented key
CheckExternalScripts = 1

; undocumented key
CheckHelpers = 1

; undocumented key
CheckNSCP = 1

; undocumented key
CheckSystem = 1

; undocumented key
CheckWMI = 1

; undocumented key
NRPEServer = 1

[/ Settings / NRPE / server]
allow arguments = 1

; undocumented key
NSClientServer = 1

; undocumented section
[/ Settings / default]

; undocumented key
allowed hosts = 172.19.96.35

; undocumented key
password = 62pass @ T

[/ Settings / external scripts]
allow arguments = true
allow = true nasty characters
timeout = 90

[/ Settings / external scripts / wrappings]
bat SCRIPT = scripts \\%%% ARGS%
ps1 = cmd / c I miss scripts SCRIPT \\%%% ARGS%; exit ($ lastexitcode) | powershell.exe -command -
vbs = cscript.exe // T: 90 // \\ lib \\ NoLogo scripts SCRIPT wrapper.vbs%%% ARGS%
exe = cmd / c% SCRIPT%% ARGS%


[/ Settings / external scripts / wrapped scripts]

test_bat = check_ok.bat
test_ps = check_test.ps1
test_vbs = check_test.vbs
test_ping = check_ping.bat
Test_files = check_files.vbs
test_battery = check_battery.vbs
test_printers = check_printer.vbs
checkProcState alias_process = "$ ARG1 $ = started"
check_test = check_test.ps1



[/ Settings / external scripts / scripts]

check_tcp = scripts \ check_tcp.exe -H $ ARG1 $ -p $ ARG2 $ -w $ ARG3 $ -c $ ARG4 $
Last edited by tmcdonald on Thu Oct 06, 2016 10:53 am, edited 1 time in total.
Reason: Please use [code][/code] tags around long output
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: External check windows

Post by mcapra »

I would suggest including the following settings above your [settings / NRPE / server section]:

Code: Select all

; Section for NSClient (NSClientServer.dll) (check_nt) protocol options.
[/settings/NSClient/server]

; ENABLE SSL ENCRYPTION - This option controls if SSL should be enabled.
use ssl = 0

; PERFORMANCE DATA - Send performance data back to Nagios (set this to 0 to remove all performance data).
performance data = 1

; PORT NUMBER - Port to use for check_nt.
port = 12489
I would also verify that Windows Firewall (or other firewalls) are not blocking traffic on port 12489
Former Nagios employee
https://www.mcapra.com/
nagiosjam
Posts: 81
Joined: Thu Feb 04, 2016 2:47 am

Re: External check windows

Post by nagiosjam »

Hello
The port 12489 is open.
If I have this configuration, the standard plugins check_nt work and check_tcp external plugin does not work, it gives this error when I run

Code: Select all

[Root @ server1 ~] # / usr / local / nagios / libexec / -H check_nrpe check_tcp -a -c server1 server1 80100200
Exception processing request: Request Contained arguments (not currently are allowed, check the arguments allow option).
My file nsclient

Code: Select all

; undocumented section
[/ Modules]

; undocumented key
CheckDisk = 1

; undocumented key
CheckEventLog = 1

; undocumented key
CheckExternalScripts = 1

; undocumented key
CheckHelpers = 1

; undocumented key
CheckNSCP = 1

; undocumented key
CheckSystem = 1

; undocumented key
CheckWMI = 1

; undocumented key
NRPEServer = 1

; undocumented key
NSClientServer = 1


; undocumented section
[/ Settings / default]

; undocumented key
allowed hosts = 172.19.96.35

; undocumented key
password = 62pass @ T

[/ Settings / external scripts]
allow arguments = true
allow = true nasty characters
timeout = 90

[/ Settings / external scripts / wrappings]
bat SCRIPT = scripts \\%%% ARGS%
ps1 = cmd / c I miss scripts SCRIPT \\%%% ARGS%; exit ($ lastexitcode) | powershell.exe -command -
vbs = cscript.exe // T: 90 // \\ lib \\ NoLogo scripts SCRIPT wrapper.vbs%%% ARGS%
exe = cmd / c% SCRIPT%% ARGS%


[/ Settings / external scripts / wrapped scripts]

test_bat = check_ok.bat
test_ps = check_test.ps1
test_vbs = check_test.vbs
test_ping = check_ping.bat
Test_files = check_files.vbs
test_battery = check_battery.vbs
test_printers = check_printer.vbs
checkProcState alias_process = "$ ARG1 $ = started"
check_test = check_test.ps1
check_ex2013 = ex2013.ps1


[/ Settings / external scripts / scripts]

check_ex2013dag = cmd / c I miss scriptsCheckEX2013DAG.ps1; exit ($ lastexitcode) | powershell.exe -command -

check_tcp = scripts \ check_tcp.exe -H $ ARG1 $ -p $ ARG2 $ -w $ ARG3 $ -c $ ARG4 $
If I make changes in the nsclient tell me file, I check_tcp external plugin works but let me run the standard plugins check_nt

Run the external plugin

Code: Select all

 / Usr / local / nagios / libexec / H check_nrpe check_tcp -a-c server1 server1 80100200
TCP OK - 0.000 second response time on port 80 | 'time' = 0.00039s
but the basic plugins do not work

Code: Select all

NSClient ++ Version
 10/06/2016 10:03:56 CRITICAL 0d 0h 0m 6s 1/3 connect to server1 address and port 12489: Connection refused
The port 12489 if it is open

and this is the configuration in this case

Code: Select all

; undocumented section
[/ Modules]

; undocumented key
CheckDisk = 1

; undocumented key
CheckEventLog = 1

; undocumented key
CheckExternalScripts = 1

; undocumented key
CheckHelpers = 1

; undocumented key
CheckNSCP = 1

; undocumented key
CheckSystem = 1

; undocumented key
CheckWMI = 1

; undocumented key

NRPEServer = 1

[/ Settings / NRPE / server]
allow arguments = 1

; Section for NSClient (NSClientServer.dll) (check_nt) protocol options.
[/ Settings / NSClient / server]

; undocumented key
NSClientServer = 1


; undocumented section
[/ Settings / default]

; undocumented key
allowed hosts = 172.19.96.35

; undocumented key
password = 62pass @ T

[/ Settings / external scripts]
allow arguments = true
allow = true nasty characters
timeout = 90

[/ Settings / external scripts / wrappings]
bat SCRIPT = scripts \\%%% ARGS%
ps1 = cmd / c I miss scripts SCRIPT \\%%% ARGS%; exit ($ lastexitcode) | powershell.exe -command -
vbs = cscript.exe // T: 90 // \\ lib \\ NoLogo scripts SCRIPT wrapper.vbs%%% ARGS%
exe = cmd / c% SCRIPT%% ARGS%


[/ Settings / external scripts / wrapped scripts]

test_bat = check_ok.bat
test_ps = check_test.ps1
test_vbs = check_test.vbs
test_ping = check_ping.bat
Test_files = check_files.vbs
test_battery = check_battery.vbs
test_printers = check_printer.vbs
checkProcState alias_process = "$ ARG1 $ = started"
check_test = check_test.ps1



[/ Settings / external scripts / scripts]

check_tcp = scripts \ check_tcp.exe -H $ ARG1 $ -p $ ARG2 $ -w $ ARG3 $ -c $ ARG4 $


I've added

; Section for NSClient (NSClientServer.dll) (check_nt) protocol options.
[/ Settings / NSClient / server]

; ENABLE SSL encryption - SSL This option controls if Should be enabled.
use ssl = 0

; PERFORMANCE DATA - Send performance data back to Nagios (set to 0 to remove esta all performance data).
performance data = 1

; PORT NUMBER - Port to use for check_nt.
port = 12489
But I still fail the standard plugins, external plug-in this case works for me.

Sorry for the inconvenience and thank you very much for the help, see if you can continue helping me thanks
Last edited by tmcdonald on Thu Oct 06, 2016 10:53 am, edited 1 time in total.
Reason: Please use [code][/code] tags around long output
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: External check windows

Post by rkennedy »

In your second configuration file, move this part -

Code: Select all

; undocumented key
NSClientServer = 1
To be under this part -

Code: Select all

; undocumented section
[/ Modules]
NSClientServer = 1 is what controls if check_nt is on or not. Once you make this change, and restart the service, both check_nrpe with exernal arguments and check_nt should work. If not, please post your current configuration file once again.
Former Nagios Employee
nagiosjam
Posts: 81
Joined: Thu Feb 04, 2016 2:47 am

Re: External check windows

Post by nagiosjam »

Yes now
NSClient Server = 1
under [/ Modules]
It works !!!
Thank you very much, and you can close the thread
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: External check windows

Post by dwhitfield »

Glad to hear it is resolved. I am going to lock the thread. Please feel free to post again if you have you another issue. Thank you for using the Nagios forums!
Locked