Hitachi

JP1 Version 12 JP1/Performance Management User's Guide


6.7.1 Creating an alarm definition file

Organization of this subsection

(1) Outputting the template file for the alarm definition file

To create an alarm definition file, first output the template file that includes all of the labels that need to be defined in the alarm definition file.

For example, we will output the template file called /tmp/alarmtmp01.cfg.

  1. Output the template file.

    To output the template file, you can use the jpctool alarm export command. Execute the command with the -template option, as follows:

    jpctool alarm export -f /tmp/alarmtmp01.cfg -template

    The output is shown below.

    #Alarm Definition File Version=0002
    #Alarm Definition File Code=
     
    #[Alarm Data]
    #[[General]]
    #Product=
    #Alarm Table Name=
    #Alarm Name=
    #Message Text=
    #Check Value Exist=N
     
    #[[Advanced Setting]]
    #Active Alarm=Y
    #Regularly Alarm=Y
    #Evaluate All Data=N
    #Notify State=Alarm
    #Monitoring Regularly=N
    #Monitoring Time=
    #Damping=N
    #Damping Count=
     
    #[[Check Value Exist]]
    #Record=
    #Field=
    #Value=
     
    #[[Alarm Condition Expressions]]
    #Condition=
     
    #[[Actions]]
    #Report=
    #E-mail=Abnormal,Warning,Normal
    #Command=Abnormal,Warning,Normal
    #SNMP=Abnormal,Warning,Normal
    #JP1 Event=N
     
    #[[Action Definition E-mail]]
    #E-mail Address=
    #Action Handler=
     
    #[[[Message Text]]]
    #Date: %SCT
    #Host: %HNS
    #
    #Product: %PTS
    #Agent: %ANS
    #
    #Alarm: %AIS (%ATS)
    #State: %SCS
    #
    #Message: %MTS
     
    #[[Action Definition Command]]
    #Command Name=
    #Action Handler=
     
    #[[[Message Text]]]
    #
    #[[Action Definition JP1 Event]]
    #Event ID=
    #Message=%MTS
    #Switch Alarm Level=Y
    #Action Handler=
    #Exec Logical Host=

    Note that each line in the template file begins with a sharp (#). Lines that begin with a sharp are comment lines.

    For details on the jpctool alarm export command, see the chapter that describes the command in the manual JP1/Performance Management Reference.

(2) Creating the alarm definition file

Edit the output template file /tmp/alarmtmp01.cfg into an alarm definition file.

  1. Open the /tmp/alarmtmp01.cfg file with a text editor or other tool.

  2. Define the header part of the alarm definition file.

    In the header part, define the syntax version of the alarm definition file and the character set to use to write the file. These values are defined in the following portion:

    #Alarm Definition File Version=0002
    #Alarm Definition File Code=
       :

    Delete the sharps (#) at the beginning of these lines, and edit the lines as follows:

    Alarm Definition File Version=0002
    Alarm Definition File Code=C
       :
    • Alarm Definition File Version label

      This is the syntax version of the alarm definition file.

      You can specify 0001 or 0002.

      You cannot omit this item.

    • Alarm Definition File Code label

      This is the character code used to create the alarm definition file. You can specify Shift_JIS, EUC-JP, C, UTF-8, or GB18030.

      You cannot omit this item.

  3. Define the PFM - Agent or PFM - RM type, the version of the data model, the alarm table name, and the alarm name.

    The definition of an alarm is coded in the Alarm Data section. For each alarm definition, you must create an Alarm Data section.

    Each Alarm Data section consists of different subsections.

    The following values are defined in the General subsection.

    • PFM - Agent or PFM - RM type

    • Version of the data model

    • Alarm table name

    • Alarm name

    These values are defined in the following portion:

       :
    #[Alarm Data]
    #[[General]]
    #Product=
    #Alarm Table Name=
    #Alarm Name=
    #Message Text=
    #Check Value Exist=N

    In this example, we define the alarm Free Space (hda3) that monitors the free space of the disk /dev/hda3.

    Delete the sharps (#) at the beginning of these lines, and edit the lines as follows:

    [Alarm Data]
    [[General]]
    Product=U4.0
    Alarm Table Name=Disk Monitoring
    Alarm Name=Free Space (hda3)
    Message Text=Free Space (%CVS%)
    Check Value Exist=N
       :

    If the content of Alarm Table Name, Alarm Name, or Message Text includes space(s), you must enclose the item in double quotation marks (").

    For the Alarm Table Name label, you cannot specify a name that begins with PFM.

    • Product label

      Defines the PFM - Agent or PFM - RM type and the data model version. With this label, both the product ID of PFM - Agent or PFM - RM and the version of the data model are defined.

      You cannot omit this item.

    • Alarm Table Name label

      Defines the alarm table name in 1 to 64 bytes.

      You cannot omit this item.

    • Alarm Name label

      Defines the alarm name in 1 to 20 bytes.

      You cannot omit this item.

    • Message Text label

      Defines (in 0 to 255) bytes the content of the variable %MTS, which is used in the message text sent by the email or the JP1 event.

      An empty string is used by default.

    • Check Value Exist label

      Defines whether the alarm monitors whether a value exists.

      - To define the alarm as monitoring whether a value exists: Y

      In this case, you must define the record and the value to be monitored in the Check Value Exist subsection.

      Note that you cannot specify Warning for the E-mail, Command, or SNMP label in the Actions subsection.

      - To define an ordinary alarm: N

      In this case, you must define the alarm conditions in the Alarm Condition Expressions subsection.

      N is the default value.

    Note: Version of the data model to be specified for the Product label

    Select the data model version that corresponds to the agent to which you want to bind the alarm table. If two or more agents of the same type exist and each uses a different data model version, we recommend that you select the earliest data model version.

    For details about how to check the data model version of an agent, see 3.4.6 Displaying agent properties.

  4. Define the conditions for the alarm.

    When you create an alarm whose conditional expression contains <, <=, >=, or >, specify the conditional expression so that the abnormal condition represents a more abnormal range than the warning condition (that is, the abnormal condition encompasses the warning condition).

    Examples are shown below.

    Example 1:

    When the value of CPU% (CPU usage) is greater than 0 and less than 100

    (A larger value is considered more abnormal)

    Conditional expression that is evaluated as intended:

    Abnormal > 90

    Warning > 80

    Conditional expression not evaluated as intended:

    Abnormal > 50

    Warning > 80

    Note: If you want an alarm to only be generated for abnormal conditions, specify the same value for the abnormal and warning conditions, as follows:

    Abnormal > 90

    Warning > 90

    Example 2:

    When the value of % Free Space (free disk space) is greater than 0 and less than 100

    (A smaller value is considered more abnormal)

    Conditional expression that is evaluated as intended:

    Abnormal < 10

    Warning < 30

    Conditional expression not evaluated as intended:

    Abnormal < 60

    Warning < 30

    Note: If you want an alarm to be generated only for abnormal conditions, specify the same value for the abnormal and warning conditions, as follows:

    Abnormal < 10

    Warning < 10

    Note:

    The evaluation of whether an alarm is in an abnormal condition is performed only after Warning conditions are met.

    Therefore, you must specify conditions for the Abnormal condition that will also be met for the Warning condition.

    When defining an ordinary alarm (when you specify Check Value Exist=N in the General subsection), define the conditions for the alarm.

    You can define the conditions for the alarm in the Alarm Condition Expressions subsection.

    If you define an ordinary alarm, you cannot omit this subsection.

    The conditions for the alarm are defined in the following portion:

       :
    #[[Alarm Condition Expressions]]
    #Condition=
       :

    For the Condition label, code the conditional expressions for the alarm using the record name and the field name to be monitored.

    In this example, we will monitor two items, the disk name and the free space, so we need to define two conditional expressions.

    • The conditional expression to determine the disk to be monitored

      The disk name is stored in the File System (FILESYSTEM_NAME) field of the File System Detail - Local (PD_FSL) record. The value of this field is used for the judgment condition.

      PD_FSL_FILESYSTEM_NAME="/dev/hda3","/dev/hda3"

    The left side of the conditional expression specifies the field name of the record to be used for the judgment in the form of the PFM - Manager name.

    The right side of the conditional expression specifies the judgment conditions for Abnormal and Warning, separated by a comma.

    In this example, we specify the same values to monitor the same disk for both Abnormal and Warning.

    • The conditional expression to judge the free space ratio

      The free space is stored in the Mbytes Free % (TOTAL_MBYTES_FREE_PERCENT) field of the File System Detail - Local (PD_FSL) record. The value of this field is used for the judgment condition.

      PD_FSL_TOTAL_MBYTES_FREE_PERCENT<10,20

      In this example, we will define a free space ratio lower than 10% as Abnormal and one lower than 20% as Warning.

    Delete the sharps (#) at the beginning of the appropriate lines, and code these conditional expressions combined with an AND operator in the alarm definition file.

       :
    [[Alarm Condition Expressions]]
    Condition=PD_FSL_FILESYSTEM_NAME="/dev/hda3","/dev/hda3" AND PD_FSL_TOTAL_MBYTES_FREE_PERCENT<10,20
       :

    If you specify strings on the right side of the conditional expression (the Abnormal and Warning values), you must enclose them in double quotation marks (").

    To specify a hash mark (#) to the right of a conditional expression, you must specify \#.

    The right side of a conditional expression must not contain (, ), [, ], <, >, =, or ". To use these characters, use the wildcard character to specify a conditional expression. To specify a backslash sign (\) immediately before the wildcard character to the right of a conditional expression, you must specify \\.

  5. Define the actions to be taken when the alarm occurs.

    You can define the actions to be taken when the alarm occurs in the Actions subsection. The actions to be taken when the alarm occurs are defined in the following portion:

       :
    #[[Actions]]
    #Report=
    #E-mail=Abnormal,Warning,Normal
    #Command=Abnormal,Warning,Normal
    #SNMP=Abnormal,Warning,Normal
    #JP1 Event=N
       :

    Code the following to have an email sent when the Abnormal alarm status is reached and a JP1 event issued when the Abnormal or Warning status is reached:

       :
    [[Actions]]
    #Report=
    E-mail=Abnormal
    Command=Abnormal,Warning
    #SNMP=Abnormal,Warning,Normal
    JP1 Event=Y
       :
    • E-mail label

      Defines the alarm status that triggers an email to be sent.

      - To have emails sent in the Abnormal status: Abnormal

      - To have emails sent in the Warning status: Warning

      - To have emails sent in the Normal status: Normal

      If you want to specify multiple statuses for the action, separate them with commas.

      If you specify a status here, you must define the details of the emails in the Action Definition E-mail subsection.

      You can omit this item.

    • Command label

      Defines the alarm status for which actions are to be performed, when the action is to issue a JP1 event or to execute a command.

      - To perform the action when the status is Abnormal: Abnormal

      - To perform the action when the status is Warning: Warning

      - To perform the action when the status is Normal: Normal

      If you want to specify multiple statuses for the actions, separate them with commas.

      You can omit this item.

    • JP1 Event label

      Defines whether to issue JP1 events or to execute commands as the actions defined for the Command label.

      - To issue JP1 events: Y

      In this case, you must define the details for issuing JP1 events in the Action Definition JP1 Event subsection.

      - To execute commands: N

      In this case, you must define the details for executing commands in the Action Definition Command subsection.

      N is the default value.

  6. Define the destination and message text of the email.

    You can define the destination and message text of the email in the Action Definition E-mail subsection.

    If you define the action of sending an email, you cannot omit this subsection.

    The destination and message text of the email are defined in the following portion:

       :
    #[[Action Definition E-mail]]
    #E-mail Address=
    #Action Handler=
     
    #[[[Message Text]]]
    #Date: %SCT
    #Host: %HNS
    #
    #Product: %PTS
    #Agent: %ANS
    #
    #Alarm: %AIS (%ATS)
    #State: %SCS
    #
    #Message: %MTS
       :

    For the following example, suppose we want to specify the email destination as operatorA@aaa.com and the message text with some variables. Delete the sharps (#) at the beginning of the appropriate lines, and edit those lines as follows:

       :
    [[Action Definition E-mail]]
    E-mail Address=operatorA@aaa.com
    Action Handler=PH1host01
       :
    [[[Message Text]]]
    Date: %SCT
    Host: %HNS
     
    Product: %PTS
    Agent: %ANS
     
    Alarm: %AIS (%ATS)
    State: %SCS
     
    Message: %MTS
       :
    • E-mail Address label

      Defines the destination of the email in 1 to 127 bytes of characters. If you want to specify multiple destinations, separate them with commas.

      You cannot omit this item.

    • Action Handler label

      Defines the service ID of the Action Handler service to send the email from.

      You cannot omit this item.

    • Message Text sub-subsection

      Defines the message text in 0 to 1,000 bytes.

      All characters including any linefeeds that appear before the line where the next section or subsection begins, or just before the end of the file, are considered valid text strings. As an exception, any comment lines in this sub-subsection are excluded. Also, the linefeed character in the last line is excluded.

      If this value is omitted, an empty string is assumed.

      The variables used in the example above are defined as:

      - Date and time when the alarm occurred

      - Host name of the agent where the alarm occurred

      - Agent type and version of the data model

      - Name of the agent where the alarm occurred

      - Alarm name

      - Alarm table name

      - Status of the alarm

      - Free space (the value defined for the Message Text label in the General subsection)

    For details on variables used in the definitions for the Message Text subsection, and their meanings, see the chapter explaining the Alarms window in the manual JP1/Performance Management Reference.

  7. Define the details for issuing the JP1 events.

    You can define the details for issuing the JP1 events in the Action Definition JP1 Event subsection.

    If you define the actions to issue JP1 events, you cannot omit this subsection.

    The details for issuing the JP1 events are defined in the following portion:

       :
    #[[Action Definition JP1 Event]]
    #Event ID=
    #Message=%MTS
    #Switch Alarm Level=Y
    #Action Handler=
    #Exec Logical Host=
       :

    Delete the sharps (#) at the beginning of the appropriate lines, and edit those lines as follows:

       :
    [[Action Definition JP1 Event]]
    Event ID=1234
    Message=%MTS
    Switch Alarm Level=Y
    Action Handler=PH1host01
    #Exec Logical Host=
       :
    • Event ID label

      Defines the event ID of the JP1 event in hexadecimal. For a JP1 system event, the information set for this option is identified as an event ID (JPC_USER_EVENTID) with an extended JP1 event attribute when output. For a JP1 user event, it is identified as an event ID (JPC_USER_EVENTID) with a basic JP1 event attribute when output. For details on the JP1 event types, see 12.2 JP1 events issued from Performance Management to JP1/IM.

      You cannot omit this item.

    • Message label

      Defines the message to send with the JP1 event in 0 to 1,023 bytes. When using version 09-00 or earlier of the Action Handler service to send the JP1 event, define the message in 0 to 128 bytes.

      If a label contains a space, you must enclose the value with double quotation marks (").

      An empty string is used by default.

    • Switch Alarm Level label

      Defines whether to convert the alarm level to the severity level.

      - To convert the alarm level to the severity level: Y

      - To not convert the alarm level to the severity level: N

      Y is the default.

    • Action Handler label

      Defines the service ID of the Action Handler service to issue the JP1 event from.

      You cannot omit this item.

  8. Define the alarm Free Space (hda4) in the same way.

    By following steps 3-7, define the alarm Free Space (hda4) that monitors the free space of the disk /dev/hda4.

    The completed alarm definition file is shown below:

    Alarm Definition File Version=0002
    Alarm Definition File Code=C
     
    [Alarm Data]
    [[General]]
    Product=U4.0
    Alarm Table Name=Disk Monitoring
    Alarm Name=Free Space (hda3)
    Message Text=Free Space (%CVS%)
    Check Value Exist=N
     
    #[[Advanced Setting]]
    #Active Alarm=Y
    #Regularly Alarm=Y
    #Evaluate All Data=N
    #Notify State=Alarm
    #Monitoring Regularly=N
    #Monitoring Time=
    #Damping=N
    #Damping Count=
     
    #[[Check Value Exist]]
    #Record=
    #Field=
    #Value=
     
    [[Alarm Condition Expressions]]
    Condition=PD_FSL_FILESYSTEM_NAME="/dev/hda3","/dev/hda3" AND PD_FSL_TOTAL_MBYTES_FREE_PERCENT<10,20
     
    [[Actions]]
    #Report=
    E-mail=Abnormal
    Command=Abnormal,Warning
    #SNMP=Abnormal,Warning,Normal
    JP1 Event=Y
     
    [[Action Definition E-mail]]
    E-mail Address=operatorA@aaa.com
    Action Handler=PH1host01
     
    [[[Message Text]]]
    Date: %SCT
    Host: %HNS
     
    Product: %PTS
    Agent: %ANS
     
    Alarm: %AIS (%ATS)
    State: %SCS
     
    Message: %MTS
     
    #[[Action Definition Command]]
    #Command Name=
    #Action Handler=
     
    #[[[Message Text]]]
    #
    [[Action Definition JP1 Event]]
    Event ID=1234
    Message=%MTS
    Switch Alarm Level=Y
    Action Handler=PH1host01
    #Exec Logical Host=
     
    [Alarm Data]
    [[General]]
    Product=U4.0
    Alarm Table Name=Disk Monitoring
    Alarm Name=Free Space (hda4)
    Message Text=Free Space (%CVS%)
    Check Value Exist=N
     
    #[[Advanced Setting]]
    #Active Alarm=Y
    #Regularly Alarm=Y
    #Evaluate All Data=N
    #Notify State=Alarm
    #Monitoring Regularly=N
    #Monitoring Time=
    #Damping=N
    #Damping Count=
     
    #[[Check Value Exist]]
    #Record=
    #Field=
    #Value=
     
    [[Alarm Condition Expressions]]
    Condition=PD_FSL_FILESYSTEM_NAME="/dev/hda4","/dev/hda4" AND PD_FSL_TOTAL_MBYTES_FREE_PERCENT<10,20
     
    [[Actions]]
    #Report=
    E-mail=Abnormal
    Command=Abnormal,Warning
    #SNMP=Abnormal,Warning,Normal
    JP1 Event=Y
     
    [[Action Definition E-mail]]
    E-mail Address=operatorA@aaa.com
    Action Handler=PH1host01
     
    [[[Message Text]]]
    Date: %SCT
    Host: %HNS
     
    Product: %PTS
    Agent: %ANS
     
    Alarm: %AIS (%ATS)
    State: %SCS
     
    Message: %MTS
     
    #[[Action Definition Command]]
    #Command Name=
    #Action Handler=
     
    #[[[Message Text]]]
    #
    [[Action Definition JP1 Event]]
    Event ID=1234
    Message=%MTS
    Switch Alarm Level=Y
    Action Handler=PH1host01
    #Exec Logical Host=
  9. When you have finished making the necessary changes, save the /tmp/alarmtmp01.cfg file.

For details on the items that are not specified in above example, see the description of the jpctool alarm import command in the manual JP1/Performance Management Reference.