Enforced Services

CMK 2.0.0p25 Enterprise

I have a service that I want to make sure is installed and running on every server I have monitored with CMK, so that I know for sure it was installed and not missed during deployment.

The problem is, this service automatically gets updated periodically from the vendor and changes the name every other time. First it is called “MYService”, then it changes to “MyService”. (I have no idea why they started doing this.)

I tried enabling this under Enforced Services but not exactly sure how to handle this periodic rename. It’s the same service, so I am OK if either spelling of the name appears, but one or the other needs to always be running as a Windows service.

I see that there is an option for “Alternative names for the service” but I must be missing something as it’s not working the way I think it should.

Thanks!

UPDATE:
I think I was getting messed up by the automatic service discovery not excluding this particular service, so I think I need to configure both the enforced service including the alternative service name, and exclude it from the autodiscovery process.

if the name for the wanted service is the same just except for the usage of upper / lower case, you might use a RegEx which will ignore the upper/lower case difference of that service name
Regards
Nora

So I have another service that I just tried to enforce with regex, but doesn’t seem to work… It is an “Enforced Systemd single service”, discovered as

my-service-0179126d-9c91-4c06-96d9-170c0f7ddcca

where the GUID at the end will change with each update of the service. Under “Name of the service”, I tried matching

my-service-.*

but when I go to the host’s services, I see

“my-service-.* not found”, as it seems to be taking the “.*” literally. Does this field not support regex, or am I doing it wrong?

Thanks!

Strange - I can´t achieve it either. RegEx seems not to work for systemd service discovery rules.

To answer that question, thats how we do it:

The (?i) makes the RegEx cans insensitive.

regards

Michael

To answer that question it would be helpful to see the agent output.

regards

Michael

Here is the relevant output:

cmk -d server | grep my-service

my-service-0179126d-9c91-4c06-96d9-170c0f7ddcca.service enabled enabled
my-service-0179126d-9c91-4c06-96d9-170c0f7ddcca.service loaded active running My Service (0179126d-9c91-4c06-96d9-170c0f7ddcca)
0::/system.slice/my-service-0179126d-9c91-4c06-96d9-170c0f7ddcca.service root 976484 276812 20:20:38 9-20:17:43 925 /opt/service/bin/my-service-0179126d-9c91-4c06-96d9-170c0f7ddcca manual

I tested in 2.0.0p26, 1.6.0p27 and I also was not able to discover any systemd servivce, even not a simple one like rsyslog. An enforced service works but doesn’t help.

Anyone else an idea?

What works is process discovery. My personal approach is using that one to detect if a process is really running. At least in Windows world it happens that the service is in running state but the process died.

regards

Michael

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.