Page 1 of 1

CheckServiceState

Posted: Thu Mar 21, 2019 6:16 am
by cocoyanouck
Hi everybody,

I have to check a service state on a Exchange server. I put the name of the specified service : OneSyncSvc_3785179 but that didn't work so i tried the complete name : "Hôte de synchronisation_3785179" and that's fine !

But .... the name (number at the end of the name) of this service is changed after each reboot of this service or of the server...

Is there any solution ?

Thanks a lot.

Re: CheckServiceState

Posted: Fri Mar 22, 2019 1:06 pm
by tgriep
When the Windows Server is rebooted, does the "Display Name" change to a unique name or does it stay the same?
If it stays the same, you could use that for the argument in the check.

Re: CheckServiceState

Posted: Fri Mar 22, 2019 1:39 pm
by cocoyanouck
Unfortunately the display name is also changing so I can't use it :(

Re: CheckServiceState

Posted: Fri Mar 22, 2019 1:47 pm
by tgriep
That is unfortunate.
I checked the command syntax for the plugin and I did not see that you could use a wildcard for the service name.

The only other option is if you are using a newer version of NSClient, you can use the new check_service command and exclude the services you do not want to check.
See this link for more details.
https://docs.nsclient.org/reference/win ... ck_service

Re: CheckServiceState

Posted: Fri Mar 22, 2019 4:35 pm
by cocoyanouck
OK thank you, I'll try on monday.

There is no possibility with variable or with an extension like "[XXX].*" ? :?

Re: CheckServiceState

Posted: Mon Mar 25, 2019 1:24 pm
by tgriep
No, the command does not support wildcards.

Re: CheckServiceState

Posted: Mon Mar 25, 2019 2:21 pm
by cocoyanouck
OK thank you, you can close this ticket.