Icinga / icinga2

The core of our monitoring platform with a powerful configuration language and REST API.
https://icinga.com/docs/icinga2/latest
GNU General Public License v2.0
2.03k stars 578 forks source link

Additional filter options for check_service.exe #7976

Closed phibos closed 4 years ago

phibos commented 4 years ago

Is your feature request related to a problem? Please describe.

At the moment I use check_service.exe to monitor the state of some windows services and I want to increase the number of services. There are about 10 services I want to check on a basic windows server and for example about 30 additional services on an Exchange Server.

I'm looking forward to check the services on about 400 Windows Servers which would result in 4000+ checks just for the windows services.

Describe the solution you'd like

It would be nice if I could provide more than one service to check. This would reduce the overall number of service checks in the Icinga Cluster.

check_service.exe -s <service1> -s <service2> -s <service3>

The service should become critical if one of the services is not running.

It would also be nice to specify some sort of RegEx to include or exclude the services.

Include

check_service.exe -s '^MSExchange.*$'

With additional exclude

check_service.exe -s '^MSExchange.*$' -e '.*AlwaysFailed$'

Describe alternatives you've considered

The main alternative would be to write/find an extra check program/script to fit the requirements.

Additional context

For me it is OK if you want to keep the shipped check commands as simple as possible.

Al2Klimov commented 4 years ago

@lippserd Do we even still maintain the shipped (old) Windows plugins?

lippserd commented 4 years ago

@lippserd Do we even still maintain the shipped (old) Windows plugins?

We should encourage users to use Icinga for Windows.

@LordHepipud Is it possible to check multiple services with one check?

LordHepipud commented 4 years ago

Hello everyone,

yes this is possible with the service check command:

Invoke-IcingaCheckService -Service 'wscsvc', 'XblAuthManager', 'XblGameSave';
[CRITICAL] Check package "Services" - [CRITICAL] Service "Xbox Live-Spiele speichern (XblGameSave)"
\_ [CRITICAL] Service "Xbox Live-Spiele speichern (XblGameSave)": Value "Stopped" is not matching threshold "Running"
| 'service_sicherheitscenter_wscsvc'=4;;4 'pending_paused_services'=0;; 'running_services'=2;; 'pending_continued_services'=0;; 'stopped_services'=1;; 'pending_started_services'=0;; 'service_count'=3;; 'pending_stopped_services'=0;; 'paused_services'=0;; 'service_xbox_livespiele_speichern_xblgamesave'=1;;4 'service_xbox_live_authentifizierungsmanager_xblauthmanager'=4;;4

A description is vailable on Icinga Docs for the Service Check

LordHepipud commented 4 years ago

Just one addition, you can also do some wildcard include / exclude:

Invoke-IcingaCheckService -Service '*csv*';
[CRITICAL] Check package "Services" - [CRITICAL] Service "Volumetric Audio Compositor-Dienst (VacSvc)", Service "Windows Update Medic Service (WaaSMedicSvc)", Service "Windows-Ereignissammlung (Wecsvc)"
\_ [CRITICAL] Service "Volumetric Audio Compositor-Dienst (VacSvc)": Value "Stopped" is not matching threshold "Running"
\_ [CRITICAL] Service "Windows Update Medic Service (WaaSMedicSvc)": Value "Stopped" is not matching threshold "Running"
\_ [CRITICAL] Service "Windows-Ereignissammlung (Wecsvc)": Value "Stopped" is not matching threshold "Running"
| 'pending_paused_services'=0;; 'running_services'=4;; 'pending_continued_services'=0;; 'stopped_services'=3;; 'pending_started_services'=0;; 'service_count'=7;; 'pending_stopped_services'=0;; 'paused_services'=0;; 'service_sicherheitscenter_wscsvc'=4;;4 'service_synchronisierungshost_1dd0d4_onesyncsvc_1dd0d4'=4;;4 'service_volumetric_audio_compositordienst_vacsvc'=1;;4 'service_windowsereignissammlung_wecsvc'=1;;4 'service_windowssofortverbindung_konfigurationsregistrierungsstelle_wcncsvc'=4;;4 'service_windows_update_medic_service_waasmedicsvc'=1;;4 'service_microsoft_passport_ngcsvc'=4;;4
lippserd commented 4 years ago

@LordHepipud Thanks for the info. I added a docs PR for the wildcard support. @phibos Please use Icinga for Windows.