Skip to main content
Question

CLAPI - CMD setmacrodescription missing ?

  • November 24, 2025
  • 6 replies
  • 19 views

Forum|alt.badge.img+11

Hello, just a realization, but maybe it’s mean to work like this, but i don’t believe there is a CLAPI configuration to set the macro description for a CMD command.

I realized that when exporting some configuration i did on a centreon to reuse it later, only the argument decsription was exported and not the ones from the service and host macros.

Is there an API that maybe is not referenced on the documentation ?
Command Line API (v1) - CLAPI | Centreon Documentation

6 replies

lpinsivy
Centreonian
Forum|alt.badge.img+21
  • Centreonian
  • November 25, 2025

Hi ​@Alexandre Belhomme ,

Unfortunately, there is no addMacroDescription function in CLAPI for commands.


Forum|alt.badge.img+11

Hi ​@Alexandre Belhomme ,

Unfortunately, there is no addMacroDescription function in CLAPI for commands.

Do you think this is a missing feature or not ? Maybe there isn’t many people requesting this.


lpinsivy
Centreonian
Forum|alt.badge.img+21
  • Centreonian
  • November 26, 2025

What is your usage to describe macro?


Forum|alt.badge.img+11

What is your usage to describe macro?

That would be to describe a Command more precisely.

Lets take as an example a custom NRPE command based on the nagios-plugins-log package.

On the nrpe server side i would get this configuration

command[check_log_custom]=/usr/lib64/nagios/plugins/check_log -F '$ARG1$' -O '$ARG2$' -q '$ARG3$' -w '$ARG4$'


The command on the centreon side would be the next one
 

/usr/lib64/nagios/plugins/check_nrpe -H '$HOSTADDRESS$' -c 'check_log_custom' -a '$ARG1$' '$ARG2$' '$ARG3$' '$_SERVICEWARNING_MATCH$'

This would be the description for the arguments

ARG1 : Path of the log file to parse
ARG2 : Path of the temporary file to use as a diff (needs write perms)
ARG3 : Match pattern to apply to log file

And this would be the Service Macro description
 

MACRO (SERVICE) WARNING_MATCH : Amount of match to consider as warn before critical


Indeed, after verification the service and host macros description aren’t displayed on the centreon interface, weirdly enough.

But my objective is to give the user the maximum of information about each field that i ask them to fill. I can base that on the macro name but i can only go as far with this.

 

This is an example only of course, but the reason why i’m asking is that i can set those service/host macro description on the web interface, but when exported in CLAPI, it’s not taken into account.


lpinsivy
Centreonian
Forum|alt.badge.img+21
  • Centreonian
  • November 26, 2025

Why don’t you use custom macro like $_SERVICEWARNING$, $_SERVICELOGPATH$, $_SERVICETEMPORARYLOGPATH$ ?

The “description” is in the name.


Forum|alt.badge.img+11

Why don’t you use custom macro like $_SERVICEWARNING$, $_SERVICELOGPATH$, $_SERVICETEMPORARYLOGPATH$ ?

The “description” is in the name.

Exactly for the reason you are mentionning, having the description in the macro name is not optimal, even more without the spaces to make a proper sentense. The issue is that in some use case i would end up with a macro like

COMPLEX_MACRO_WITH_SPECIFIC_EXCEPTION_AND_BE_CAREFUL_ABOUT_THIS_OR_THAT

I can describe the usage of each macro in a documentation or knowledge wiki but that’s additional clicks that the user has to do to understand the use of the command / service or host template.

That’s my understanding of the problematic, i believe that would be a good use of the description of the macro for that problem. But maybe there is another way that would be recommended ?