centreon-engine
centreon-engine copied to clipboard
Recursive macro evaluation
Centreon Engine version: centreon-engine-1.8.1-1.el7.centos.x86_64
OS: EL7
Steps to reproduce the issue:
- Declare a service macro : TORTUE with value : $HOSTADDRESS$
- Use $_SERVICETORTUE$, in a check command
- 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
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 ?
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 :/
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 Has there been any progress on this lately?
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.