How can we help?

How do I use variables in alert descriptions?

Follow

When you create alerts, or modify preconfigured alerts, you can include a variable in the alert description. The variable provides more detail about the device or interface that triggered the alert.

Variables must relate to the alert condition

Any variables you set must relate to the alert condition. The variables available for each alert condition are shown in the tables below.

Example

You create an alert with a trigger condition of Device Online Status. Looking at the table below, you can see the variables you can add to the alert description include device make, device model, and device serial number.

Your alert description with variables included looks like this:

A device has recently gone $deviceOnlineStatusString. Device details are: Make $deviceMake, model $deviceModel, and serial number $deviceSerialNumber.

When the alert triggers, you’ll see this message:

A device has recently gone offline. Device details are: Make Cisco, model 2801, and serial number FTX1113W12Y.

If you set a variable that doesn’t relate to the alert condition, it will not return any information.

Example

You create an alert with a trigger condition of Interface Utilization. In the alert description, you include a variable about interface utilization. But you also include a variable about interface packet error count.

Your alert description looks like this:

This interface is at $interfaceUtilization%.0% utilization and the interface packet error counts are $interfaceErrorCount.

Because the packet error count variable doesn’t relate to the interface utilization condition, the result for that variable is null. When the alert triggers, you’ll see this message:

This interface is at 50% utilization and the interface packet error counts are .

How to enter variables

When you add a variable to an alert description, you must enter it exactly as shown below. If you enter the variable without the dollar sign, for example, you’ll receive the plain text  of the variable (e.g., deviceOnlineStatusString) rather than the appropriate value (e.g., online) in your alert message.

Percentage-based variables

Percentage-based variables default to a zero decimal place value. You can change the zero decimal place value to two decimal places by changing %.0% to %.2%. Excluding %.0% altogether results in a value with no rounding (e.g., 29.833333333333332).

Date/time-based variables

Date/time-based variables default to the following format: Thu Feb 12 21:37:15 UTC 2015. But you can define the date/time format differently if you prefer. These are the formats that can be used:

  • Date (mm/dd/yy) - %tm/%td/%ty
  • Date (YY-MM-DD) - %tY-%tm-%td
  • 24-hour clock (hh:mm) - %tH:%tM
  • 24-hour clock (hh:mm:ss) - %tH:%tM:%tS
  • 12-hour clock (hh:mm am/pm) - %tI:%tM %Tp
  • 12-hour clock (hh:mm:ss am/pm) - %tI:%tM:%tS %Tp

Enter date/time variables as shown in this example:

The last snapshot taken was on $lastSnapshot%tI:$lastSnapshot%tM:$lastSnapshot%tS $lastSnapshot%Tp at $lastSnapshot%tm/$lastSnapshot%td/$lastSnapshot%ty

Device alert conditions

Condition name

Variable value(s)

Age of the Last Snapshot (Day)

$lastSnapshotAgeInDays day(s)

$vmName

$lastSnapshot

$snapshotSize GB

Auvik Collector Approval Status

$collectorApprovalStatusString

Auvik collector offline duration

$virtualApplianceOfflineDuration minute(s)

Auvik collector online status

$collectorConnectionStatusString

CPU Utilization

$cpuUtilization%.0%

Device Online Status

$deviceOnlineStatusString

$deviceMake

$deviceModel

$deviceSerialNumber

Device Storage Utilization

$diskUsagePercent%.0%

Memory Utilization

$memoryUtilization%.0%

Number of Snapshots for this Virtual Machine

$snapshotCount

$vmName

Printer - Input Tray Missing

$inputTrayMissing

$deviceMake

$deviceModel

$deviceSerialNumber

Printer - Low Paper

$lowPaper

$deviceMake

$deviceModel

$deviceSerialNumber

Printer - Out of Paper

$outOfPaper

$deviceMake

$deviceModel

$deviceSerialNumber

Printer - Output Tray Missing

$outputTrayMissing

$deviceMake

$deviceModel

$deviceSerialNumber

Printer - Paper Jammed

$jammed

$deviceMake

$deviceModel

$deviceSerialNumber

Printer - Supply Level (%)

$currentInkPercentage%.0%

$inkName

$deviceMake

$deviceModel

$deviceSerialNumber

Size of All Snapshots

$snapshotSize GB

$vmName

Stack Switch Member Status

$stackMemberStatusString

Stack Switch Port Status

$stackPortStatusString

UPS - Battery Voltage

 $upsBatteryVoltage

UPS - Current Failure Reason

$upsOutputStatusFailReasonString

UPS - Input (Line) Voltage

$upsInputLineVoltage

UPS - Input/Output Status

$upsOutputStatusString

$upsOutputStatusFailReasonString

UPS - Output Voltage

$upsOutputVoltage

UPS - Percent Charged

$upsPercentCharged%.0%

UPS - Replace Battery

$upsBatteryReplaceIndicator

Interface alert conditions

Condition name

Variable value(s)

Interface Admin Status

$interfaceAdminStatus

$ifName

$ifDescription

$deviceName

Interface Online Status

$interfaceOnlineStatusString

$ifName

$ifDescription

$deviceName

Interface Packet Discard Count

$interfaceDiscardCount

$ifName

$deviceName

$ifDescription

Interface Packet Error Count

$interfaceErrorCount

$ifName

$deviceName

$ifDescription

Interface Utilization

$interfaceUtilization%.0%

$ifName

$ifDescription

$deviceName

Rx Broadcast Packet Count

$rxBroadcastPackets

$ifName

$ifDescription

$deviceName

Rx Broadcast Packet Percentage

$rxBroadcastPacketPercentage%.0%

$ifName

$ifDescription

$deviceName

Rx Interface Usage

$rxInterfaceUsage%.0%

$ifName

$ifDescription

$deviceName

Rx Multicast Packet Count

$rxMulticastPackets

$ifName

$ifDescription

$deviceName

Rx Multicast Packet Percentage

$rxMulticastPacketPercentage%.0%

$ifName

$ifDescription

$deviceName

Rx Total Packet Count

$rxTotalPackets

$ifName

$ifDescription

$deviceName

Rx Unicast Packet Count

$rxUnicastPackets

$ifName

$ifDescription

$deviceName

Rx Unicast Packet Percentage

$rxUnicastPacketPercentage%.0%

$ifName

$ifDescription

$deviceName

Total Broadcast Packet Percentage

$txBroadcastPacketPercentage%.0%

$ifName

$ifDescription

$deviceName

Total Interface Usage

$interfaceUsage%.0%

$ifName

$ifDescription

$deviceName

Total Multicast Packet Percentage

$totalMutlicastPacketPercentage%.0%

$ifName

$ifDescription

$deviceName

Total Packet Count

$totalPackets

$ifName

$ifDescription

$deviceName

Total Unicast Packet Percentage

$totalUnicastPacketPercentage%.0%

$ifName

$ifDescription

$deviceName

Tx Broadcast Packet Count

$txBroadcastPackets

$ifName

$ifDescription

$deviceName

Tx Broadcast Packet Percentage

$txBroadcastPacketPercentage%.0%

$ifName

$ifDescription

$deviceName

Tx Interface Usage

$interfaceUsage%.0%

$ifName

$ifDescription

$deviceName

Tx Multicast Packet Count

$txMulticastPackets

$ifName

$ifDescription

$deviceName

Tx Multicast Packet Percentage

$txMulticastPacketPercentage%.0%

$ifName

$ifDescription

$deviceName

Tx Total Packet Count

$txTotalPackets

$ifName

$ifDescription

$deviceName

Tx Unicast Packet Count

$txUnicastPackets

$ifName

$ifDescription

$deviceName

Tx Unicast Packet Percentage

$totalBroadcastPacketPercentage%.0%

$ifName

$ifDescription

$deviceName

Service alert conditions

Condition name

Variable value(s)

Service Status

$serviceStatus

$subDomain

Service Status Code

$serviceStatusCode

Service Type

$serviceType

$subDomain

OID monitor setting alert conditions

Unlike device, interface, or service alerts, the trigger conditions for OIDs (object identifiers) appear after you’ve added a new monitor setting. That means the variable is built from the name you give the monitor setting.

The first word in the monitor setting name is always entirely lowercase. Any subsequent words are capitalized on the first letter.

Example:

Monitor setting name: Environmental probe

Variable: $environmentalProbe

If the monitor setting name includes a special character (e.g., hyphen, bracket), these characters are excluded from the variable name.

Example:

Monitor setting name: Last self test result (UPS)

Variable: $lastSelfTestResultUps

Have more questions? Submit a request

Comments

Powered by Zendesk