Hybrid Indication Policy

This type of Policy allows to periodically trigger any external script, application or internal Java Monitor. It also allows creating Indications based on the produced text output. Nagios® compatible plug-ins are working this way. According to the Nagios® definitions, the output of the Monitor must return a result code that indicates the severity and writes a detailed message and optional performance data to the STDOUT.
This kind of plug-ins is supported by the boom Agent (except the handling of the performance data). Other command line tools, scripts or binaries can also be used as triggers. The Hybrid Policy supports also Java based triggers. Java based triggers must submit an Indication by implementing the exposed interfaces or using the boomindi command supplied with the boom Agent.

The main difference of this Policy is the process work flow. New boom Indications are generated based on the conditions inside the Hybrid Policy. These conditions are filtering the output produced by the trigger similar to the concepts described for the Indication Policies. In contrast to the Indication Policies, only the Conditions of this one Hybrid Policy are used to process the trigger’s output. Also messages coming from other sources than this trigger will be not processed with these Policy conditions.

An Hybrid Policy example that uses a shell script for checking networks printer cartridges

Just to show how this works, we will take the following free plug-in from the Nagios® exchange without any changes. The script expects the parameters Printer IP, SNMP Community and Command. It is easy to create an Action inside the boom GUI to get some test output from the deployed script.

The result output string is conform with the Nagios® requirements and contains information about the toner level for every cartridge:

      OK,Cyan Cartridge HP Q6001A is at 70% OK,Magenta Cartridge HP Q6003A is at 77% \
      OK,Yellow Cartridge HP Q6002A is at 77%\
      | Cyan Cartridge HP Q6001A=70;;470; Magenta Cartridge HP Q6003A=77;;470; \
      Yellow Cartridge HP Q6002A=77;;470;
      

A Simple Hybrid Indication Policy can be created with the following settings:

For every specified polling interval the boom Agent will call the script and process the output.


Filtering and Mapping

The initial severity of the execution is based on the result codes that are defined in the Nagios® Plugin API.

Plugin Return Codeboom SeverityNagios® Service StateNagios® Host State
0normalOKUP
1warningWARNINGUP or DOWN/UNREACHABLE
2criticalCRITICALDOWN/UNREACHABLE
3unknownUNKNOWNDOWN/UNREACHABLE

If the result code is different from the declared code above - the boom Agent assumes that an error occurred during the execution and will produce a warning indication with a detailed status.

Original values of other Indication fields for the NAGIN call type:

FieldValue
ApplicationNAGIN
Indication GroupNAGIN
Objectempty
NodeAgent's hostname

All original values can be changed by specifying the "Overwrite Attributes" section of the condition.

The Call parameters can be defined in a multi-line form. Both notations are identical.

If you use the default Text pattern <*>, the Indication will be delivered as it is. On the other side if you use variables inside the patterns it is easy to construct a new form of text. For example the following pattern:

java=.*,(.*) is at (\d+)%\s+.*,(.*) is at (\d+)%\s+.*,(.*) is at (\d+)%.*
together with Set Text:
Printer cartridges are OK. <$var1>=<$var2>%, <$var3>=<$var4>%, <$var5>=<$var6>%
will create the Indication text:
Printer cartridges are OK. Cyan Cartridge HP Q6001A=70%, \
      Magenta Cartridge HP Q6003A=77%, Yellow Cartridge HP Q6002A=77%
      

Monitoring multiple hosts and objects with one Policy

There is a special possibility for Hybrid Policies with a NAGIN call type. The call field can have a special declaration that allows to declare a list of values:

check_snmp_printer 
<$BOOMMON_NODES(15.124.140.142,15.124.140.143,15.124.140.145)>
public 
<$BOOMMON_OBJECTS(PAPER1,PAPER2)>
	
This kind of notation allows to create multiple calls with different parameters inside the same Policy.
<$BOOMMON_NODES(comma separated list)> defines a list of parameters that must be delivered as a Host value of Indication
<$BOOMMON_OBJECTS(comma separated list)> defines list of parameters that must be delivered as Object value of an Indication.

Multiple entries of the same type (BOOMMON_NODES, BOOMMON_OBJECTS) are not allowed in the call field.

As a result of this call declaration the Agent will trigger the script 6 times:

check_snmp_printer 15.124.140.142 public PAPER1
check_snmp_printer 15.124.140.143 public PAPER1
check_snmp_printer 15.124.140.145 public PAPER1
check_snmp_printer 15.124.140.142 public PAPER2
check_snmp_printer 15.124.140.143 public PAPER2
check_snmp_printer 15.124.140.145 public PAPER2
	
The created Indications will be submitted with the Host and Object values that are used in the call. This enables creation of different conditions for different incoming objects and/or hosts.

The default working directory for triggers is "$BOOM_ROOT/spi/". All binaries and script calls must be specified related to this directory. In case it is necessary to use a binary which is placed in a different location but is available in the systems PATH - use the '#' character as a prefix. i.e. #df, #top.