Modify nsclient.ini file, to declare the external scripts. It is imperative to store it in the "scripts" directory of the NSClient++ installation folder.
Here is the line of code to include:
[/settings/external scripts/scripts]
check_wsus_health = cmd /c echo scripts\check_wsus_health.ps1; exit($lastexitcode) | powershell.exe -command -
Please be sure that CheckExternalScripts=enabled
Command Template
define command{
command_name check_wsus_health
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -t 60 -c check_wsus_health
}
Service Check
define service{
use generic-service
host_name wsusserver
service_description WSUS Healthcheck
check_command check_wsus_health
}