Question

$SERVICEGROUPALIAS$ macro not working

  • 13 February 2023
  • 3 replies
  • 112 views

Badge +2

Hello, 

We would like to use the $SERVICEGROUPALIAS$ variable in a notification command but it’s not working as expected; based on this documentation https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/3/en/macrolist.html#note5 (which is the redirected official one by Centreon (https://docs.centreon.com/docs/monitoring/basic-objects/macros/#standard-macros)), the macro $SERVICEGROUPALIAS$ should return the alias of the primary servicegroup associated with the current service but it doesn’t, we onlly have an empty value.

 

If we specify explicitly the ServiceGroup Name it’s OK, example : $SERVICEGROUPALIAS:windows$ but we have to use it dynamically but I don’t know if it’s possible and if yes what syntax works; I tried a lot like $SERVICEGROUPALIAS:$SERVICEGROUPNAME$$; $SERVICEGROUPALIAS:SERVICEGROUPNAME$; $SERVICEGROUPALIAS:$SERVICEGROUPNAME$ or with brackets and so on but nothing works!

 

For info we are on Centreon 22.10.4

 

Does anyone know how to get this?

Thanks!


3 replies

Badge +2

Does anyone have an idea about this issue?

Userlevel 3
Badge +10

Hi,

Since a service can be linked to multiple service groups, it is not possible to replace value dynamically.

Otherwise, centreon-engine could not know by which service group alias it should replace the macro.

You have to do $SERVICEGROUPALIAS:windows$

 

You can also display all service groups linked to a service by using $SERVICEGROUPNAMES$

 

Regards,

Kevin

Badge +2

Hello @kduret ,

Thanks for your reply, I understand, but when I read teh documentation it says that :

These macros are normally associated with the first/primary servicegroup associated with the current service.

Don’t that means that $SERVICEGROUPALIAS$ should return the value of the alias of the first ServiceGroup associated to the service?

Reply