Configuring Script Files

This topic provides information about configuring the script files. KM runs the script file and monitors the output. The KM supports all script file types if it can be run without any runtime command. 

Click Add to configure script files for monitoring. 


Field
Description
Monitoring environment labelEnter the name of the label for the log file that you want to monitor.
Monitoring file logical name

Enter the logical name of the instance that you want to monitor. A maximum of 80 characters are allowed in this field.

Script file (full path)

Enter the full path and the filename of the script that you want to monitor.

A maximum of 900 characters are supported in this field.

To successfully run and monitor a script file output, ensure that the script can run without any runtime dependency. For example, the script file \temp\cpumonitor.bat can run without any runtime dependency. Therefore, it is monitored by the KM. However, if the script file requires a command to run or has any other runtime dependency, the KM does not monitor it. For example, if the \temp\cputmonitor.py script is executed by running the following command:

python \temp\cputmonitor.py

Such a script output is not monitored by the KM.

ArgumentsEnter script arguments. Separate multiple arguments with a space.
Path contains environment variables

Select the check box if the full path contains environment variable and the path defined by the environment variable is resolved at run time.

Data collection interval for local monitoring (min)For local monitoring, set the data collection interval in minutes. For remote monitoring, the data is collected every 2 minutes only. For large systems, BMC recommends that you use the 10 or 30 minutes option.

Advanced settings

If no match on next scan return to OK
Select the check box if the KM goes into an alarm or a warning state because the search string is found and you want the KM state to return to OK if the search string is not found on the next scan.
Text settings
Number of lines in log entrySpecify the number of lines that you want to be displayed when a match is found. For example, if you want to determine when a disk is full and where the disk is mounted, enter Error: Disc Full as the search string and 2 in this field. When a disk is full, the product displays the following message in the LOGMatchString text parameter: 

Id=id1 
031605: Error: Disc Full 
Id=;MatchedLines 
/hd001 mounted as /opt 
SUMMARY:id1=1;

Note: If either the search string or the nullify string occurs again within the number of lines selected to be displayed, the KM does not find the instances of the search strings for all the search identifiers.
Search criteria to nullify an Alarm/Warning state

Specify the string to nullify the alarm for the dual search feature. You can configure dual search for an instance so that the KM goes into the alarm state when any of the search criteria is found in the monitored file and nullifies the alarm when the nullify string is found in the monitored file.

You must specify the first string in the Search String 1 > String text box of the Pattern search criteria section and the nullify string in this text box. For the nullified customized events, the default custom event message is used (as provided in the Custom Event Message text box in the Pattern search criteria section).

If you specify Alarm up in the String1 text box and Alarm down in this text box, the KM goes into an alarm state when Alarm up is found in the monitored file and the alarm is nullified when Alarm down is found in the monitored file.

Multiline Search
Start delimiterSpecify the start limit to search a block of lines containing a match string.
Stop delimiterSpecify the end limit to search a block of lines containing a match string.
Remote monitoring
Remote host nameEnter the host name for remote monitoring. This field is applicable only for UNIX and Linux platforms. UNIX KM must be installed and the Remote Monitoring policy must be defined.
Search criteria strings
Regex type

Select the regex type that you want to use to prepare the search criteria.

Note: The ECMAScript option is not supported on the HP-UX platform.

Pattern search criteriaClick Add to add the pattern search criteria.
Search identifier nameEnter a unique label in the text box and configure a search string to define what type of messages the KM would search for.
Search string 1 and 2

In the String text box, enter the search string in one of the following formats:

  • A combination of XML elements and values that you want to find in the monitored file. For configuring XML search strings, see Rules for entering XML search strings.
  • Search pattern(s) - Each search pattern must be a valid regular expression. Enclose each pattern in parentheses ({}).
If you do not want to match the entered string, select the NOT check box.
Number search

Expand the Number search section to specify the search range in the log file.

Use this section to define a range of numbers found in your log files. Locate those lines by specifying the numbers in the First number and Second number fields. You can use the Operator fields to select an operator that creates a wider range of the numbers that you specify. For example, all the numbers greater than 500 and less than 599. In this case, enter 500 in the First number field, select > in the first Operator field, enter 599 in the Second number field, and select < in the second Operator field.

Tokens are the numbers that the KM assigns to words, characters, or punctuation marks in a log line. When a space is encountered in a line, next token number is assigned to the word, character, or any symbol that appears after the space. For example, in the following log line - 541 - Error - This field cannot be blank. Here is the token assignment for this log line:

Use the Begin token and End token fields to capture the words that you want to monitor in the log lines.

Custom Event handling configurationExpand the Custom Event handling configuration section to specify how to handle custom events.
Override Global Event handling configuration

Select this check box to custom-define the settings for each search criterion.

You can custom-define a search criterion with the settings that are different from the default settings.

Threshold #1 and Threshold #2Enter the minimum number of text search string matches in a data collection interval required to produce a specified state. You can specify a different state and a different number of matches in Threshold #1 and Threshold #2. Ensure that value in Threshold #2 is greater than Threshold #1. To search for a minimum number of text strings across a number of collection intervals, enter values in the x:y format.
Threshold #1 State and Threshold #2 StateSelect the state of the KM when a threshold is reached.
Custom Event messageEnter the message that you want to be displayed in the events when your search string conditions are satisfied. For more information, see Customizing event messages.
Custom Event origin

Enter the customized origin for events. If you do not specify the origin, the KM uses the instance name as the default origin of events, which is APPCLASS.INSTANCE.textFileName.

You can use built-in macros (except the %x[-%y] macro) as the customized origin for events.

Ignore duplicate Events for next (min)

Specify the time threshold for which duplicate events are ignored.

Note: You can also modify the default search criterion settings after you configure the instance.

Global Event handling configuration for all search criteria's
Threshold # 1 and Threshold #2Enter the minimum number of text search string matches in a data collection interval required to produce a specified state. You can specify a different state and a different number of matches in Threshold #1 and Threshold #2. Ensure that value in Threshold #2 is greater than Threshold #1. To search for a minimum number of text strings across a number of collection intervals, enter values in the x:y format.
Threshold # 1 state and Threshold #2 stateSelect the state of the KM when a threshold is reached.
Custom Event messageEnter the message that you want to be displayed in the events when your search string conditions are satisfied. For more information, see Customizing event messages.
Custom Event origin

Enter the customized origin for events. If you do not specify the origin, the KM uses the instance name as the default origin of events, which is APPCLASS.INSTANCE.textFileName.

You can use built-in macros (except the %x[-%y] macro) as the customized origin for events.

Ignore duplicate Events for next (min)

Specify the time threshold for which duplicate events are ignored.

Note: You can also modify the default search criterion settings after you configure the instance.

Was this page helpful? Yes No Submitting... Thank you

Comments

  1. Patrick Mischler

    Number Search does not really work.

    Apr 01, 2020 04:37
    1. Jala Zahwa

      Hi Patrick Mischler , Please describe your use case. Thanks, Jala

      Apr 01, 2020 04:58
  2. John Conroy

    There's not really any differentiation on this page as to monitoring "script files" versus "text files". Does the script file monitoring mechanism call a script and process its output (and its that output StdOut or StdOut & StdErr?)

    Jan 19, 2021 09:11
    1. John Conroy

      Also, does it have any constraints on what the script can be (.bat, .ps1, .sh etc etc)?
      Monitoring a plain log file is very simple compared to using a mechanism that can independently execute a process on a remote system. I'd suspect that there is a lot more information that needs to be provided around this mechanism.

      Jan 19, 2021 09:16
      1. Swati Malhotra

        Hi John Conroy,


        Thanks for your valuable inputs. We have fixed the gaps in the page content. Do let us know for more information.


        Thanks and regards,

        Swati

        Feb 03, 2021 06:18