Skip to main content
Question

$SERVICEGROUPALIAS$ macro not working

  • Feb 13, 2023 9:10 AM UTC
  • 3 replies
  • 164 views

Forum|alt.badge.img+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

Forum|alt.badge.img+2
  • Author
  • Steward **
  • Feb 21, 2023 8:28 AM UTC

Does anyone have an idea about this issue?


kduret
Centreonian
Forum|alt.badge.img+10
  • Centreonian
  • Feb 21, 2023 10:23 AM UTC

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


Forum|alt.badge.img+2
  • Author
  • Steward **
  • Feb 21, 2023 10:29 AM UTC

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?