Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Also notice that 'level' is missing, threshold determines this value.

Changing the alert details

By default NMIS will create a details string using the following template: "$alert->{type} evaluated with $alert->{value} $alert->{unit} as $tresult", for example:

Code Block
tcpCurrEstab test evaluated with 153 as Warning

Starting in NMIS 9.5.2, this detail string is now customizable by using the 'calculate_details' property in the alert definition.  This property can use CVAR expressions like other parts of the alert. The variables that are available to CVAR are:

  1. All data inside the inventory the alert references. For systemHealth sections this means all defined datasets in the sys and rrd sections. If the alert references a dataset in the "system" section all variables from the sys and rrd sections of system are available as well as more properties used for node housekeeping.
  2. All properties of the alert are available (element, unit, event, etc.) listed in examples above.
  3. The previous details calculation which was generated from the template is available in the property current_details.

An example of configuring and utilizing this is as follows (from our net-snmp model):

Code Block
'alerts' => {
 'snmp' => {
   'tcpCurrEstab' => {
     'oid' => 'tcpCurrEstab',
     'title' => 'TCP Established Sessions',
     'alert' => {
      'test' => '$r > 150',
      'event' => 'High TCP Connection Count',
      'calculate_details' => 'CVAR1=tcpCurrEstab;return "$CVAR1 established TCP sessions"',
      'unit' => 'connections',
      'level' => 'Warning'
    }
  },
   'hrSystemProcesses' => {
    'oid' => 'hrSystemProcesses',
    'title' => 'System Processes',
    'alert' => {
     'test' => '$r > 375',
     'event' => 'High Number of System Processes',
     'unit' => 'processes',
     'calculate_details' => 'CVAR1=hrSystemProcesses;return "$CVAR1 system processes"',
     'level' => 'Warning'
    }
   }
  }
 },
},

Now when a High TCP Connection Count event is generated in NMIS, the event details will be shown as (for example):

Code Block
153 established TCP sessions

Similarly the event detail for when a High Number of System Processes event is generated in NMIS:

Code Block
410 system processes