Skip to content
This repository has been archived by the owner on Oct 6, 2023. It is now read-only.

Recursive macro evaluation #106

Open
BenoitPoulet opened this issue Jun 19, 2018 · 5 comments
Open

Recursive macro evaluation #106

BenoitPoulet opened this issue Jun 19, 2018 · 5 comments
Assignees

Comments

@BenoitPoulet
Copy link

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

@ganoze ganoze self-assigned this Jun 19, 2018
@ganoze
Copy link
Contributor

ganoze commented Jun 19, 2018

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 ?

@sbraz
Copy link

sbraz commented Jan 30, 2019

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 :/

@bouda1
Copy link
Contributor

bouda1 commented Jan 30, 2019

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.

@sbraz
Copy link

sbraz commented Aug 20, 2019

@bouda1 Has there been any progress on this lately?

@lpinsivy lpinsivy changed the title Centengine do not translate $HOSTADDRESS$ in macro Recursive macro evaluation Nov 26, 2019
@BenoitPoulet
Copy link
Author

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants