centreon-engine icon indicating copy to clipboard operation
centreon-engine copied to clipboard

Recursive macro evaluation

Open BenoitPoulet opened this issue 6 years ago • 5 comments

Centreon Engine version: centreon-engine-1.8.1-1.el7.centos.x86_64

OS: EL7

Steps to reproduce the issue:

  1. Declare a service macro : TORTUE with value : $HOSTADDRESS$
  2. Use $_SERVICETORTUE$, in a check command
  3. Try to execute the check command via a service

Describe the results you received: The $HOSTADDRESS$ is not translated, the command executed by centreon engine contain $HOSTADDRESS$ : /usr/lib/nagios/plugins/check_http -f follow -H localhost -p 80 -t 30 -u /haproxycheck -I $HOSTADDRESS$

Describe the results you expected: The $HOSTADDRESS$ must be translated with the address of the host , like this : /usr/lib/nagios/plugins/check_http -f follow -H localhost -p 80 -t 30 -u /haproxycheck -I 127.0.0.1

BenoitPoulet avatar Jun 19 '18 09:06 BenoitPoulet

Recursive macro evaluation is not (yet ?) implemented in Centreon Engine. Therefore the results you receive are perfectly normal.

So this will be treated like a feature request. @lpinsivy what do you think about it ?

ganoze avatar Jun 19 '18 11:06 ganoze

The lack of support for this is quite frustrating. If we were to use $ARG$-style parameters in commands, it would work fine. That kind of problem does not encourage people to use service macros :/

sbraz avatar Jan 30 '19 09:01 sbraz

Sorry for the delay. Many changes have been made in centreon-engine and centreon-broker recently to improve the notification system and also the overall performance. These changes are now well advanced and we will be able to process this ticket right after.

bouda1 avatar Jan 30 '19 10:01 bouda1

@bouda1 Has there been any progress on this lately?

sbraz avatar Aug 20 '19 08:08 sbraz

Any update for this ?

Recursion on one level may be enough to start.

I'm currently stuck with a service who has a macro PASSWORD to fill (coming from a check command who has $_SERVICEPASSWORD"), but in this case i would like to give it "$_HOSTPASSWORD".

Useful to build services who can have either their own password, or can have their password inherited from the host.

BenoitPoulet avatar Aug 26 '20 08:08 BenoitPoulet