zeldor.biz

Linux, programming and more

Copyright © 2025
Log in

Icinga/Nagios: Check Windows Updates

February 22, 2012 by Igor Drobot 3 Comments

Another really helpful check for your Icinga or Nagios instance.

If your have any windows machines you can check the Windows Update-State. How many Updates you need to install and if you need to reboot your servers after updating them.

Get the Update Script.

Copy the Script to “C:\Program Files\NSClient++\scripts\”

Uncomment the NRPEListener.dll and CheckExternalScripts.dll parameters in your NSC.ini config:

In the [NRPE] section
uncomment following options:

1
2
3
4
5
port=5666
command_timeout=60
allow_arguments=0
use_ssl=1
socket_timeout=30

port=5666 command_timeout=60 allow_arguments=0 use_ssl=1 socket_timeout=30

[External Scripts] section:

1
check_win_updates=cscript.exe //T:40 //NoLogo scripts\test-updates.wsf /w:1 /C:10

check_win_updates=cscript.exe //T:40 //NoLogo scripts\test-updates.wsf /w:1 /C:10

Restart NSClient Service:

Check the script from windows command line (CMD- the black window;)):

Icinga output (click to resize):

The result (after I installed some Updates:-)) (click to resize):

Icinga-side configurations:

Command definition:

1
2
3
4
define command {
    command_name    check_win_updates
    command_line    /usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -p 5666 -c check_win_updates
}

define command { command_name check_win_updates command_line /usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -p 5666 -c check_win_updates }

Service definition:

1
2
3
4
5
6
define service {
    hostgroup_name                  check-win-updates
    service_description             Windows Updates
    check_command                   check_win_updates
    use                             generic-service
}

define service { hostgroup_name check-win-updates service_description Windows Updates check_command check_win_updates use generic-service }

Hostgroups definition:

1
2
3
4
5
define hostgroup {
    hostgroup_name          check-win-updates
    alias                   Windows Updates
    members                 windows2008r2, windows7
}

define hostgroup { hostgroup_name check-win-updates alias Windows Updates members windows2008r2, windows7 }

Check icinga-config and restart the process:

1
icinga -v /etc/icinga/icinga.cfg && service icinga reload

icinga -v /etc/icinga/icinga.cfg && service icinga reload

Filed Under: Debian, Linux, Monitoring, Networking, Ubuntu, Windows Tagged With: Icinga, Nagios, Windows Updates

Categories

Archives

Tags

apache2 Apple arduino ARM Automation backup bash Cisco Cluster Corosync Database Debian Debian squeeze DIY DNS Fedora FTP Fun Icinga Ipv6 KVM Linux LVM MAC OS X Monitoring MySQL Nagios Nginx openSUSE OpenVPN PHP Proxy Python python3 qemu RAID rsync Samba security ssh Ubuntu virtualization Windows Windows 7 Wordpress

Comments

  1. flo says

    November 4, 2013 at 16:57

    test-updates.wsf is not valid ?

    correcting – but still troubles – recieve :

    No handler for command: cscript.exe

Trackbacks

  1. Confluence: Monitos says:
    August 14, 2020 at 14:08

    Plugins

    Pfade Auf dem Monitos-Server haben sich die Pfade

  2. Icinga/Nagios: Windows monitoring says:
    August 14, 2020 at 13:01

    […] and all Microsoft Exchange stuff. There are no limits you can easily extend the feature with tiny remote batch scripts that will be executed and the output will be evaluated by your monitoring […]

Leave a Reply

Your email address will not be published. Required fields are marked *

Yeaaah Cookie! We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.Ok