Skip to main content

Custom blackouts

Custom blackout templates can be created using the using the file $PRODUCT_HOME/ /config/custom/customs_periods.cfg

 A custom blackout template is made up of  2 parts:

1.       Custom blackout “macro” definition

2.       Each custom blackout item definition

 Sample:

In the  following sample, a custom blackout named “Blackout on DataCenter” is created. It can be used to set a blackout on all events that have a “site” slot set to a specific value.


  

Custom blackout definition

For each custom blackout, a definition must exist in config/custom/customs_periods.cfg. This main section defines the custom blackout name as a configuration file key (name without space) and will allow the administrator to define

1.       the label for the custom blackout in the console

2.       the list of all slots necessary for period definition

3.       access control (Group based or users based) For multiple values, separator is coma ','

 

The custom definition looks like:

[CustomBlackoutName]
Label=label for this custom blackout in Web Interface
Label-en=label of blackout in Web Interface in EN lang
Label-fr=label of blackout in Web Interface in FR lang
SlotsList= List of slots needed for this custom blackout
AllowedGroups=List of allowed groups
AllowedUsers=List of allowed Users

 

Custom blackout item definition

For each slot of each custom blackout, a definition must exist in config/custom/customs_periods.cfg. This section defines the slot label and details. This section name is defined by the CustomName and slot name using ‘/’ separator.

1.       Label in web interface

2.       Type of shown values for this slot:

a.       Free text using ‘STRING’ key

b.       Combo select for ‘ENUMERATION’ key

3.       DefaultValue for this slot

4.       EnumContent if Type is set to ENUMERATION, the allowed values are offered in this list (comma separator) or external source (file or script based).

a.       When using file: the dropdown list is the file content using an item by line

b.       When using cmd: the dropdown list is the strict file standard output using an item by line (arguments sent to script are EM CellName, Slotname retrieved in configuration, User and Group)

5.       ReadOnly capacity if information should be shown to user in web Interface but not modified

6.       Hidden if slot should not be shown to user

7.       ConditionsList to specify condition to apply on slot. This optional and allows user to reduce or extend capacities

8.       ConditionDefault to specify default condition operator to apply on slot

9.       ConditionHidden to hide Condition applied to user

10.   ConditionReadOnly to show but not allow the condition modification

 

The custom/slot definition looks like:

[ CustomBlackoutName /SlotName]
Label=Slot label in Web Interface
Label-en=Slot label in Web Interface in EN lang
Label-fr=Slot label in Web Interface in FR lang
Type= Kind of data: STRING or ENUMERATION
DefaultValue=Default slot content
ReadOnly=YES or NO
Hidden=YES or NO
EnumContent=List of allowed values for ENUMERATION type. Comma separator or cmd|file:Relative path (external source)
ConditionsList=has_prefix,has_suffix,contains,equals,ip_matches,greater_than,smaller_or_equals, match_regex
ConditionDefault=equals
ConditionHidden=NO
ConditionReadOnly=YES

 

Samples for EnumContent

In this chapter, some samples of EnumContent illustrate how to obtain a list of tools.

EnumContent can use following syntax

  1. cmd or cmd_free:<path to script>
  2. file or file_cree:<path to file to read>
  3. dda or dda_free: <CellName>:<DDAName to query>:<SlotName to query>
  4. evt or evt_free: <CellName>:<DDAName to query>:<SlotName to query>
  5. text or text_free:<value1>:<value2>:…

 

Using “List of allowed values” option

The EnumContent definition can be :

 EnumContent=PATROL,SNMP,SYSLOG,API,AVM

And the result looks like :

 


 

 

Using the “file” option

The EnumContent definition can be :

EnumContent=file:\data\BlackoutMgt\listeTools.txt

 With the following example of txt file content:

PATROL Agent
Nagios
Entuity
Syslog
BPPM

 

And the result looks like :


 

 

Using “cmd” option

The EnumContent definition can be :

EnumContent=cmd:\tools\bin\listeTools.cmd

 With the following example of cmd file content:

@echo off
setlocal ENABLEDELAYEDEXPANSION
set previousLine=
for /f "tokens=* delims= " %%l in ('mquery -n EM -a EVENT -q -s mc_tool ^|sort') do (
if not %%l == !previousLine! (
echo %%l
)
set previousLine=%%l
)

 And the result looks like :


 

 

Advanced menu usage

In case of ‘linked’ informations or menus needed, an advanced cofiguration can be defined. In the configuration below, user will be allow to choose one value for a specific slot and link other values to selected value. This help end users to create a specific Blackout with less knowledge on underlining tools.

Example, in case using PATROL the FILESYSTEM object class is focused on FILESYSTEM monitoring. Once configuration done, when user select FILESYSTEM other menu can be linked in order to show only Objects with Object class equals to FILESYSTEM

 

Configuration setup:


 

Interface first display:



Once first value selected, user can click on  icon. This will select this information has a key for other slots and automatically adjust other slots proposed values, such as:


 

If needed, a slot can be ‘Unlinked’ to remove restrictions.

Step

Shown icon

Signification

New


Initial state, retrieve values form source

Click on




Clicked slot is master and key for other selections

 

Other slots are ‘Linked’ to Master one

Click on


 


This slot is not linked to others anymore. Available values are not restricted to Master slot