Check_service "NameService"


#1

Hi friends.

I would like to know if it is possible to check if exist a service, but i have to check in a lot of machines and name of service are differents.

so i would like to know how can i check service name with wildcards

Example:

check_nrpe -H IP_Address -t 120 -c check_service -a “filter=name = ‘ServiceName*’”

Is this possible???

Regards


#2

Hi,

I do it like that:

check_nrpe -H IP_Address -t 120 -c CheckServiceState -a ShowAll “ServiceName”

For each service name you’ll have to define an extra service.

Best regards


#3

Problem is evey host has different service name

Imagine a service name like this

ServiceName-ps-XXXXXXX-XXXXX

where every “X” is a random number (548976-25487 or 658974-12584) so every host has a different name

I don’t want to define thousands of services…


#4

Hello,

It is possible to use wildcards with a regex query. This is for example one filter I’m using

"filter=start_type = 'auto' and name not regexp 'OneSyncSvc.*|CDPUserSvc.*' and name not in ('AeLookupSvc','Bonjour Service')"

Which excludes the annoying OneSynSvc and CDPUserSvc WIndows servces which have random names. I guess you can omit the ‘no’ and include with regex…

Grtz

Willem


#5

Hi friends

I have modified command to

check_nrpe -t 120 -H IP_ADDRESS_HOST -c check_service -a “filter=name like ‘ServiceName’”

and looks OK

I will define OK WARN and CRITICAL states

Thanks and regards