How to add Windows Service to monitor status (stopped, restart, running) using Icinga2

I am very new to Icinga2. Currently, I have Icinga server running (ubuntu) and client (Windows Server 2012) connected with hostalive check command. The client that is Window server has the Icinga agent installed.

We have few services we want to monitor on Windows server 2012 for specific software. What is best way to monitor status of these services without a lot of coding (run, stop, restart)?

If anyone can give a specific example of code or steps that would be great.

  • Icinga Web 2 version
  • Web browser used: chrome
  • Icinga 2 version: r2.11.2-1
  • Server operating system and version : Ubuntu 20.04.4 LTS

Update Icinga2 !!
update powershell to the newest available version for W2012
read tutorials on how to use icigna director.
install icinga director, and import the powershell plugins conf into icinga director
Create service and host templates
add services= checks to your host.

install the powershell frameork and powershell plugins on win2012
read about the powershell plugins, there are a lot of check commands (Invoke-Icinga*) which will provide a lot of checks

if you just want to check services than there is a non powershell check for that in
C:\Program Files\ICINGA2\sbin\

like check_service.exe, check_disk.exe, check_load
that will help too

Thanks, I have been reading documents. Is there example you have give please or point form?

I will read more in meantime and test in lab.

Client : Windows : service conf added following cmds:

apply Service “service-” for (service_win_service => config in host.vars.service_win_services) {

import “generic-service”

check_command = “service-windows”

vars += config

vars.service_win_service = service_win_service

notes = "Service check for " + service_win_service

}

On Icinga Master host conf added

vars.service_win_services[“NewsWire-OpenMedia-Broker1”] = {}


Icinga Web

is only showing Custom variable but not the status of the service.

any help would be greatly appreciated

image

only software updates will help here

I ran sudo apt-get upgrade no packages found

I also ran sudo apt-get install icinga2-bin no updates found …it is saying 2.11.2 is latest

any other commands to try?

You only get the newest versions directly from icinga as described here.

After the upgrade the Web page went down with PHP error:

Fatal error : Uncaught Error: Class ‘Locale’ not found in /usr/share/icinga-php/ipl/vendor/ipl/i18n/src/Locale.php:122 Stack trace: #0 /usr/share/icinga-php/ipl/vendor/ipl/i18n/src/Locale.php(87): ipl\I18n\Locale->parseLocale(‘en_us’) #1 /usr/share/php/Icinga/Application/Web.php(514): ipl\I18n\Locale->getPreferred(‘en-US,en;q=0.9’, Array) #2 /usr/share/php/Icinga/Application/ApplicationBootstrap.php(730): Icinga\Application\Web->detectLocale() #3 /usr/share/php/Icinga/Application/Web.php(105): Icinga\Application\ApplicationBootstrap->setupInternationalization() #4 /usr/share/php/Icinga/Application/ApplicationBootstrap.php(416): Icinga\Application\Web->bootstrap() #5 /usr/share/php/Icinga/Application/webrouter.php(109): Icinga\Application\ApplicationBootstrap::start() #6 /usr/share/icingaweb2/public/index.php(4): require_once(’/usr/share/php/…’) #7 {main} thrown in /usr/share/icinga-php/ipl/vendor/ipl/i18n/src/Locale.php on line 122

any solutions please