Pass macro value to another macro

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Kilvador
Posts: 17
Joined: Mon Oct 09, 2017 1:09 am
Location: Russia, PAO MegaFon

Pass macro value to another macro

Post by Kilvador »

Hello to all!

I have task: send notification to CRM with host contacts.

We have $CONTACTGROUPMEMBERS$, that can be asked like $CONTACTGROUPMEMBERS:cg1$ would return a comma-delimited list of all (contact) members of the contactgroup cg1. (https://assets.nagios.com/downloads/nag ... oupmembers)

I need this construction to work: $CONTACTGROUPMEMBERS:$CONTACTGROUPNAME$$ in etc/commands.cfg, where $CONTACTGROUPNAME$ should become contact_group of my host/service for notification.

It is not working, Should by list of contacts, but in nagios.debug: $CONTACTGROUPMEMBERS:$CONTACTGROUPNAME$$.

When I did: $CONTACTGROUPMEMBERS:$$CONTACTGROUPNAME$$$ in nagios.debug: $CONTACTGROUPMEMBERS:$first_contact_group_from_all_contactgroups$

Can anybody help me?
Locked