Skip to main content
Solved

Exclamation mark (!) not supported as argument in Services by host group

  • December 21, 2021
  • 2 replies
  • 538 views

Forum|alt.badge.img+1

We recently started over with Centreon 21.10.1 to replace our Centreon 2.5.2 as a front-end for Nagios. While setting up the new system, we ran into a bug. In v2.5.2, we were able to escape the special character “!” in check command args for Services by host group. In v21.10.1, using “!” or “\!” as an arg value is simply stripped when saving configuratin. We have a very widespread SNMP community name that contains a “!” character.

The check command is quite simple “$USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o .1.3.6.1.4.1.318.1.1.1.2.2.1.0 -w $ARG2$ -c $ARG3$ -l 'Adv. Battery Capacity' -u '%'” with “$ARG1$ being the SNMP community string.

 

Best answer by itoussies

Hello @Sean,

You could replace $ARG1$ with a Service Macro like $_SERVICE<Macro Name>$. Currently, the exclamation mark is not stripped with Service Macros.

 

EDIT: nevermind my answer.

 

View original
Did this topic help you find an answer to your question?

Forum|alt.badge.img+1
  • Steward *
  • December 21, 2021

I revoke the entire post. I had a new service that stubbornly refused to save the SNMP community name (with “!”) as an arg on the services by hostgroup. I deleted the service and tried again -- the quoting worked. 


itoussies
Centreonian
Forum|alt.badge.img+11
  • Centreonian
  • December 21, 2021

Hello @Sean,

You could replace $ARG1$ with a Service Macro like $_SERVICE<Macro Name>$. Currently, the exclamation mark is not stripped with Service Macros.

 

EDIT: nevermind my answer.

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings