Migrate Windows plugins to Powershell plugins

Hello,

I have Icinga2 v2.16.3 installed on a Debian 13 machine. It is surveilling a bunch of Windows machines. In preparation for future version, I am trying to migrate away from the Windows plugins to the Powershell plugins, as the documentation suggests. I have a handful of services, described in a conf file, that use Windows plugins at the moment. However I simply cannot figure out how to use the Powershell plugins in my conf files instead? The documentation doesn’t have any info on check_command, vars, etc. I must be missing something very obvious.

Here’s how my service for checking windows updates look, for example:

apply Service "updates" to Host {
  check_command = "update-windows"
  host_name = host.name
  zone = host.name
  check_interval = 2h
  retry_interval = 15m
  vars.ignore_reboot = true
  vars.update_win_crit = 1
  assign where host.vars.os_type == "windows"
}

I can see that the powershell plugins have a command for this here, but I don’t know what it’s supposed to look like in my conf file: icinga-powershell-plugins/doc/plugins/14-Invoke-IcingaCheckUpdates.md at master · Icinga/icinga-powershell-plugins · GitHub

Thank you.

Hi Gaëtan,
I don’t know the answer, but you would perhaps fancy watching this video: How to Monitor Windows with Icinga Webinar
Kind regards,
Jean

My problem is that my Icinga2 instance is installed on Linux. Now that I think of it I don’t even know if it’s possible to install the powershell plugins on Linux? It seems to be a part of Icinga for Windows only.

All Icinga central servers (masters and satellites) will be Linux :slight_smile:

You run those powershell plugins on Icinga for Windows Installations

Ah I see, Icinga for Windows is something I need to install on my target machines and this will give me access to the commands.

I’m also looking in doing the same thing. I was even on the webinar. The issue is that this was made primary to be used with Director. It lacks documentation for how to do with conf files, in my opinion.

You have to install Icinga Powershell Framework on all Windows machines. You would need to create the commands and service object from scratch. Then there are 2 ways on how you can run the checks. Add the Windows machine as an endpoint or use API calls to execute the checks. You also need to be aware that the checks are on the heavier side.

There is documentation for generating icinga dsl config files: Icinga Config - Icinga for Windows

Then you need to have a directory in zones.d for your zone, so that the windows agents also have that config.

That makes a lot of sense, thanks, I don’t use Director. It’s a shame it’s not easier. In the end I solved my initial problem by using NSClient++, which I already had installed. It has the checks I needed to replace out of the box.