Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature-Request] Invoke-IcingaCheckService Filter Service Startup type not only Service status #211

Closed
ferencmatyas opened this issue Jul 16, 2021 · 4 comments · Fixed by #242
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@ferencmatyas
Copy link

Hello,

I have many services with random names at the end so I use wildcard *. I would like to check Status Running but only if Service has Startup type Automatic. Now the Manual startup type is also matched and throwing an error. Can this be implemented? Maybe also with Startup type Automatic (Delayed Start) as some services use it.

PS C:\Windows\system32> Invoke-IcingaCheckService -Service ABCD* -Exclude $null -Status Running -Verbosity 3
[CRITICAL] Services: 1 Critical 2 Ok [CRITICAL] Service "ABCD_manual" (Stopped) (All must be [OK])
_ [OK] Service "ABCD_automatic": Running
_ [CRITICAL] Service "ABCD_manual": Stopped is not matching threshold Running
_ [OK] Service "ABCD_automatic": Running

Thank you,
Regards
Ferenc

@LordHepipud
Copy link
Collaborator

Hello and thank you for the issue.

If you leave -Service empty, the plugin will by default check all services which are configured as Automatic and not report Critical in case the service is not running, if the exit code of the service is not 0.

If a service is set to startup Automatic and gracefully shut down, the exit code is 0 and therefor will not report critical.

Does this help?

@ferencmatyas
Copy link
Author

Hello, thanks for the reply.
Unfortunately I cannot put the not running service on Automatic, it has to be on Manual. Also with Automatic a maintenance reboot triggers the service to start, what is not needed. The check belongs to a service set what only checks this ABCD* service. Can I add a -StartupType switch to the downloaded installation somehow?
Thank you!

@LordHepipud
Copy link
Collaborator

Right now this is not supported by the plugin, as it was not needed to make differentiation for this.

We could add this for 1.6.0 to allow filtering of services and the startup type.

@LordHepipud LordHepipud added this to the v1.6.0 milestone Jul 19, 2021
@LordHepipud LordHepipud added the enhancement New feature or request label Jul 19, 2021
@LordHepipud LordHepipud self-assigned this Jul 19, 2021
@ferencmatyas
Copy link
Author

Hello, thanks for the reply. It would be great to have it in the next version, thanks a lot for your support!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants