Skip to main content

What characters are allowed in a service name? Or which ones are forbidden?

I haven't found anything on this subject in the documentation.

Best regards

Stéphane

good question

from experience I avoid any unicode character, accent and any “special” char like “\” “&” “!”, quotation mark are also not working (single or double quote)

you can have space, “/” “-” “_” 

but basically anything with accent, or non ascii character may cause issues in one way or another

 

the main problem will occur during autodiscovery of services, like volume names, network interface/vlan etc… as the name is often based on the result of a query (api/snmp) 

 

as you said, I never found a rule, so I made my own : anything used as a special char in perl or php or bash, I avoid.  (most of the thing in centreon will pass through at least one of these 3 languages, then be stored in a mysql DB)

there was another post with a problem with special char : Special character service monitoring | Community (centreon.com) but nothing in the doc indeed.

 


​​​​​​I completely agree with you and had seen the post you refer to.

I have since found the following list on the Nagios Forum:
~!$%^&|'"<>?,()=*

I assume that Centreon uses the same rule.

These characters are indeed automatically removed from the name given when a service is created manually.

I'm going to use this list as a reference and instruct you not to use accented characters and other special characters.

Many thanks to you
 


@Stéphane LE CAËR @christophe.niel-ACT 

We are creating a ticket to add this info in the doc.

By the way, did you know you can request changes to the documentation directly from the documentation page you are looking at? There is a “give feedback on this page” link at the bottom of each documentation page that automatically opens a ticket for the documentation team.

Regards


@Stéphane LE CAËR @christophe.niel-ACT 

We have now added the relevant information in the documentation.

Regards


If I may, I read here : https://docs.centreon.com/fr/docs/23.10/monitoring/basic-objects/services/#configuration-du-service

 

Le champ Nom définit le nom du service. Les seuls caractères spéciaux autorisés sont : slash, tiret et underscore.

 

Name: define the name of the service. The only authorized special characters are: slash, hyphen and underscore.

 

But this name is allowed switch.portt1]
so Left & Right Square Bracket are allowed.
 

My tests showed that these characters were removed when manually creating a service ~!$%^&|'"<>?,()=*

It's not very important, but I wanted to make it clear 😉


Bests Regards


Hello @Stéphane LE CAËR ,

These limitations are indeed inherited from Nagios, but some evolutions have been made.

~!$%^&|'"<>?,()=*{} and spaces do not work. Accented characters are supposed to work.

We’ll make the documentation more precise.

Thank you!


Reply