Macros

Macros are used extensively throughout QueueMonitor. Macros allow you to take some of available properties like message Id, Label, queue name and use it for file name, for queries, etc. Wherever you can use macro there will be small M button, which shows you all macros available for that field. After you click on a macro it will be copied to text field - you don’t have to manually type macros.

All macros are enclosed with curly brackets and therefore specified as {macro_name}.

Standard macros

These macros are available in almost all places where macro can be entered.

{machine_name}
Name of machine where QueueMonitor is running. It’s useful to include machine name in alert emails if you monitor more than one machine.
{task_name}
Name of current task. It’s useful to include it in alert emails, to quickly see which task failed or raised alert.
{q_name}
Name of a queue which is currently processed. When messages come out of file processing and not from a queue, this macro will be empty.

Message based macros

These macros are available in places where individual message is processed. At that point you can use one of available message properties.

{msg_label}
Message’s label.
{msg_id}
Message Id.
{msg_body}
Message Body. Since body is binary, {msg_body} macro has to use encoding to convert it to text. Encoding will either be automatically determined, or specified using “Change body encoding” action.
{msg_destination}
Destination queue for message.

Alert macros

These macros are available when alert is raised. They’ll mostly used to provide more details in emails.

{error}
Error details.
{email_to}
Default email address specified in QueueMonitor’s global settings.
{subject}
Subject used for alert emails.
{details}
Details about alert. Each task can specify different alert details.

Date/time macros

These macros are useful to use for folder and file names. For example, Backup {date} used for folder name will create separate folder for each date when files are saved.

Default formatting can be changed from global settings.

{date}
Current date (yyyy-MM-dd)
{time}
Current time (HH:mm:ss)
{year}
Current year (yyyy). Example: 2015
{month}
Current month, as a number between 1 and 12.
{day}
Current day of month, as a number between 1 and 31.
{hour}
Current hour, 00-23.
{min}
Current minute, 00-59.
{sec}
Current second, 00-59.

Task specific macros

Some tasks offer macros which are specific to that task only. For example, Service check task has {service_name} macro, used in alert emails to identify which service failed.