4.3. SANET built-in expression symbols

The SNMP Expression language is used by SANET to perform nodes' monitoring.

4.3.1. SNMP Expression values

The SNMP subexpression evaluation (es: 1.3.6.1.2.1.1.1.0@ ) is lazy.

This means that the value is retrieved from the network only when an effective manipulation of the value is required (comparisons, arithmetical operations and so on).

4.3.2. Execution context

When SANET performs an expression evaluation, the expression is executed with a set of variabiles called execution context.

Datagroups' parameters are converted into variables and stored in the execution context.

Depending to the object related to the expression (node/iface/storage and datasource or condition the execution context exports several built-in variables.

Note

'lazy' values are calculated at the right momement they are used inside an expression. This means an error could be raised (if these value can not be calculated) only if you use these symbols.

4.3.2.1. Common Built-in variables

Variable

Description

$name

Sanet name of the current monitored element

$timeout

Default timeout used when monitoring the node.

4.3.2.2. Elements symbols

4.3.2.2.1. Built-in node's variables

Variable

Description

$nodename

Node name

$ipversion

IP version used (4 o 6). (depends from node's IPv4/IPv6 flag)

$community

SNMP community

$snmpversion

SNMP version

$snmpport

SNMP UDP port

$dnsname

Configured DNS name

$dns6name

Configured DNS name

$ip4mgt

Configured IPv4 address

$ip6mgt

Configured IPv6 address

$node

The effective name or ip4mgt/ip5mgt address used while monitoring the node. (depends from node's IPv4/IPv6 flag)

The value of $node is calculated in this way:

if  $ipversion = 4 then
        $node = $ip4mgt or $dnsname  or $nodename
else
        $node = $ip6mgt or $dns6name or $nodename

Special symbols:

Variable

Description

$node_effective_ip

The IP Sanet is configured to use for the node or the first resolved IP for the node name

4.3.2.2.2. Built-in cluster management variables

When a node belongs to a cluster and it's configured as 'dependent', the following symbols are available.

Always available:

Variable

Description

Lazy

$cluster_distinguisher

Configured distinguisher of the monitored element

$cluster_xform'

Configured xform of the monitored element

Available when the cluster association is valid:

Variable

Description

Lazy

$cluster_instance

The instance calculated with cluster_xform and cluster_distinguisher

$cluster_node

The master holding informations about the node

$cluster_community

Master's snmp community

$cluster_snmpversion

Master's snmp version

$cluster_snmpport

Master's snmp port

4.3.2.2.3. Built-in interface's variables

These variabiles are present only when the basecheck involves a SANET interface.

Variable

Description

$iface

Interface's name

$distinguisher

Interface distinguisher

$instance

alias for $distinguisher

$ifindex

Interface's IfIndex inside the node MIB

$backbone

Interface's backbone flag

$ifspeed

Interface's speed value

4.3.2.2.4. Built-in linked elements

When an interface is part of a link, the execution context exports the symbols of the linked node/interface with the linked_ name prefix :

Variable

Description

$linked_nodename

$nodename of the linked node

$linked_ipversion

$ipversion of the linked node

$linked_community

$community of the linked node

$linked_snmpversion

$snmpversion of the linked node

$linked_dnsname

$dnsname of the linked node

$linked_dns6name

$dns6name of the linked node

$linked_ip4mgt

$ip4mgt of the linked node

$linked_ip6mgt

$ip6mgt of the linked node

$linked_node

$node of the linked node

$linked_snmpport

$snmpport of the linked node

$linked_timeout

$timeout of the linked node

Variable

Description

$linked_iface

$iface of the linked iface

$linked_distinguisher

$distinguisher of the linked iface

$linked_instance

$instance of the linked iface (alias for $linked_distinguisher)

$linked_ifindex

$ifindex of the linked iface

$linked_backbone

$backbone of the linked iface

$linked_ifspeed

$ifspeed of the linked iface

4.3.2.2.5. Built-in storage's variables

Variable

Description

Lazy

$storage

Sanet storage name

$distinguisher

Storage distinguisher

$stindex

The value calculated from storage's distinguisher/xform

4.3.2.2.6. Built-in service's variables

Variable

Description

Lazy

$service

Sanet service name

$distinguisher

Service

$swrunindex

The value calculated from storage's distinguisher/xform

4.3.2.2.7. Built-in device's variables

Variable

Description

Lazy

$device

Sanet device name

$distinguisher

Device distinguisher

$devindex

The value calculated from storage's distinguisher/xform

4.3.2.3. Built-in datagroup's variables

Variable

Description

$shorttries

Configured shorttries

$dgpath

Path of the datagroup executed by the agent

$minperiod

Configured min period of the datagroup executing the expression.

4.3.2.3.1. Built-in datasource's variables

Simple variables:

Variable

Description

$path

Path of the datasource executing the current expression

$delta

Last valid execution time of the datasource (seconds from 1970, UTC)

4.3.2.3.2. Built-in condition's variables

Variable

Description

$path

Path of the condition executing the current expression

$delta

Last valid execution time of the datasource (seconds from 1970, UTC)

4.3.2.3.3. Built-in special symbols

Current/Old values values:

Variable

Description

{name @}

The current value of the name datasource

{name #}

The current value of the name datasource

Execution times:

Variable

Description

{name.checktotaltime @}

The total execution time for the given name datasource/condition.

{name.checktotaltime #}

The total execution time for the given name datasource/condition at the previous check.