action_url not translating all macros

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
BlargMaN00
Posts: 1
Joined: Thu Jan 05, 2012 1:12 pm

action_url not translating all macros

Post 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
crfriend
Posts: 61
Joined: Thu Sep 01, 2011 7:53 am
Location: Central New England (USA)
Contact:

Re: action_url not translating all macros

Post 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$.
Locked