Help with Windows Update Check

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.
Locked
kwhogster
Posts: 644
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA
Contact:

Help with Windows Update Check

Post by kwhogster »

Nagios 4.1 Core
Windows 7 Pro
Powershell v5

I found this
https://exchange.nagios.org/directory/P ... es/details
Looks very good.

I installed Powershell version 5 on my Windows 7 Pro computer for testing this.

Followed the instructions carefully and I must have missed something.

I am getting this

TGKW012 WSUS Notifications for this service have been disabled UNKNOWN 02-11-2017 21:44:40 0d 0h 42m 8s 3/3 No handler for command: check_ms_win_updates

I ran this from my Nagios server

No handler for command: d
root@tgcs017:/usr/local/nagios/etc/objects# /usr/lib/nagios/plugins/check_nrpe -H TGKW012 -c check_ms_win_updates -a '-wd 15 -cd 30'
No handler for command: check_ms_win_updates
root@tgcs017:/usr/local/nagios/etc/objects# /usr/lib/nagios/plugins/check_nrpe -H TGKW012 -c check_ms_win_updates -a "-wd 15 -cd 30"
No handler for command: check_ms_win_updates
root@tgcs017:/usr/local/nagios/etc/objects# /usr/lib/nagios/plugins/check_nrpe -H TGKW012 -c check_ms_win_updates -a "-wd 15 -cd 30 -m PSWindowsUpdate"
No handler for command: check_ms_win_updates
root@tgcs017:/usr/local/nagios/etc/objects# /usr/lib/nagios/plugins/check_nrpe -H 10.2.8.70 -c check_ms_win_updates -a "-wd 15 -cd 30 -m PSWindowsUpdate"
No handler for command: check_ms_win_updates

Same results
My command def

Code: Select all

define command{
        command_name    check_ms_win_updates
        command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_ms_win_updates -a '-wd 15 -cd 30 -M PSWindowsUpdate'
}
My Service

Code: Select all

define service{
        use                     generic-service
        host_name               TGKW012
        service_description     WSUS
        check_command           check_nrpe!check_ms_win_updates
        servicegroups           Windows Updates
        }
My nsclient

Code: Select all

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

Why am I getting the No Handler Unknown error

Thanks

Tom
kwhogster
Posts: 644
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA
Contact:

Re: Help with Windows Update Check

Post by kwhogster »

I resolved this

Had this in wrong place moved the this section [External Scripts]

Code: Select all

; Windows Update Check
check_ms_win_updates = cmd /c echo scripts/powershell/check_ms_win_updates.ps1 $ARG1$; exit $LastExitCode | powershell.exe -command -

This can be Locked

Thanks
Locked