CheckServiceState

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
cocoyanouck
Posts: 96
Joined: Fri Apr 08, 2016 3:17 am

CheckServiceState

Post 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.
Attachments
Capture.JPG
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: CheckServiceState

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
cocoyanouck
Posts: 96
Joined: Fri Apr 08, 2016 3:17 am

Re: CheckServiceState

Post by cocoyanouck »

Unfortunately the display name is also changing so I can't use it :(
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: CheckServiceState

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
cocoyanouck
Posts: 96
Joined: Fri Apr 08, 2016 3:17 am

Re: CheckServiceState

Post by cocoyanouck »

OK thank you, I'll try on monday.

There is no possibility with variable or with an extension like "[XXX].*" ? :?
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: CheckServiceState

Post by tgriep »

No, the command does not support wildcards.
Be sure to check out our Knowledgebase for helpful articles and solutions!
cocoyanouck
Posts: 96
Joined: Fri Apr 08, 2016 3:17 am

Re: CheckServiceState

Post by cocoyanouck »

OK thank you, you can close this ticket.
Locked