In this blog I will discuss the scripting feature which allows users to define scripts to run at Tivoli Monitoring OS agents sites at a defined frequency.
The feature is enabled by default. The administrator can enable/disable it by setting a new environment variable
KXX_FCP_SCRIPT=true/false (default true) in the agent configuration file, where XX can be:
- LZ for Linux OS agent
- UX for Unix OS agent
- NT for Windows OS agent
This is an overview of the scripting feature; details will be provided in the following sections.
The OS agent loops, at a configurable interval, looking for script definition property files (*.properties) in a configurable directory path.
The property files are parsed and OS Monitoring Agent spawns a new process named “fcp_daemon” if at least one valid script definition is found. This new daemon is responsible for scheduling the script executions and gathering all information regarding running scripts.
According to another configurable interval, the OS agent loops getting the execution script results from the fcp_daemon.
The OS Agent is able to parse the script standard output, splitting each row in up to 16 attributes.
An event is sent for each standard output row of the script and these events can be caught by pure event situations.
1.1 Quick Start
The feature is enabled with default values as soon as the OS agent is started. The only action to start using the feature is the following:
- create a property file under default directory (on Linux/UNIX it is
on Windows it is
%CANDLE_HOME%\localconfig\nt\scripts_definitions) using as an example the provided template script_property.txt.
Only two properties are required:
ATTRIBUTE_NAME=Any name used to uniquely identify the script definition inside the property file.
SCRIPT_PATH_WITH_PARMS=The fully qualified path of the script with arguments.
Not only shell scripts but also perl and other types of scripts can be used. You just need to specify the full command to execute in the SCRIPT_PATH_WITH_PARMS property.
For example, "perl C:\IBM\scripts\ITM_Custom_Scripts\date.pl". In this example you need to make sure that the location of "perl" can be resolved by the agent through the PATH variable in its environment. Specify the full path where "perl" is installed otherwise.
Further properties and details can be found in this document and in the template script_property.txt under $CANDLEHOME/localconfig/lz/scripts_definitions.
2. New Attribute groups
Two new attribute groups have been added for this feature as detailed below. Statistic and execution data of all the scripts are stored in these two tables. The name of the property file (Property_File) and the attribute name defined in the property file (Attribute_Name) are the 2 key fields of these two tables. These two keys must be used in situation conditions to filter rows related to a specific script.
Attribute group: KXX_Custom_Scripts (multiple rows), table: KXXSCRPTS (sampled).
Description: Configuration and statistic data gathered using custom scripts. It contains a row for each defined script, information on the fcp_daemon and on property files:
Attribute Size Description
=========================== ===== =========================
System_Name 32 This is the managed system name of the agent.
Timestamp 16 This is the local time when the data was collected.
Property_File 256 The name of the property file.
Attribute_Name 96 The attribute name that is defined in the properties file. The attribute is
used for metric identification.
Script_Name 512 The name of the script.
Script_Path 512 The fully qualified path name of the script with arguments.
Custom_Name 96 The custom name that is defined in the properties file. It is used for custom
Standard_Output_Type 4 Standard output type of the script.
Status_Code 4 The status of the script. It includes general errors, configuration errors, the
status or the execution code returned by the Script Provider.
Execution_Start 16 The time when the last execution of this script started.
Execution_Duration 4 The duration of the last execution of this script, in seconds. When timing out,
the value of the configured timeout is returnd.
Average_Execution_Duration 4 The average duration, in seconds, of all the execution of the script.
Refresh_Interval 4 The interval, in seconds, that the agent attempts to start this script.