diff --git a/.vitepress/config.mts b/.vitepress/config.mts index 97eca27..b29a29d 100644 --- a/.vitepress/config.mts +++ b/.vitepress/config.mts @@ -94,6 +94,8 @@ export default defineConfig({ { text: 'Authentication And Authorization CGIs', link: '/documentation/usersguide/cgiauth' }, { text: 'Plugins', link: '/documentation/usersguide/plugins' }, { text: 'Macros', link: '/documentation/usersguide/macros' }, + { text: 'Standard Macros in Naemon', link: '/documentation/usersguide/macrolist' }, + { text: 'Naemon Logo', link: '/logo' } ] }, diff --git a/.vitepress/theme/naemon.css b/.vitepress/theme/naemon.css index f9cd900..9cf84bd 100644 --- a/.vitepress/theme/naemon.css +++ b/.vitepress/theme/naemon.css @@ -41,4 +41,32 @@ padding: 15px; width: 100%; text-align: center; -} \ No newline at end of file +} + +/* Large content for wide pages such as the default macro list */ +.page-large-content #VPContent { + padding-right: 15px; +} + +.page-large-content .VPNavBar.has-sidebar .content { + padding-right: 15px; +} + + +/* Macro List classes */ +.MacroYes { + background-color: var(--vp-code-line-diff-add-color); +} + +/* Fix tables to be able to have a static header */ +.table-container table { + position: relative; + display: initial !important; +} + +/* Add static header to large tables */ +.th-sticky { + position: sticky; + top: var(--vp-nav-height); + z-index: 100; /* Ensure the header is above other content */ +} diff --git a/legacy/documentation/usersguide/macrolist.md b/src/documentation/usersguide/macrolist.md similarity index 88% rename from legacy/documentation/usersguide/macrolist.md rename to src/documentation/usersguide/macrolist.md index e8e0089..d4a6782 100644 --- a/legacy/documentation/usersguide/macrolist.md +++ b/src/documentation/usersguide/macrolist.md @@ -1,15 +1,18 @@ --- -layout: doc -title: Standard Macros in Naemon +sidebar: true +aside: false +pageClass: page-large-content --- +# Standard Macros in Naemon + See Also: How Macros Work Standard macros that are available in Naemon are listed here. On-demand macros and macros for custom variables are described here. -### Macro Validity +## Macro Validity Although macros can be used in all commands you define, not all macros may be "valid" in a particular type of command. For example, some macros may only be valid during service @@ -37,16 +40,19 @@ macros consist of all uppercase characters and are enclosed in $ characte -### Macro Availability Chart +## Macro Availability Chart Legend:
- +
+ +
NoThe macro is not available
YesThe macro is available
-
- +
+
+ @@ -581,7 +587,7 @@ macros consist of all uppercase characters and are enclosed in $ characte - + @@ -855,619 +861,621 @@ macros consist of all uppercase characters and are enclosed in $ characte +
Macro Name Service ChecksHost Perf Data
Summary Macros:Summary Macros:
$TOTALHOSTSUP$ 10$USERn$ YesYesYesYesYesYesYesYes
-### Macro Descriptions - - +## Macro Descriptions +
+
+ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + +
Host Macros: 3Host Macros: 3
$HOSTNAME$$HOSTNAME$ Short name for the host (i.e. "biglinuxbox"). This value is taken from the host_name directive in the host definition.
$HOSTDISPLAYNAME$$HOSTDISPLAYNAME$ An alternate display name for the host. This value is taken from the display_name directive in the host definition.
$HOSTALIAS$$HOSTALIAS$ Long name/description for the host. This value is taken from the alias directive in the host definition.
$HOSTADDRESS$$HOSTADDRESS$ Address of the host. This value is taken from the address directive in the host definition.
$HOSTSTATE$$HOSTSTATE$ A string indicating the current state of the host ("UP", "DOWN", or "UNREACHABLE").
$HOSTSTATEID$$HOSTSTATEID$ A number that corresponds to the current state of the host: 0=UP, 1=DOWN, 2=UNREACHABLE.
$LASTHOSTSTATE$$LASTHOSTSTATE$ A string indicating the last state of the host ("UP", "DOWN", or "UNREACHABLE").
$LASTHOSTSTATEID$$LASTHOSTSTATEID$ A number that corresponds to the last state of the host: 0=UP, 1=DOWN, 2=UNREACHABLE.
$HOSTSTATETYPE$$HOSTSTATETYPE$ A string indicating the state type for the current host check ("HARD" or "SOFT"). Soft states occur when host checks return a non-OK (non-UP) state and are in the process of being retried. Hard states result when host checks have been checked a specified maximum number of times.
$HOSTATTEMPT$$HOSTATTEMPT$ The number of the current host check retry. For instance, if this is the second time that the host is being rechecked, this will be the number two. Current attempt number is really only useful when writing host event handlers for "soft" states that take a specific action based on the host retry number.
$MAXHOSTATTEMPTS$$MAXHOSTATTEMPTS$ The max check attempts as defined for the current host. Useful when writing host event handlers for "soft" states that take a specific action based on the host retry number.
$HOSTEVENTID$$HOSTEVENTID$ A globally unique number associated with the host's current state. Every time a host (or service) experiences a state change, a global event ID number is incremented by one (1). If a host has experienced no state changes, this macro will be set to zero (0).
$LASTHOSTEVENTID$$LASTHOSTEVENTID$ The previous (globally unique) event number that was given to the host.
$HOSTPROBLEMID$$HOSTPROBLEMID$ A globally unique UUIDv4 (e.g. 29304481-91eb-4a2f-8b6d-8858b4548741) associated with the host's current problem state. Every time a host (or service) transitions from an UP or OK state to a problem state, a global problem UUID is generated. This macro will be a UUID string if the host is currently a non-UP state. State transitions between non-UP states (e.g. DOWN to UNREACHABLE) do not cause this problem id to change. If the host is currently in an UP state, this macro will be set to an empty string. Combined with event handlers, this macro could be used to automatically open trouble tickets when hosts first enter a problem state.
$LASTHOSTPROBLEMID$$LASTHOSTPROBLEMID$ The previous (globally unique) problem UUID that was given to the host. Combined with event handlers, this macro could be used for automatically closing trouble tickets, etc. when a host recovers to an UP state.
$HOSTLATENCY$$HOSTLATENCY$ A (floating point) number indicating the number of seconds that a scheduled host check lagged behind its scheduled check time. For instance, if a check was scheduled for 03:14:15 and it didn't get executed until 03:14:17, there would be a check latency of 2.0 seconds. On-demand host checks have a latency of zero seconds.
$HOSTEXECUTIONTIME$$HOSTEXECUTIONTIME$ A (floating point) number indicating the number of seconds that the host check took to execute (i.e. the amount of time the check was executing).
$HOSTDURATION$$HOSTDURATION$ A string indicating the amount of time that the host has spent in its current state. Format is "XXh YYm ZZs", indicating hours, minutes and seconds.
$HOSTDURATIONSEC$$HOSTDURATIONSEC$ A number indicating the number of seconds that the host has spent in its current state.
$HOSTDOWNTIME$$HOSTDOWNTIME$ A number indicating the current "downtime depth" for the host. If this host is currently in a period of scheduled downtime, the value will be greater than zero. If the host is not currently in a period of downtime, this value will be zero.
$HOSTPERCENTCHANGE$$HOSTPERCENTCHANGE$ A (floating point) number indicating the percent state change the host has undergone. Percent state change is used by the flap detection algorithm.
$HOSTGROUPNAME$$HOSTGROUPNAME$ The short name of the hostgroup that this host belongs to. This value is taken from the hostgroup_name directive in the hostgroup definition. If the host belongs to more than one hostgroup this macro will contain the name of just one of them.
$HOSTGROUPNAMES$$HOSTGROUPNAMES$ A comma separated list of the short names of all the hostgroups that this host belongs to.
$LASTHOSTCHECK$$LASTHOSTCHECK$ This is a timestamp in time_t format (seconds since the UNIX epoch) indicating the time at which a check of the host was last performed.
$LASTHOSTSTATECHANGE$$LASTHOSTSTATECHANGE$ This is a timestamp in time_t format (seconds since the UNIX epoch) indicating the time the host last changed state.
$LASTHOSTUP$$LASTHOSTUP$ This is a timestamp in time_t format (seconds since the UNIX epoch) indicating the time at which the host was last detected as being in an UP state.
$LASTHOSTDOWN$$LASTHOSTDOWN$ This is a timestamp in time_t format (seconds since the UNIX epoch) indicating the time at which the host was last detected as being in a DOWN state.
$LASTHOSTUNREACHABLE$$LASTHOSTUNREACHABLE$ This is a timestamp in time_t format (seconds since the UNIX epoch) indicating the time at which the host was last detected as being in an UNREACHABLE state.
$HOSTOUTPUT$$HOSTOUTPUT$ The first line of text output from the last host check (i.e. "Ping OK").
$LONGHOSTOUTPUT$$LONGHOSTOUTPUT$ The full text output (aside from the first line) from the last host check.
$HOSTPERFDATA$$HOSTPERFDATA$ This macro contains any performance data that may have been returned by the last host check.
$HOSTCHECKCOMMAND$$HOSTCHECKCOMMAND$ This macro contains the name of the command (along with any arguments passed to it) used to perform the host check.
$HOSTACKAUTHOR$ 8$HOSTACKAUTHOR$ 8 A string containing the name of the user who acknowledged the host problem. This macro is only valid in notifications where the $NOTIFICATIONTYPE$ macro is set to "ACKNOWLEDGEMENT".
$HOSTACKAUTHORNAME$ 8$HOSTACKAUTHORNAME$ 8 A string containing the short name of the contact (if applicable) who acknowledged the host problem. This macro is only valid in notifications where the $NOTIFICATIONTYPE$ macro is set to "ACKNOWLEDGEMENT".
$HOSTACKAUTHORALIAS$ 8$HOSTACKAUTHORALIAS$ 8 A string containing the alias of the contact (if applicable) who acknowledged the host problem. This macro is only valid in notifications where the $NOTIFICATIONTYPE$ macro is set to "ACKNOWLEDGEMENT".
$HOSTACKCOMMENT$ 8$HOSTACKCOMMENT$ 8 A string containing the acknowledgement comment that was entered by the user who acknowledged the host problem. This macro is only valid in notifications where the $NOTIFICATIONTYPE$ macro is set to "ACKNOWLEDGEMENT".
$HOSTACTIONURL$$HOSTACTIONURL$ Action URL for the host. This macro may contain other macros (e.g. $HOSTNAME$), which can be useful when you want to pass the host name to a web page.
$HOSTNOTESURL$$HOSTNOTESURL$ Notes URL for the host. This macro may contain other macros (e.g. $HOSTNAME$), which can be useful when you want to pass the host name to a web page.
$HOSTNOTES$$HOSTNOTES$ Notes for the host. This macro may contain other macros (e.g. $HOSTNAME$), which can be useful when you want to host-specific status information, etc. in the description.
$TOTALHOSTSERVICES$$TOTALHOSTSERVICES$ The total number of services associated with the host.
$TOTALHOSTSERVICESOK$$TOTALHOSTSERVICESOK$ The total number of services associated with the host that are in an OK state.
$TOTALHOSTSERVICESWARNING$$TOTALHOSTSERVICESWARNING$ The total number of services associated with the host that are in a WARNING state.
$TOTALHOSTSERVICESUNKNOWN$$TOTALHOSTSERVICESUNKNOWN$ The total number of services associated with the host that are in an UNKNOWN state.
$TOTALHOSTSERVICESCRITICAL$$TOTALHOSTSERVICESCRITICAL$ The total number of services associated with the host that are in a CRITICAL state.
$HOSTPROBLEMSTART$$HOSTPROBLEMSTART$ This is a timestamp in time_t format (seconds since the UNIX epoch) indicating the time at which the host state changed into a non-Up state.
$HOSTPROBLEMEND$$HOSTPROBLEMEND$ This is a timestamp in time_t format (seconds since the UNIX epoch) indicating the time at which the host state changed changed back into Up state.
$HOSTPROBLEMDURATIONSEC$$HOSTPROBLEMDURATIONSEC$ The duration in seconds between $HOSTPROBLEMSTART$ and $HOSTPROBLEMEND$.
$HOSTPROBLEMDURATION$$HOSTPROBLEMDURATION$ The duration between $HOSTPROBLEMSTART$ and $HOSTPROBLEMEND$ in a human readable format e.g.: 1d 10h 8m 35s

Host Group Macros: 5Host Group Macros: 5
$HOSTGROUPALIAS$ 5$HOSTGROUPALIAS$ 5 The long name / alias of either 1) the hostgroup name passed as an on-demand macro argument or 2) the primary hostgroup associated with the current host (if not used in the context of an on-demand macro). This value is taken from the alias directive in the hostgroup definition.
$HOSTGROUPMEMBERS$ 5$HOSTGROUPMEMBERS$ 5 A comma-separated list of all hosts that belong to either 1) the hostgroup name passed as an on-demand macro argument or 2) the primary hostgroup associated with the current host (if not used in the context of an on-demand macro).
$HOSTGROUPNOTES$ 5$HOSTGROUPNOTES$ 5 The notes associated with either 1) the hostgroup name passed as an on-demand macro argument or 2) the primary hostgroup associated with the current host (if not used in the context of an on-demand macro). This value is taken from the notes directive in the hostgroup definition.
$HOSTGROUPNOTESURL$ 5$HOSTGROUPNOTESURL$ 5 The notes URL associated with either 1) the hostgroup name passed as an on-demand macro argument or 2) the primary hostgroup associated with the current host (if not used in the context of an on-demand macro). This value is taken from the notes_url directive in the hostgroup definition.
$HOSTGROUPACTIONURL$ 5$HOSTGROUPACTIONURL$ 5 The action URL associated with either 1) the hostgroup name passed as an on-demand macro argument or 2) the primary hostgroup associated with the current host (if not used in the context of an on-demand macro). This value is taken from the action_url directive in the hostgroup definition.

Service Macros:Service Macros:
$SERVICEDESC$$SERVICEDESC$ The long name/description of the service (i.e. "Main Website"). This value is taken from the service_description directive of the service definition.
$SERVICEDISPLAYNAME$$SERVICEDISPLAYNAME$ An alternate display name for the service. This value is taken from the display_name directive in the service definition.
$SERVICESTATE$$SERVICESTATE$ A string indicating the current state of the service ("OK", "WARNING", "UNKNOWN", or "CRITICAL").
$SERVICESTATEID$$SERVICESTATEID$ A number that corresponds to the current state of the service: 0=OK, 1=WARNING, 2=CRITICAL, 3=UNKNOWN.
$LASTSERVICESTATE$$LASTSERVICESTATE$ A string indicating the last state of the service ("OK", "WARNING", "UNKNOWN", or "CRITICAL").
$LASTSERVICESTATEID$$LASTSERVICESTATEID$ A number that corresponds to the last state of the service: 0=OK, 1=WARNING, 2=CRITICAL, 3=UNKNOWN.
$SERVICESTATETYPE$$SERVICESTATETYPE$ A string indicating the state type for the current service check ("HARD" or "SOFT"). Soft states occur when service checks return a non-OK state and are in the process of being retried. Hard states result when service checks have been checked a specified maximum number of times.
$SERVICEATTEMPT$$SERVICEATTEMPT$ The number of the current service check retry. For instance, if this is the second time that the service is being rechecked, this will be the number two. Current attempt number is really only useful when writing service event handlers for "soft" states that take a specific action based on the service retry number.
$MAXSERVICEATTEMPTS$$MAXSERVICEATTEMPTS$ The max check attempts as defined for the current service. Useful when writing host event handlers for "soft" states that take a specific action based on the service retry number.
$SERVICEISVOLATILE$$SERVICEISVOLATILE$ Indicates whether the service is marked as being volatile or not: 0 = not volatile, 1 = volatile.
$SERVICEEVENTID$$SERVICEEVENTID$ A globally unique number associated with the service's current state. Every time a a service (or host) experiences a state change, a global event ID number is incremented by one (1). If a service has experienced no state changes, this macro will be set to zero (0).
$LASTSERVICEEVENTID$$LASTSERVICEEVENTID$ The previous (globally unique) event number that given to the service.
$SERVICEPROBLEMID$$SERVICEPROBLEMID$ A globally unique UUIDv4 (e.g. 39dbb346-f483-49fe-8211-feec8edf90ea) associated with the service's current problem state. Every time a service (or host) transitions from an OK or UP state to a problem state, a global problem UUID is generated. This macro will be a UUID if the service is currently a non-OK state. State transitions between non-OK states (e.g. WARNING to CRITICAL) do not cause this problem id to change. If the service is currently in an OK state, this macro will be set to an empty string. Combined with event handlers, this macro could be used to automatically open trouble tickets when services first enter a problem state.
$LASTSERVICEPROBLEMID$$LASTSERVICEPROBLEMID$ The previous (globally unique) problem UUID that was given to the service. Combined with event handlers, this macro could be used for automatically closing trouble tickets, etc. when a service recovers to an OK state.
$SERVICELATENCY$$SERVICELATENCY$ A (floating point) number indicating the number of seconds that a scheduled service check lagged behind its scheduled check time. For instance, if a check was scheduled for 03:14:15 and it didn't get executed until 03:14:17, there would be a check latency of 2.0 seconds.
$SERVICEEXECUTIONTIME$$SERVICEEXECUTIONTIME$ A (floating point) number indicating the number of seconds that the service check took to execute (i.e. the amount of time the check was executing).
$SERVICEDURATION$$SERVICEDURATION$ A string indicating the amount of time that the service has spent in its current state. Format is "XXh YYm ZZs", indicating hours, minutes and seconds.
$SERVICEDURATIONSEC$$SERVICEDURATIONSEC$ A number indicating the number of seconds that the service has spent in its current state.
$SERVICEDOWNTIME$$SERVICEDOWNTIME$ A number indicating the current "downtime depth" for the service. If this service is currently in a period of scheduled downtime, the value will be greater than zero. If the service is not currently in a period of downtime, this value will be zero.
$SERVICEPERCENTCHANGE$$SERVICEPERCENTCHANGE$ A (floating point) number indicating the percent state change the service has undergone. Percent state change is used by the flap detection algorithm.
$SERVICEGROUPNAME$$SERVICEGROUPNAME$ The short name of the servicegroup that this service belongs to. This value is taken from the servicegroup_name directive in the servicegroup definition. If the service belongs to more than one servicegroup this macro will contain the name of just one of them.
$SERVICEGROUPNAMES$$SERVICEGROUPNAMES$ A comma separated list of the short names of all the servicegroups that this service belongs to.
$LASTSERVICECHECK$$LASTSERVICECHECK$ This is a timestamp in time_t format (seconds since the UNIX epoch) indicating the time at which a check of the service was last performed.
$LASTSERVICESTATECHANGE$$LASTSERVICESTATECHANGE$ This is a timestamp in time_t format (seconds since the UNIX epoch) indicating the time the service last changed state.
$LASTSERVICEOK$$LASTSERVICEOK$ This is a timestamp in time_t format (seconds since the UNIX epoch) indicating the time at which the service was last detected as being in an OK state.
$LASTSERVICEWARNING$$LASTSERVICEWARNING$ This is a timestamp in time_t format (seconds since the UNIX epoch) indicating the time at which the service was last detected as being in a WARNING state.
$LASTSERVICEUNKNOWN$$LASTSERVICEUNKNOWN$ This is a timestamp in time_t format (seconds since the UNIX epoch) indicating the time at which the service was last detected as being in an UNKNOWN state.
$LASTSERVICECRITICAL$$LASTSERVICECRITICAL$ This is a timestamp in time_t format (seconds since the UNIX epoch) indicating the time at which the service was last detected as being in a CRITICAL state.
$SERVICEOUTPUT$$SERVICEOUTPUT$ The first line of text output from the last service check (i.e. "Ping OK").
$LONGSERVICEOUTPUT$$LONGSERVICEOUTPUT$ The full text output (aside from the first line) from the last service check.
$SERVICEPERFDATA$$SERVICEPERFDATA$ This macro contains any performance data that may have been returned by the last service check.
$SERVICECHECKCOMMAND$$SERVICECHECKCOMMAND$ This macro contains the name of the command (along with any arguments passed to it) used to perform the service check.
$SERVICEACKAUTHOR$ 8$SERVICEACKAUTHOR$ 8 A string containing the name of the user who acknowledged the service problem. This macro is only valid in notifications where the $NOTIFICATIONTYPE$ macro is set to "ACKNOWLEDGEMENT".
$SERVICEACKAUTHORNAME$ 8$SERVICEACKAUTHORNAME$ 8 A string containing the short name of the contact (if applicable) who acknowledged the service problem. This macro is only valid in notifications where the $NOTIFICATIONTYPE$ macro is set to "ACKNOWLEDGEMENT".
$SERVICEACKAUTHORALIAS$ 8$SERVICEACKAUTHORALIAS$ 8 A string containing the alias of the contact (if applicable) who acknowledged the service problem. This macro is only valid in notifications where the $NOTIFICATIONTYPE$ macro is set to "ACKNOWLEDGEMENT".
$SERVICEACKCOMMENT$ 8$SERVICEACKCOMMENT$ 8 A string containing the acknowledgement comment that was entered by the user who acknowledged the service problem. This macro is only valid in notifications where the $NOTIFICATIONTYPE$ macro is set to "ACKNOWLEDGEMENT".
$SERVICEACTIONURL$$SERVICEACTIONURL$ Action URL for the service. This macro may contain other macros (e.g. $HOSTNAME$ or $SERVICEDESC$), which can be useful when you want to pass the service name to a web page.
$SERVICENOTESURL$$SERVICENOTESURL$ Notes URL for the service. This macro may contain other macros (e.g. $HOSTNAME$ or $SERVICEDESC$), which can be useful when you want to pass the service name to a web page.
$SERVICENOTES$$SERVICENOTES$ Notes for the service. This macro may contain other macros (e.g. $HOSTNAME$ or $SERVICESTATE$), which can be useful when you want to service-specific status information, etc. in the description
$SERVICEPROBLEMSTART$$SERVICEPROBLEMSTART$ This is a timestamp in time_t format (seconds since the UNIX epoch) indicating the time at which the service state changed into a non-Ok state.
$SERVICEPROBLEMEND$$SERVICEPROBLEMEND$ This is a timestamp in time_t format (seconds since the UNIX epoch) indicating the time at which the service state changed changed back into Ok state.
$SERVICEPROBLEMDURATIONSEC$$SERVICEPROBLEMDURATIONSEC$ The duration in seconds between $SERVICEPROBLEMSTART$ and $SERVICEPROBLEMEND$.
$SERVICEPROBLEMDURATION$$SERVICEPROBLEMDURATION$ The duration between $SERVICEPROBLEMSTART$ and $SERVICEPROBLEMEND$ in a human readable format e.g.: 1d 10h 8m 35s

Service Group Macros: 6Service Group Macros: 6
$SERVICEGROUPALIAS$ 6$SERVICEGROUPALIAS$ 6 The long name / alias of either 1) the servicegroup name passed as an on-demand macro argument or 2) the primary servicegroup associated with the current service (if not used in the context of an on-demand macro). This value is taken from the alias directive in the servicegroup definition.
$SERVICEGROUPMEMBERS$ 6$SERVICEGROUPMEMBERS$ 6 A comma-separated list of all services that belong to either 1) the servicegroup name passed as an on-demand macro argument or 2) the primary servicegroup associated with the current service (if not used in the context of an on-demand macro).
$SERVICEGROUPNOTES$ 6$SERVICEGROUPNOTES$ 6 The notes associated with either 1) the servicegroup name passed as an on-demand macro argument or 2) the primary servicegroup associated with the current service (if not used in the context of an on-demand macro). This value is taken from the notes directive in the servicegroup definition.
$SERVICEGROUPNOTESURL$ 6$SERVICEGROUPNOTESURL$ 6 The notes URL associated with either 1) the servicegroup name passed as an on-demand macro argument or 2) the primary servicegroup associated with the current service (if not used in the context of an on-demand macro). This value is taken from the notes_url directive in the servicegroup definition.
$SERVICEGROUPNOTES$ 6$SERVICEGROUPNOTES$ 6 The action URL associated with either 1) the servicegroup name passed as an on-demand macro argument or 2) the primary servicegroup associated with the current service (if not used in the context of an on-demand macro). This value is taken from the action_url directive in the servicegroup definition.

Contact Macros:Contact Macros:
$CONTACTNAME$$CONTACTNAME$ Short name for the contact (i.e. "jdoe") that is being notified of a host or service problem. This value is taken from the contact_name directive in the contact definition.
$CONTACTALIAS$$CONTACTALIAS$ Long name/description for the contact (i.e. "John Doe") being notified. This value is taken from the alias directive in the contact definition.
$CONTACTEMAIL$$CONTACTEMAIL$ Email address of the contact being notified. This value is taken from the email directive in the contact definition.
$CONTACTPAGER$$CONTACTPAGER$ Pager number/address of the contact being notified. This value is taken from the pager directive in the contact definition.
$CONTACTADDRESSn$$CONTACTADDRESSn$ Address of the contact being notified. Each contact can have six different addresses (in addition to email address and pager number). The macros for these addresses are $CONTACTADDRESS1$ - $CONTACTADDRESS6$. This value is taken from the addressx directive in the contact definition.
$CONTACTGROUPNAME$$CONTACTGROUPNAME$ The short name of the contactgroup that this contact is a member of. This value is taken from the contactgroup_name directive in the contactgroup definition. If the contact belongs to more than one contactgroup this macro will contain the name of just one of them.
$CONTACTGROUPNAMES$$CONTACTGROUPNAMES$ A comma separated list of the short names of all the contactgroups that this contact is a member of.

Contact Group Macros: 5Contact Group Macros: 5
$CONTACTGROUPALIAS$ 7$CONTACTGROUPALIAS$ 7 The long name / alias of either 1) the contactgroup name passed as an on-demand macro argument or 2) the primary contactgroup associated with the current contact (if not used in the context of an on-demand macro). This value is taken from the alias directive in the contactgroup definition.
$CONTACTGROUPMEMBERS$ 7$CONTACTGROUPMEMBERS$ 7 A comma-separated list of all contacts that belong to either 1) the contactgroup name passed as an on-demand macro argument or 2) the primary contactgroup associated with the current contact (if not used in the context of an on-demand macro).

SUMMARY Macros:SUMMARY Macros:
$TOTALHOSTSUP$$TOTALHOSTSUP$ This macro reflects the total number of hosts that are currently in an UP state.
$TOTALHOSTSDOWN$$TOTALHOSTSDOWN$ This macro reflects the total number of hosts that are currently in a DOWN state.
$TOTALHOSTSUNREACHABLE$$TOTALHOSTSUNREACHABLE$ This macro reflects the total number of hosts that are currently in an UNREACHABLE state.
$TOTALHOSTSDOWNUNHANDLED$$TOTALHOSTSDOWNUNHANDLED$ This macro reflects the total number of hosts that are currently in a DOWN state that are not currently being "handled". Unhandled host problems are those that are not acknowledged, are not currently in scheduled downtime, and for which checks are currently enabled.
$TOTALHOSTSUNREACHABLEUNHANDLED$$TOTALHOSTSUNREACHABLEUNHANDLED$ This macro reflects the total number of hosts that are currently in an UNREACHABLE state that are not currently being "handled". Unhandled host problems are those that are not acknowledged, are not currently in scheduled downtime, and for which checks are currently enabled.
$TOTALHOSTPROBLEMS$$TOTALHOSTPROBLEMS$ This macro reflects the total number of hosts that are currently either in a DOWN or an UNREACHABLE state.
$TOTALHOSTPROBLEMSUNHANDLED$$TOTALHOSTPROBLEMSUNHANDLED$ This macro reflects the total number of hosts that are currently either in a DOWN or an UNREACHABLE state that are not currently being "handled". Unhandled host problems are those that are not acknowledged, are not currently in scheduled downtime, and for which checks are currently enabled.
$TOTALSERVICESOK$$TOTALSERVICESOK$ This macro reflects the total number of services that are currently in an OK state.
$TOTALSERVICESWARNING$$TOTALSERVICESWARNING$ This macro reflects the total number of services that are currently in a WARNING state.
$TOTALSERVICESCRITICAL$$TOTALSERVICESCRITICAL$ This macro reflects the total number of services that are currently in a CRITICAL state.
$TOTALSERVICESUNKNOWN$$TOTALSERVICESUNKNOWN$ This macro reflects the total number of services that are currently in an UNKNOWN state.
$TOTALSERVICESWARNINGUNHANDLED$$TOTALSERVICESWARNINGUNHANDLED$ This macro reflects the total number of services that are currently in a WARNING state that are not currently being "handled". Unhandled services problems are those that are not acknowledged, are not currently in scheduled downtime, and for which checks are currently enabled.
$TOTALSERVICESCRITICALUNHANDLED$$TOTALSERVICESCRITICALUNHANDLED$ This macro reflects the total number of services that are currently in a CRITICAL state that are not currently being "handled". Unhandled services problems are those that are not acknowledged, are not currently in scheduled downtime, and for which checks are currently enabled.
$TOTALSERVICESUNKNOWNUNHANDLED$$TOTALSERVICESUNKNOWNUNHANDLED$ This macro reflects the total number of services that are currently in an UNKNOWN state that are not currently being "handled". Unhandled services problems are those that are not acknowledged, are not currently in scheduled downtime, and for which checks are currently enabled.
$TOTALSERVICEPROBLEMS$$TOTALSERVICEPROBLEMS$ This macro reflects the total number of services that are currently either in a WARNING, CRITICAL, or UNKNOWN state.
$TOTALSERVICEPROBLEMSUNHANDLED$$TOTALSERVICEPROBLEMSUNHANDLED$ This macro reflects the total number of services that are currently either in a WARNING, CRITICAL, or UNKNOWN state that are not currently being "handled". Unhandled services problems are those that are not acknowledged, are not currently in scheduled downtime, and for which checks are currently enabled.

Notification Macros:Notification Macros:
$NOTIFICATIONTYPE$$NOTIFICATIONTYPE$ A string identifying the type of notification that is being sent ("PROBLEM", "RECOVERY", "ACKNOWLEDGEMENT", "FLAPPINGSTART", "FLAPPINGSTOP", "FLAPPINGDISABLED", "DOWNTIMESTART", "DOWNTIMEEND", or "DOWNTIMECANCELLED").
$NOTIFICATIONRECIPIENTS$$NOTIFICATIONRECIPIENTS$ A comma-separated list of the short names of all contacts that are being notified about the host or service.
$NOTIFICATIONISESCALATED$$NOTIFICATIONISESCALATED$ An integer indicating whether this was sent to normal contacts for the host or service or if it was escalated. 0 = Normal (non-escalated) notification , 1 = Escalated notification.
$NOTIFICATIONAUTHOR$$NOTIFICATIONAUTHOR$ A string containing the name of the user who authored the notification. If the $NOTIFICATIONTYPE$ macro is set to "DOWNTIMESTART" or "DOWNTIMEEND", this will be the name of the user who scheduled downtime for the host or service. If the $NOTIFICATIONTYPE$ macro is "ACKNOWLEDGEMENT", this will be the name of the user who acknowledged the host or service problem. If the $NOTIFICATIONTYPE$ macro is "CUSTOM", this will be name of the user who initiated the custom host or service notification.
$NOTIFICATIONAUTHORNAME$$NOTIFICATIONAUTHORNAME$ A string containing the short name of the contact (if applicable) specified in the $NOTIFICATIONAUTHOR$ macro.
$NOTIFICATIONAUTHORALIAS$$NOTIFICATIONAUTHORALIAS$ A string containing the alias of the contact (if applicable) specified in the $NOTIFICATIONAUTHOR$ macro.
$NOTIFICATIONCOMMENT$$NOTIFICATIONCOMMENT$ A string containing the comment that was entered by the notification author. If the $NOTIFICATIONTYPE$ macro is set to "DOWNTIMESTART" or "DOWNTIMEEND", this will be the comment entered by the user who scheduled downtime for the host or service. If the $NOTIFICATIONTYPE$ macro is "ACKNOWLEDGEMENT", this will be the comment entered by the user who acknowledged the host or service problem. If the $NOTIFICATIONTYPE$ macro is "CUSTOM", this will be comment entered by the user who initiated the custom host or service notification.
$HOSTNOTIFICATIONNUMBER$$HOSTNOTIFICATIONNUMBER$ The current notification number for the host. The notification number increases by one (1) each time a new notification is sent out for the host (except for acknowledgements). The notification number is reset to 0 when the host recovers (after the recovery notification has gone out). acknowledgements do not cause the notification number to increase, nor do notifications dealing with flap detection or scheduled downtime.
$HOSTNOTIFICATIONID$$HOSTNOTIFICATIONID$ A unique UUIDv4 (e.g. 3a07d4f2-575e-413b-8166-9ccdd22d418a) identifying a host notification. Notification UUID strings are unique across both hosts and service notifications, so you could potentially use this unique string as a primary key in a notification database. Notification UUIDs should remain unique across restarts of the Naemon process, so long as you have state retention enabled. The notification UUID is generated each time a new host notification is sent out, and the same regardless of how many contacts are notified.
$SERVICENOTIFICATIONNUMBER$$SERVICENOTIFICATIONNUMBER$ The current notification number for the service. The notification number increases by one (1) each time a new notification is sent out for the service (except for acknowledgements). The notification number is reset to 0 when the service recovers (after the recovery notification has gone out). acknowledgements do not cause the notification number to increase, nor do notifications dealing with flap detection or scheduled downtime.
$SERVICENOTIFICATIONID$$SERVICENOTIFICATIONID$ A unique UUIDv4 (e.g. cebd5487-538f-4f5b-87cc-8e18b4e2170c) identifying a service notification. Notification UUID strings are unique across both hosts and service notifications, so you could potentially use this unique string as a primary key in a notification database. Notification UUIDs should remain unique across restarts of the Naemon process, so long as you have state retention enabled. The notification UUID is generated each time a new service notification is sent out, and the same regardless of how many contacts are notified.

Date/Time Macros:Date/Time Macros:
$LONGDATETIME$$LONGDATETIME$ Current date/time stamp (i.e. Fri Oct 13 00:30:28 CDT 2000). Format of date is determined by date_format directive.
$SHORTDATETIME$$SHORTDATETIME$ Current date/time stamp (i.e. 10-13-2000 00:30:28). Format of date is determined by date_format directive.
$DATE$$DATE$ Date stamp (i.e. 10-13-2000). Format of date is determined by date_format directive.
$TIME$$TIME$ Current time stamp (i.e. 00:30:28).
$TIMET$$TIMET$ Current time stamp in time_t format (seconds since the UNIX epoch).
$ISVALIDTIME:$ 9$ISVALIDTIME:$ 9

This is a special on-demand macro that returns a 1 or 0 depending on whether or not a particular time is valid within a specified timeperiod. There are two ways of using this macro: @@ -1479,7 +1487,7 @@ This is a special on-demand macro that returns a 1 or 0 depending on whether or

$NEXTVALIDTIME:$ 9$NEXTVALIDTIME:$ 9

This is a special on-demand macro that returns the next valid time (in time_t format) for a specified timeperiod. There are two ways of using this macro: @@ -1495,131 +1503,132 @@ If a next valid time cannot be found in the specified timeperiod, the macro will


File Macros:File Macros:
$MAINCONFIGFILE$$MAINCONFIGFILE$ The location of the main config file.
$STATUSDATAFILE$$STATUSDATAFILE$ The location of the status data file.
$COMMENTDATAFILE$$COMMENTDATAFILE$ The location of the comment data file.
$DOWNTIMEDATAFILE$$DOWNTIMEDATAFILE$ The location of the downtime data file.
$RETENTIONDATAFILE$$RETENTIONDATAFILE$ The location of the retention data file.
$OBJECTCACHEFILE$$OBJECTCACHEFILE$ The location of the object cache file.
$TEMPFILE$$TEMPFILE$ The location of the temp file.
$TEMPPATH$$TEMPPATH$ The directory specified by the temp path variable.
$LOGFILE$$LOGFILE$ The location of the log file.
$RESOURCEFILE$$RESOURCEFILE$ The location of the resource file.
$COMMANDFILE$$COMMANDFILE$ The location of the command file.
$HOSTPERFDATAFILE$$HOSTPERFDATAFILE$ The location of the host performance data file (if defined).
$SERVICEPERFDATAFILE$$SERVICEPERFDATAFILE$ The location of the service performance data file (if defined).

Misc Macros:Misc Macros:
$PROCESSSTARTTIME$$PROCESSSTARTTIME$ Time stamp in time_t format (seconds since the UNIX epoch) indicating when the Naemon process was last (re)started. You can determine the number of seconds that Naemon has been running (since it was last restarted) by subtracting $PROCESSSTARTTIME$ from $TIMET$.
$EVENTSTARTTIME$$EVENTSTARTTIME$ Time stamp in time_t format (seconds since the UNIX epoch) indicating when the Naemon process starting process events (checks, etc.). You can determine the number of seconds that it took for Naemon to startup by subtracting $PROCESSSTARTTIME$ from $EVENTSTARTTIME$.
$ADMINEMAIL$$ADMINEMAIL$ Global administrative email address. This value is taken from the admin_email directive.
$ADMINPAGER$$ADMINPAGER$ Global administrative pager number/address. This value is taken from the admin_pager directive.
$ARGn$$ARGn$ The nth argument passed to the command (notification, event handler, service check, etc.). Naemon supports up to 32 argument macros ($ARG1$ through $ARG32$).
$USERn$$USERn$ The nth user-definable macro. User macros can be defined in one or more resource files. Naemon supports up to 256 user macros ($USER1$ through $USER256$).
+ +## Notes -### Notes - - +

1 These macros are not valid for the host they are associated with when that host is being checked (i.e. they make no sense, as they haven't been determined yet).

- +

2 These macros are not valid for the service they are associated with when that service is being checked (i.e. they make no sense, as they haven't been determined yet).

- +

3 When host macros are used in service-related commands (i.e. service notifications, event handlers, etc) they refer to they host that they service is associated with.

- +

4 When host and service summary macros are used in notification commands, the totals are filtered to reflect only those hosts and services for which the contact is authorized (i.e. hosts and services they are configured to receive notifications for).

- +

5 These macros are normally associated with the first/primary hostgroup associated with the current host. They could therefore be considered host macros in many cases. However, these macros are not available as on-demand host macros. Instead, they can be used as on-demand hostgroup macros when you pass the name of a hostgroup to the macro. For example: $HOSTGROUPMEMBERS:hg1$ would return a comma-delimited list of all (host) members of the hostgroup hg1.

- +

6 These macros are normally associated with the first/primary servicegroup associated with the current service. They could therefore be considered service macros in many cases. However, these macros are not available as on-demand service macros. Instead, they can be used as on-demand servicegroup macros when you pass the name of a servicegroup to the macro. For example: $SERVICEGROUPMEMBERS:sg1$ would return a comma-delimited list of all (service) members of the servicegroup sg1.

- +

7 These macros are normally associated with the first/primary contactgroup associated with the current contact. They could therefore be considered contact macros in many cases. However, these macros are not available as on-demand contact macros. Instead, they can be used as on-demand contactgroup macros when you pass the name of a contactgroup to the macro. For example: $CONTACTGROUPMEMBERS:cg1$ would return a comma-delimited list of all (contact) members of the contactgroup cg1.

- +

8 These acknowledgement macros are deprecated. Use the more generic $NOTIFICATIONAUTHOR$, $NOTIFICATIONAUTHORNAME$, $NOTIFICATIONAUTHORALIAS$ or $NOTIFICATIONAUTHORCOMMENT$ macros instead.

- +

9 These macro are only available as on-demand macros - e.g. you must supply an additional argument with them in order to use them. These macros are not available as environment variables.

- +

10 Summary macros are quite CPU-intensive to calculate.