# Understanding Macros and How They Work¶

## Macros¶

One of the main features that make Shinken so flexible is the ability to use macros in command defintions. Macros allow you to reference information from hosts, services, and other sources in your commands.

## Macro Substitution - How Macros Work¶

Before Shinken executes a command, it will replace any macros it finds in the command definition with their corresponding values. This macro substitution occurs for all types of commands that Shinken executes - host and service checks, notifications, event handlers, etc.

Certain macros may themselves contain other macros. These include the “$HOSTNOTES$”, “$HOSTNOTESURL$”, “$HOSTACTIONURL$”, “$SERVICENOTES$”, “$SERVICENOTESURL$”, and “$SERVICEACTIONURL$” macros.

Tip

## Available Macros¶

A list of all the macros that are available in Shinken, as well as a chart of when they can be used, can be found here.

Versions
latest
stable
branch-1.4
2.4.1
2.2
2.0.3
1.4.2