Monitor service with brackets in name

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.
Post Reply
hausrocker
Posts: 16
Joined: Wed Jan 13, 2021 8:48 am

Monitor service with brackets in name

Post by hausrocker »

Hi
I would like to monitor a service that is called "myservice (backup)" but the default command

Code: Select all

#define service{
#	use			generic-service
#	host_name		MGMT011
#	service_description	Dienst myservice
#	check_command		check_snmp_win!"myservice (backup)"
#	}
Does not work.

Code: Select all

No services matching myservice (backup) found : CRITICAL
The service name is exactly the display name of the windows service. I suppose the brackets are the problem.

I already found out I could also look for just "myservice" and leave the part with brackets completely away. That works unless there are 2 services that only have different information in brackets:
myservice (Main) and myservice (Backup)

Then the system returns:

Code: Select all

2 services active (matching myservice) : WARNING
I have the SNMP Service enabled for user public with read only for the Nagios Server IP.

Any ideas on this?
hausrocker
Posts: 16
Joined: Wed Jan 13, 2021 8:48 am

Re: Monitor service with brackets in name

Post by hausrocker »

This forum is obviously dead and should be closed. No support at all.

I found a solution in the mean time. sc config "Old service name" displayname= "New service name" on the Windows system.
Post Reply