Im new on this forum and i hope ill put my topic in good place
Im using Nagios Core v3 with quite old agent (NSC.ini) and there external scripts are working fine.
In NSC.ini file i have (example):
[Script Wrappings]
vbs=cscript.exe //T:30 //NoLogo scripts\lib\wrapper.vbs %SCRIPT% %ARGS%
ps1=cmd /c echo scripts\%SCRIPT% %ARGS%; exit($lastexitcode) | powershell.exe -command -
bat=scripts\%SCRIPT% %ARGS%
[External Scripts]
alias_internet_conn_status_ps=cmd /c echo E:\App\Nagios\scripts\check_ic.ps1 $ARG1$; exit($lastexitcode) | powershell.exe -command -
alias_ad_conn_status_ps=cmd /c echo E:\App\Nagios\scripts\check_ad.ps1 $ARG1$; exit($lastexitcode) | powershell.exe -command -
In Nagios Core v4 im using new agent v0.5 and in nsclien.ini i set:
[/settings/NRPE/server]
allow arguments = true
allow nasty characters = true
insecure = true
verify mode = none
[/modules]
CheckExternalScripts = enabled
CheckHelpers = enabled
CheckEventLog = enabled
CheckNSCP = enabled
CheckDisk = enabled
CheckSystem = enabled
CheckTaskSched = enabled
NSClientServer = disabled
NRPEServer = enabled
[/settings/external scripts]
allow arguments = true
;allow nasty characters = true
timeout = 90
vbs=cscript.exe //T:30 //NoLogo scripts\lib\wrapper.vbs %SCRIPT% %ARGS%
ps1=cmd /c echo scripts\%SCRIPT% %ARGS%; exit($lastexitcode) | powershell.exe -command -
bat=scripts\%SCRIPT% %ARGS%
[/settings/external scripts/alias]
alias_components_status = cmd /c echo E:\App\Nagios\scripts\statut_comp.ps1; exit($lastexitcode) | powershell.exe -command -
internet_conn_status = cmd /c echo E:\App\NSClient++\scripts\check_ic.ps1 %ARG1%; exit($lastexitcode) | powershell.exe -command -
on server site:
define service {
host_name Hostname
service_description Components status
check_command check_nrpe!alias_components_status
use service-template
}
and im getting Unknown command(s): cmd
when i set alias_components_status = statut_comp.ps1
im getting:
Unknown command(s): statut_comp.ps1
I hope you will help me with this
ps before creating this topic i tried to find solution on my own (Using custom scripts with NSClient++) but even if i set it like this im still getting error
Thanks
Regards
zakg