Skip to content

Macros ​

You can use macros in Action Menus, action_url, notes_url and icon_url, among other places.

Host Macros ​

Host related Macros:

MacroExampleDescription
$HOSTNAME$www.thruk.orgName from the host configuration
$HOSTALIAS$thruk.orgAlias from the host configuration
$HOSTADDRESS$94.185.90.75Adress from the host configuration
$HOSTATTEMPT$1Number of current check attempt
$MAXHOSTATTEMPTS$5the configured max_check_attempts value for this host
$HOSTBACKENDADDRESS$localhost:6557Connection string used by the backend of this host
$HOSTBACKENDID$abcdInternal id for the backend of this host
$HOSTBACKENDNAME$Cental-MonitorGiven name for the backend of this host
$HOSTCHECKCOMMAND$check_http!www.thruk.orgCheckcommand used for this host
$HOSTDOWNTIME$1Scheduled downtime level, 0 if no downtime, >= 1 if in downtime
$HOSTDURATION$1337Time in seconds since last state change
$HOSTLATENCY$0.12Latency of last check in seconds
$HOSTNOTES$notes textcontains the configrured notes value for this host
$HOSTNOTESURL$http://example.orgNotes URL
$HOSTOUTPUT$HTTP - 200 OK...Output of last check
$HOSTPERFDATA$size=100B;200;300;;;Performance data from the last check
$HOSTSTATE$UPState of last check in human readable form
$HOSTSTATEID$0Number of the current state. 0 UP, 1 Down, 2 Unreachable
$HOSTSTATETYPE$HARDEither HARD or SOFT
$_HOST{CUSTVARS}$anythingCustom variable value

Service Macros ​

Service related Macros:

MacroExampleDescription
$SERVICEDESC$Check WebsiteDescription from the service configuration
$SERVICEATTEMPT$1Number of current check attempt
$MAXSERVICEATTEMPTS$5the configured max_check_attempts value for this service
$SERVICEBACKENDADDRESS$localhost:6557Connection string used by the backend of this service
$SERVICEBACKENDID$abcdInternal id for the backend of this service
$SERVICEBACKENDNAME$Cental-MonitorGiven name for the backend of this service
$SERVICECHECKCOMMAND$check_http!www.thruk.orgCheckcommand used for this host
$SERVICEDURATION$1337Time in seconds since last state change
$SERVICELATENCY$0.12Latency of last check in seconds
$SERVICENOTESURL$http://example.orgNotes URL
$SERVICEOUTPUT$HTTP - 200 OK...Output of last check
$SERVICEPERFDATA$size=100B;200;300;;;Performance data from the last check
$SERVICESTATE$OKState of last check in human readable form
$SERVICESTATEID$0Number of the current state. 0 UP, 1 Down, 2 Unreachable
$SERVICESTATETYPE$HARDEither HARD or SOFT
$_SERVICE{CUSTVARS}$anythingCustom variable value

Date/Time Macros ​

Date and time related macros:

MacroExampleDescription
$SHORTDATETIME$2015-01-14 14:53:35Date with format: %Y-%m-%d %H:%M:%S
$LONGDATETIME$Wed Jan 14 14:53:35 CET 2015Date with format: %a %b %e %H:%M:%S %Z %Y
$DATE$2015-01-14Date with format: %Y-%m-%d
$TIME$14:53:35Date with format: %H:%M:%S
$TIMET$1421243760Unix Timestamp

User Macros ​

Macros from the resource.cfg:

MacroExampleDescription
$USER1$/usr/lib/nagios/pluginsUSER1 variable from resource.cfg
...

Dashboard Macros ​

These macros are only available in server actions used by action items in the panorama dashboard.

MacroExampleDescription
$REMOTE_USER$thrukadminUser name of current user which is also available in $REMOTE_USER environment variable
$DASHBOARD_ID$10Number of the current dashboard
$DASHBOARD_ICON$tabpan-tab_1_panlet_2Id of the current icon which triggered the server action