Page 1 of 1

action_url not translating all macros

Posted: Thu Jan 05, 2012 1:20 pm
by BlargMaN00
I am writing a custom PHP page for some actions that I want to be able to perform, and when I put my macros in the action_url directive, only some of them are translating. I was wondering if anyone else was having this problem, or if anyone knew why this was happening.

Code: Select all

action_url     actions.php?host=$HOSTNAME$&service=$SERVICEDESC$&servicegroups=$SERVICEGROUPNAMES$&address=$HOSTADDRESS$&servicestate=$SERVICESTATE$&action=1
The $SERVICEGROUPNAMES$ and $SERVICESTATE$ macros are not translating, but the others translate just fine.

These should be the current values of these macros:

Code: Select all

$SERVICEGROUPNAMES$ = 3Ware_RAID_Services,All_Services
$SERVICESTATE$ = WARNING
Thanks in advance!!!!

JP

Re: action_url not translating all macros

Posted: Sat Jan 07, 2012 9:21 am
by crfriend
Not all macros are available at all times and for all possible uses. Check the manual page for macros for the matrix that states what's available where and when.

It is quite possible that the $SERVICESTATE$ macro may not be available for the action_url statement as, I believe, those are "cast in stone" at Nagios start time. I'm not sure about $SERVICEGROUPNAMES$.