Page 1 of 1

Monitoring services with wildcard

Posted: Tue Jul 04, 2023 9:27 am
by RickNWB
Hi,

I have a few servers where I want to monitor some services. The problem is that the services will slightly change every 2/3 weeks. Is it possible to use a wildcard as a service? The service name is "Apache_7.7.79" and the next week it is "Apache_7.7.80" so is it possible to use a wildcard like "Apache_7.7.*"

Please let me know.
Rick

Re: Monitoring services with wildcard

Posted: Thu Jul 06, 2023 3:18 am
by Mikasa23
Hi Rick,
Yes, it is possible to use a wildcard in service monitoring to accommodate the changing service names. You can use a wildcard like "Apache_7.7.*" to monitor any service with aio games name starting with "Apache_7.7." followed by any version number.

Re: Monitoring services with wildcard

Posted: Fri Jul 07, 2023 1:44 am
by RickNWB
Thank you for your response! Let's try it out

Re: Monitoring services with wildcard

Posted: Fri Jul 07, 2023 7:10 am
by nehakakar
Yes you can create a service check using a wildcard like "Apache_7.7.*". This will match any service name that starts with "Apache_7.7." and has any value for the version number.

Re: Monitoring services with wildcard

Posted: Tue Jul 18, 2023 1:33 am
by RickNWB
I don't get what to do. I tried a few things.

I created a service and I use the check command "check_XI_ncpa" but when I do that, I can't use the wildcard *. When I assign the service to a host, I receive a message that the service is unknown.

Has anyone a link how to do this?

Re: Monitoring services with wildcard

Posted: Tue Jul 18, 2023 2:00 am
by kg2857
What happens if you run systemctl httpd status or systemctl and grep -i apache? My syntax could be off so...

Re: Monitoring services with wildcard

Posted: Tue Jul 18, 2023 3:15 am
by RickNWB
Do I need to do that in "configure service" and under "monitor the service with this command"? Sorry, I am very new with Nagios

Re: Monitoring services with wildcard

Posted: Tue Jul 18, 2023 3:24 am
by kg2857
You run the commands in the shell, such as an ssh session.