Parameters in OS agent environment files

You can set the parameters for custom scripting in the OS agent environment files.

It is possible to customize the scripting feature by setting parameters in the OS agent environment files:

install dir/config/lz.environment
The environment file for the Monitoring Agent for Linux® OS.
install dir/config/ux.environment
The environment file for the Monitoring Agent for UNIX OS.
install dir\TMAITM6_x64\KNTENV
The environment file for the 64 bit Monitoring Agent for Windows OS.
install dir\TMAITM6\KNTENV
The environment file for the 32 bit Monitoring Agent for Windows OS.
KXX_FCP_SCRIPT
The scripting feature is enabled by default. To disable it set: KXX_FCP_SCRIPT=false
Other parameters can be defined inside the agent environment files based on specific needs:
KXX_FCP_SCRIPT_DEFINITIONS
The location where property files are stored.

The default location on Linux™ or UNIX™ is install dir/localconfig/PC/scripts_definitions, on Windows™ it is install dir\localconfig\nt\scripts_definitions

KXX_FCP_SCRIPT_INTERVAL

OS agent uses the value of this variable as loop interval in seconds to check execution of running scripts and it sends events if the filter condition is satisfied. The minimum value is 30 seconds and the maximum value is 300 seconds. Invalid values are reset to the default. The default value is 60 seconds.

Note: This parameter is ignored if KXX_FCP_SCRIPT_SYNC_INTERVALS is set to USE_SCRIPT (see definition for KXX_FCP_SCRIPT_SYNC_INTERVALS).
KXX_FCP_SCRIPT_SYNC_INTERVALS
If the agent looping interval defined by KXX_FCP_SCRIPT_INTERVAL is larger than the script execution frequency, it can happen that data produced by some of the script execution loops is lost. In order to avoid this behavior, the script execution frequency can be synchronized with the agent looping interval by setting the KXX_FCP_SCRIPT_SYNC_INTERVALS to:
  • USE_AGENT - The value of each script execution frequency is forced to be the maximum between KXX_FCP_SCRIPT_INTERVAL and EXECUTION_FREQUENCY defined in its property file.
  • USE_SCRIPT - The agent looping interval is dynamically set to the minimum frequency value (EXECUTION_FREQUENCY in property file) between all of the defined scripts. The value set by KXX_FCP_SCRIPT_INTERVAL is ignored. The frequency of the scripts remains as defined in the property files. When you set USE_SCRIPT, the agent looping interval can change every time a script definition is added, changed, or removed. In any case, it cannot be lower than the value set by KXX_FCP_OVERRIDE_MIN_FREQUENCY_LIMIT or bigger than 300 seconds.
  • NO - No synchronization is done and some execution results might be lost.
KXX_FCP_SCRIPT_DEFINITIONS_CHECK_INTERVAL

At startup and at every interval that is defined by this variable, the OS agent checks for any changes in scripts or property files. Note if KXX_FCP_SCRIPT_DEFINITIONS_CHECK_INTERVAL is less than the agent looping interval it is reset to the agent looping interval. The maximum allowed value is the default, 300 seconds.

KXX_FCP_USER

This parameter is valid only on Linux™ or UNIX™ OS agents. It defines the user used to create the fcp_deamon process if different from OS agent process user; all the scripts are run by this user. Be advised the owner of the OS agent must have correct permission to create the fcp_daemon process. On Windows™, a different user must be defined as login of the service Monitoring Agent for Windows OS "FCProvider". The user must have "Full Control" permission to agent installation directory and scripts repository directories. For more information, see:

https://www.ibm.com/support/knowledgecenter/SSHLNR_8.1.4/com.ibm.pm.doc/install/install_linuxaix_agent_nonroot.html

KXX_FCP_MAX_CDP_DP_THREAD_POOL_SIZE
It defines the maximum concurrent number of scripts to be run. Maximum value is 32.
KXX_FCP_MAX_DAEMON_RESTARTS

The OS agent watches the fcp_daemon: If an abnormal exit of process occurs, the OS agent restarts it. The default value is 4. The restart is done for the KXX_FCP_MAX_DAEMON_RESTARTS (times at a day). The value 0 must be used to avoid the restart; if -1 is set, the OS agent retries to restart fcp_daemon forever. The restart counter is reset at OS agent restart.

KXX_FCP_SEND_SCRIPT_RUNTIME_EVENTS
The default value is true. If set to false, the OS agent stops sending events for each row of script standard output. In this case script outputs are visible on console workspaces but no situations are displayed and no historical data is collected.
KXX_FCP_OVERRIDE_MIN_FREQUENCY_LIMIT

It is used when KXX_FCP_SCRIPT_SYNC_INTERVALS is set to USE_SCRIPT. In this condition, it sets the minimum value of the OS agent looping interval.

Using low values for the OS agent looping interval (less than 5 seconds) is highly invasive and can impact OS agent performances. If frequent data collection is needed (for example, every second), it is suggested to customize a script. The script caches data at the needed frequency and returns the collected data to the OS agent at a higher interval (for example, every 60 seconds).

The following Agent Builder (CDP) variables can also be used to control the behavior of the fcp_daemon:
CDP_DP_REFRESH_INTERVAL
(default 60 sec) Global script scheduled start time. Used if the frequency is not passed in the script property file.
CDP_DP_SCRIPT_TIMEOUT
(default 30 sec) Global script execution maximum time. When the execution time of a script exceeds this limit, its Status_Code is set to TIMEOUT
CDP_DP_KILL_ORPHAN_SCRIPTS
(Y|N - default N) Global behavior used by fcp_daemon process for timing out scripts. When set to 'Y', the scripts are ended, otherwise they are abandoned. This value is ignored for a specific script if the KILL_AFTER_TIMEOUT key is set in the script property file
CDP_MAXIMUM_ROW_COUNT_FOR_CPCI_DATA_RESPONSES
(default 1000) Global value is added for performance reasons to limit the maximum number of output rows returned by the scripts. Extra rows after this limit are ignored. Allowed values are positive integer. Invalid values are changed to no limit.

The fcp_daemon also supports the other environment variables that are used to control Agent Builder agents. For a complete list, see the IBM Agent Builder User's Guide here: PDF documentation.