Page 1 of 1

check_fileage: no handler for command.

Posted: Mon Apr 20, 2015 7:14 am
by Unigarant
Hi, I am having some trouble getting a fileage check to work in NagiosXI.
After copying the .vbs to the remote host I get the correct output if I just click on it.

When I test the command (I just created) in Nagios I get: No handler for command: check_fileage.
I have added the command to the local NSClient.ini:

Code: Select all

[/settings/external scripts/wrapped scripts]

check_provisioning = vmview-dpstatus.ps1

check_fileage = cscript.exe //nologo //T:30 check_fileage.vbs $ARG1$ $ARG2$ $ARG3$

check_dhcp_scope = check_dhcp.vbs

check_db01 = mountpoint.ps1 -path A:\SomeDrive\

; A list of templates for wrapped scripts
[/settings/external scripts/wrappings]

; BATCH FILE WRAPPING - 
bat = scripts\\%SCRIPT% %ARGS%

; POWERSHELL WRAPPING - 
ps1 = cmd /c echo scripts\\%SCRIPT% %ARGS%; exit($lastexitcode) | powershell.exe -command -

; VISUAL BASIC WRAPPING - 
vbs = cscript.exe //T:30 //NoLogo scripts\\lib\\wrapper.vbs %SCRIPT% %ARGS%
Can anyone point me in the right direction for this?

Any other "file age check on a Windows host for dummies" is also fine, except the ones involving a WMI query.

Re: check_fileage: no handler for command.

Posted: Mon Apr 20, 2015 10:01 am
by lmiltchev
I believe you will need to move the command definition from the [/settings/external scripts/wrapped scripts] section to the [/settings/external scripts/scripts] section. Also, make sure the external scripts and nrpe modules are enabled, and that you allow arguments under the "external scripts" and "nrpe" sections (allow arguments = 1). Save, exit and restart NSClient++ service. If you keep getting the "no handler for command" error, please post the entire "nsclient.ini" file. Hide sensitive info.