Thursday 8 October 2015

Chapter 14: Monitoring Jobs



Chapter 14: Monitoring Jobs

Monitoring Jobs 
Monitoring jobs let you monitor different aspects of your system.
Note: To run these jobs, your system requires CA WA Agent for UNIX, Linux, Windows,
or i5/OS.
You can define the following monitoring jobs:
CPU Monitoring
Lets you monitor CPU usage.
Disk Monitoring
Lets you monitor disk space.
IP Monitoring
Lets you monitor an IP address.
Process Monitoring
Lets you monitor process execution.
Text File Reading and Monitoring
Lets you search a text file for a string.
Windows Event Log Monitoring
Lets you monitor a Windows event log.
Windows Service Monitoring
Lets you monitor the status of Windows services.
 Define a CPU Monitoring Job


Define a CPU Monitoring Job 
You can define a CPU Monitoring (OMCPU) job to monitor the CPU usage of the
computer the specified agent is installed on. By default, the job monitors for available
CPU and completes when the specified conditions are met.
Note: To run these jobs, your system requires CA WA Agent for UNIX, Linux, Windows,
or i5/OS.

Follow these steps: 
1. Insert a job and specify the following attributes in the definition:
job_type: OMCPU
Specifies that the job type is CPU Monitoring.

machine 
Specifies the name of the machine on which the job runs.

2. (Optional) Specify optional CPU Monitoring attributes:
■ cpu_usage
■ inside_range
■ job_class
■ job_terminator
■ monitor_mode
■ no_change
■ poll_interval
 Define a CPU Monitoring Job

Chapter 14: Monitoring Jobs 339

3. Specify at least one of the following attributes if monitor_mode is set to WAIT (the
default) or CONTINUOUS:
■ lower_boundary
■ upper_boundary
Notes:
■ If the monitor_mode is set to WAIT, the job monitors for available CPU on the
specified machine and completes when the CPU usage value falls within the
lower and upper boundaries.
■ If the monitor_mode is set to CONTINUOUS, the job monitors for the
conditions continuously and an alert is written to the scheduler log file.
4. (Optional) Specify common attributes that apply to all job types.
The CPU Monitoring job is defined. When the job runs, it monitors for available CPU
on the specified machine and completes when the CPU usage value falls within the
lower and upper boundaries.
Notes:
■ Attributes that have a default value automatically apply to the job definitions;
therefore, they are optional. For example, jobs with no specified job type are
defined as command jobs by default. Other optional attributes specify information
that is not required but affects how or when a job runs, such as attributes that
specify scheduling conditions.
■ Some optional attributes are common to all job types but others apply to certain
jobs types only. Optional attributes that apply to all job types are known as
common optional attributes. For more information about common optional
attributes and the values that you can specify for them (including their default
values when applicable), see the Reference Guide.
■ For information about required attributes and job type specific optional attributes,
see the procedure topics that provide instructions for defining jobs.
■ This guide provides instructions for defining jobs interactively. You also create job
definitions in script files and then import them using the jil command or use CA
WCC to define them. For more information about the JIL command and JIL syntax,
see the Reference Guide. For more information about using CA WCC to define the
job, see the CA Workload Control Center Workload Scheduling Guide.

Example: Check Available CPU Immediately
This example monitors available CPU usage on the unixagent computer. The job checks
the CPU usage immediately and reports the value in percent.
insert_job: omcpu_job
job_type: OMCPU
machine: unixagent
monitor_mode: NOW Define a CPU Monitoring Job

340 User Guide

Example: Monitor When the Available CPU Reaches 50 Percent
This example monitors the CPU available on the unixagent computer. The default
monitor mode is WAIT, so a lower boundary, upper boundary, or both boundaries must
be specified. In this example, the lower boundary is specified and the default upper
boundary (100 percent) is used. When the available CPU usage is within 50 and 100
percent, the job completes.
insert_job: omcpu_job
job_type: OMCPU
machine: unixagent
lower_boundary: 50
CPU Monitoring Modes
When you define a CPU monitoring job, you can define the mode it runs in. Depending
on the mode, CPU monitoring jobs can do the following:
■ Monitor CPU usage and complete when the specified conditions are met (WAIT
mode). This is the default.
■ Record the CPU usage at the time the job runs. In this case, the job runs only once
(NOW mode).
■ Monitor CPU usage and trigger an alert if the CPU usage meets the defined criteria
(CONTINUOUS mode). For example, a job can trigger an alert when the computer is
using between 80 and 100 percent of CPU, and the job continues to run until you
manually terminate it.

Attributes with Default Values
Attributes that have a default value automatically apply to the job definition. Therefore,
you do not have to specify those attributes in the definition. Your agent administrator
can define some default values on the agent in the agentparm.txt file.
If you specify the attribute in a job definition, it overrides the default.

The following CPU Monitoring job attributes have default values:
cpu_usage
Specifies whether the job monitors the available or used CPU processing capacity.
Default: FREE (The job monitors for available CPU.)
 Define a CPU Monitoring Job

Chapter 14: Monitoring Jobs 341

inside_range
Specifies whether the job completes (or triggers if monitoring continuously) when
the value of CPU usage is inside or outside the specified boundaries.
Default: TRUE (The job completes or triggers if the value of the CPU usage is within
the lower and upper boundaries.)

lower_boundary
Defines the minimum amount of CPU usage to monitor for in percent.
Default: 0 (The job monitors the CPU usage between zero and the upper boundary.)

monitor_mode
Specifies whether the job waits until the monitor conditions are met or tries to
verify them immediately.
Default: WAIT (The job waits until the specified conditions are met before
completing.)

poll_interval
Defines the interval (in seconds) between successive scans of the CPU usage.
Default: objmon.scaninterval agent parameter (This parameter is automatically set
to 10. The job polls the CPU usage every 10 seconds during continuous monitoring.)

upper_boundary
Defines the maximum amount of CPU usage to monitor for in percent.
Default: 100 (The job monitors the CPU usage between the lower boundary and
100 percent.)
Note: For more information about JIL job types and other job definition attributes, the
values that you can specify for those attributes, and JIL syntax, see the Reference Guide.


Example: Monitor CPU Usage Until Condition Successful
This example checks the CPU usage and completes successfully when the used CPU is
within 80 and 95 percent. The cpu_usage, monitor_mode, lower_boundary, and
upper_boundary attributes in this job definition override the default values.
insert_job: omcpu_job
job_type: OMCPU
machine: winagent
cpu_usage: USED
inside_range: TRUE
monitor_mode: WAIT
lower_boundary: 80
upper_boundary: 95 Define a CPU Monitoring Job

342 User Guide

Examples: Monitoring CPU Usage
The following examples are CPU Monitoring Jobs:
Example: Monitor Used CPU
This example monitors the used CPU on the unixagent computer. The job completes
when the used CPU is less than 20 percent or greater than 80 percent.
insert_job: omcpu_job
job_type: OMCPU
machine: unixagent
lower_boundary: 20
upper_boundary: 80
inside_range: FALSE
cpu_usage: USED
Example: Monitor CPU Availability Within a Range
This example continuously monitors the CPU available on the unixagent computer. The
job polls the CPU usage every 60 seconds. Each time the available CPU is within 75 and
95 percent, an alert is written to the scheduler log file. The job continues monitoring the
CPU usage until it is ended manually.
insert_job: omcpu_job
job_type: OMCPU
machine: unixagent
cpu_usage: FREE
inside_range: TRUE
poll_interval: 60
monitor_mode: CONTINUOUS
lower_boundary: 75
upper_boundary: 95
The following table shows when alerts would be triggered with and without the
no_change value:

Time CPU Is the Alert Triggered When
No Change is not specified?
Is the Alert Triggered
When No Change is
specified at 10 percent?
14:00:01 25 percent No. Available CPU must be
below 25 percent or above
75 percent.
No. Available CPU must
be below 25 percent or
above 75 percent.
14:00:02 20 percent Yes. Available CPU is below
25 percent.
Yes. Available CPU is
below 25%. Define a CPU Monitoring Job

Chapter 14: Monitoring Jobs 343

Time CPU Is the Alert Triggered When
No Change is not specified?
Is the Alert Triggered
When No Change is
specified at 10 percent?
14:00:03 19 percent Yes. Available CPU is below
25 percent.
No. Available CPU
remains below 25
percent, but the change
from the last reading is
only 1 percent.
14:00:04 8 percent Yes. Available CPU is below
25 percent.
Yes. CPU usage has
changed 12 percent from
the last time the alert
was triggered.
14:00:05 19 percent Yes. Available CPU is below
25 percent.
Yes. CPU usage has
changed 11 percent from
the last time the alert
was triggered.
14:00:06 32 percent No. Available CPU must be
below 25 percent or above
75 percent.
No. Although CPU usage
changed by more than 10
percent, it no longer falls
within the range defined
by the lower_boundary
and upper_boundary
fields. It is not below 25
percent or above 75
percent.
 Define a Disk Monitoring Job

344 User Guide

Define a Disk Monitoring Job
On UNIX and Windows systems, you can define a Disk Monitoring (OMD) job to monitor
the available or used space on a disk or logical partition. On i5/OS systems, you can
define a Disk Monitoring job to monitor storage space in the file systems mounted on
the i5/OS operating system.
Note: To run these jobs, your system requires CA WA Agent for UNIX, Linux, Windows,
or i5/OS.
Follow these steps:
1. Insert a job and specify the following attributes in the definition:
job_type: OMD
Specifies that the job type is Disk Monitoring.
machine
Specifies the name of the machine on which the job runs.
disk_drive
Specifies the path to the disk, logical partition, or auxiliary storage pool to be
monitored.

2. (Optional) Specify optional Disk Monitoring attributes:
■ disk_format
■ disk_space
■ inside_range
■ job_class
■ job_terminator
■ monitor_mode
■ no_change
■ poll_interval
 Define a Disk Monitoring Job

Chapter 14: Monitoring Jobs 345

3. Specify one or both of the following attributes if monitor_mode is set to WAIT (the
default) or CONTINUOUS:
■ lower_boundary
■ upper_boundary
4. (Optional) Specify common attributes that apply to all job types.
The Disk Monitoring job is defined.
Notes:
■ Attributes that have a default value automatically apply to the job definitions;
therefore, they are optional. For example, jobs with no specified job type are
defined as command jobs by default. Other optional attributes specify information
that is not required but affects how or when a job runs, such as attributes that
specify scheduling conditions.
■ Some optional attributes are common to all job types but others apply to certain
jobs types only. Optional attributes that apply to all job types are known as
common optional attributes. For more information about common optional
attributes and the values that you can specify for them (including their default
values when applicable), see the Reference Guide.
■ For information about required attributes and job type specific optional attributes,
see the procedure topics that provide instructions for defining jobs.
■ This guide provides instructions for defining jobs interactively. You also create job
definitions in script files and then import them using the jil command or use CA
WCC to define them. For more information about the JIL command and JIL syntax,
see the Reference Guide. For more information about using CA WCC to define the
job, see the CA Workload Control Center Workload Scheduling Guide.

Example: Check Available Disk Space Immediately
This example monitors available disk space on a local UNIX partition. The job checks the
disk usage immediately and reports the value in megabytes.
insert_job: unix_freemb
job_type: OMD
machine: unixagent
disk_drive: /export/home
disk_format: MB
monitor_mode: NOW Define a Disk Monitoring Job

346 User Guide

Example: Monitor When the Available Disk Space Reaches 50 Percent
This example monitors the disk space available in /export/home on the unixagent
computer. The default monitor mode is WAIT, so a lower boundary, upper boundary, or
both boundaries must be specified. In this example, the lower boundary is specified and
the default upper boundary (100 percent) is used. When the available disk space is
within 50 and 100 percent, the job completes.
insert_job: omd_job
job_type: OMD
machine: unixagent
disk_drive: /export/home
lower_boundary: 50
Attributes with Default Values
Attributes that have a default value automatically apply to the job definition. Therefore,
you do not have to specify those attributes in the definition. Your agent administrator
can define some default values on the agent in the agentparm.txt file.
If you specify the attribute in a job definition, it overrides the default.
The following Disk Monitoring job attributes have default values:
disk_format
Specifies the unit of measurement used to monitor available or used disk space.
Default: PERCENT (The job monitors disk usage by percent.)
disk_space
Specifies whether the job monitors for available or used disk space.
Default: FREE (The job monitors for available disk space.)
inside_range
Specifies whether the job completes (or triggers if monitoring continuously) when
the value of disk usage is within or outside the specified boundaries.
Default: TRUE (The job completes or triggers if the value of the disk usage is within
the lower and upper boundaries.)
monitor_mode
Specifies whether the job waits until the monitor conditions are met or tries to
verify them immediately.
Default: WAIT (The job waits until the specified conditions are met before
completing.)
Note: For more information about JIL job types and other job definition attributes, the
values that you can specify for those attributes, and JIL syntax, see the Reference Guide.
 Define a Disk Monitoring Job

Chapter 14: Monitoring Jobs 347

Example: Monitor for Used Disk Space Outside of a Range
The inside_range and disk_space attributes in the following job definition override the
default values.
This example monitors the C drive on a Windows computer for used space. When the
value of disk space used falls below 16 percent or exceeds 95 percent, the job
completes.
insert_job: omd_win
job_type: OMD
machine: winagent
disk_drive: C
disk_format: PERCENT
lower_boundary: 16
upper_boundary: 95
inside_range: FALSE
disk_space: USED
Examples: Monitoring Disk Space
The following examples are Disk Monitoring Jobs:
Example: Monitor Available Space on a UNIX Partition
This example monitors available disk space on a local UNIX partition. The job checks the
disk usage immediately and reports the value in megabytes.
insert_job: unix_freemb
job_type: OMD
machine: unixagent
disk_drive: /export/home
disk_format: MB
monitor_mode: NOW Define a Disk Monitoring Job

348 User Guide

Example: Continuously Monitor Used Space on a UNIX Partition
This example continuously monitors used disk space on a local UNIX partition. Each time
the used disk space falls between 90 and 100 percent, an alert is written to the
scheduler log file. The job continues monitoring the disk space until it is ended
manually.
insert_job: unix_used
job_type: OMD
machine: unixagent
disk_drive: /export/home
disk_space: USED
disk_format: PERCENT
monitor_mode: CONTINUOUS
lower_boundary: 90
Example: Monitor Used Space on a Windows Drive
This example monitors the used disk space on a local Windows C drive. When the used
disk space falls below 16 percent or exceeds 95 percent, the job completes.
insert_job: win_used
job_type: OMD
machine: winagent
disk_drive: C
disk_format: PERCENT
disk_space: USED
monitor_mode: WAIT
lower_boundary: 16
upper_boundary: 95
inside_range: FALSE
Example: Monitor the System Auxiliary Storage Pool on an i5/OS Computer
This example continuously monitors the system auxiliary storage pool on an i5/OS
computer. Each time the used disk space falls between 90 and 100 percent, an alert is
written to the scheduler log file. The job continues monitoring the disk space until it is
ended manually.
insert_job: i5_used
job_type: OMD
machine: i5agent
disk_drive: /
disk_space: USED
disk_format: PERCENT
monitor_mode: CONTINUOUS
lower_boundary: 90
upper_boundary: 100 Define a Disk Monitoring Job

Chapter 14: Monitoring Jobs 349

Example: Monitor Available Disk Space That Changes by At Least 100 KB
This example continuously monitors the available disk space in kilobytes (KB) on the
local Windows C drive. When the available space is in the 35000000 to 36000000 KB
range, the first alert is written to the scheduler log file.
Subsequently, an alert is triggered each time the available disk space is within the
specified boundaries and the disk usage changes by more than 100 KB. If the amount of
change is less than or equal to 100 KB, the job does not register a change.

insert_job: omd_job
job_type: OMD
machine: winagent
disk_drive: C
disk_space: FREE
disk_format: KB
lower_boundary: 35000000
upper_boundary: 36000000
inside_range: TRUE
no_change: 100
monitor_mode: CONTINUOUS
The following table shows four sequential scans:

Scan Scanned Amount (Kilobytes) Does the Trigger Occur?
1 35018896 Yes.
2 35018900 No. Comparing scan 2 to scan 1, the delta
value is only 4 KB. This scanned amount
will not be included in the next
calculation.
3 35018795 Yes. Comparing scan 3 to scan 1, the delta
value is greater than 100 KB. The delta
value of the next scan will be calculated
using the scan 3 value of 35018795.
4 36000001 No. The scanned amount is outside the
lower and upper boundary range.
 Define an IP Monitoring Job

350 User Guide

Define an IP Monitoring Job
You can define an IP Monitoring (OMIP) job to monitor an IP address or a port at an IP
address.
If the port is not specified or it is specified as zero, then while monitoring an IP host, the
agent pings the machine. If the ping is successful, it indicates that the host is RUNNING.
If the ping is unsuccessful, it indicates that the host is STOPPED.
If you specify a host and a non-zero port, the agent tries to connect to the port to check
if an application is listening on it. If the connection is successful, it indicates that the
application on the host is RUNNING. If the connection is unsuccessful, it indicates that
the application on the host is STOPPED.
Note: To run these jobs, your system requires CA WA Agent for UNIX, Linux, Windows,
or i5/OS.

Follow these steps:
1. Insert a job and specify the following attributes in the definition:
job_type: OMIP
Specifies that the job type is IP Monitoring.

machine
Specifies the name of the machine on which the job runs.
ip_host
Specifies the DNS name or IP address.
 Define an IP Monitoring Job

Chapter 14: Monitoring Jobs 351

2. (Optional) Specify optional IP Monitoring attributes:
■ ip_port
■ ip_status
■ job_class
■ job_terminator
■ monitor_mode
3. (Optional) Specify common attributes that apply to all job types.
The IP Monitoring job is defined.
Notes:
■ Attributes that have a default value automatically apply to the job definitions;
therefore, they are optional. For example, jobs with no specified job type are
defined as command jobs by default. Other optional attributes specify information
that is not required but affects how or when a job runs, such as attributes that
specify scheduling conditions.
■ Some optional attributes are common to all job types but others apply to certain
jobs types only. Optional attributes that apply to all job types are known as
common optional attributes. For more information about common optional
attributes and the values that you can specify for them (including their default
values when applicable), see the Reference Guide.
■ For information about required attributes and job type specific optional attributes,
see the procedure topics that provide instructions for defining jobs.
■ This guide provides instructions for defining jobs interactively. You also create job
definitions in script files and then import them using the jil command or use CA
WCC to define them. For more information about the JIL command and JIL syntax,
see the Reference Guide. For more information about using CA WCC to define the
job, see the CA Workload Control Center Workload Scheduling Guide.

Example: Monitor a Device Until it Stops
This example monitors the device APPARCL. When the device stops running, the job
completes.
insert_job: omip_stop
job_type: OMIP
machine: SYSAG
ip_host: APPARCL
monitor_mode: WAIT Define an IP Monitoring Job

352 User Guide

Monitoring Remote IP Addresses on UNIX
To monitor remote IP addresses through the agent, the agent must run as root (on the
CA WA Agent for UNIX, Linux, or Windows) or under a profile with sufficient authority to
use the system ping command (on the CA WA Agent for i5/OS). If the agent runs as a
user without root privileges, a job that monitors a remote IP address shows complete
but with the following message in the status field and transmitter.log:
Ping (ip address) insufficient privilege
Attributes with Default Values
Attributes that have a default value automatically apply to the job definition. Therefore,
you do not have to specify those attributes in the definition. Your agent administrator
can define some default values on the agent in the agentparm.txt file.
If you specify the attribute in a job definition, it overrides the default.

The following IP Monitoring job attributes have default values:
ip_status
Specifies the status of the IP address to monitor.
Default: STOPPED (The job monitors the IP address for a stopped status.)

monitor_mode
Specifies whether the job waits until the monitor conditions are met or tries to
verify them immediately.
Default: NOW (The job checks for the conditions immediately and completes.)
Note: For more information about JIL job types and other job definition attributes, the
values that you can specify for those attributes, and JIL syntax, see the Reference Guide.

 Define an IP Monitoring Job

Chapter 14: Monitoring Jobs 353

Example: Monitor for a RUNNING Status Immediately
The ip_status attribute in the following job definition overrides the default value.
This example monitors a device at IP address 172.31.255.255 and port 7510. When the
job runs, it immediately checks if the device is running. If the device is running, the job
completes successfully.
insert_job: omip_job
job_type: OMIP
machine: monagt
ip_host: 172.31.255.255
ip_port: 7510
monitor_mode: NOW
ip_status: RUNNING
Examples: Monitoring an IP Address
The following examples are IP Monitoring Jobs:
Example: Monitor an IP Address for a Stopped Status
This example monitors a device with DNS name myhost. When the device stops running,
the job completes.
insert_job: omip_job
job_type: OMIP
machine: monagt
ip_host: myhost
ip_status: STOPPED
monitor_mode: WAIT
Example: Monitor an Agent IP Address Specified in Dotted Decimal Format
This example checks whether an application at a specific IP address using a specific port
is running. The IP address is 172.24.2.20 and the input port is 9401. When the job runs,
it checks the status immediately and completes if the application is running.
insert_job: omip_job
job_type: OMIP
machine: SYSAG
ip_host: 172.24.2.20
ip_port: 9401
ip_status: RUNNING
monitor_mode: NOW Define a Process Monitoring Job

354 User Guide

Define a Process Monitoring Job
You can define a Process Monitoring (OMP) job to monitor the status of a process on
the computer where the agent is installed.
Note: To run these jobs, your system requires CA WA Agent for UNIX, Linux, Windows,
or i5/OS.

Follow these steps:
1. Insert a job and specify the following attributes in the definition:
job_type: OMP
Specifies that the job type is Process Monitoring.
machine
Specifies the name of the machine on which the job runs.
process_name
Specifies the name of the process to be monitored.
2. (Optional) Specify optional Process Monitoring attributes:
■ job_class
■ job_terminator
■ monitor_mode
■ process_status
3. (Optional) Specify common attributes that apply to all job types.
The Process Monitoring job is defined.
 Define a Process Monitoring Job

Chapter 14: Monitoring Jobs 355

Notes:
■ Attributes that have a default value automatically apply to the job definitions;
therefore, they are optional. For example, jobs with no specified job type are
defined as command jobs by default. Other optional attributes specify information
that is not required but affects how or when a job runs, such as attributes that
specify scheduling conditions.
■ Some optional attributes are common to all job types but others apply to certain
jobs types only. Optional attributes that apply to all job types are known as
common optional attributes. For more information about common optional
attributes and the values that you can specify for them (including their default
values when applicable), see the Reference Guide.
■ For information about required attributes and job type specific optional attributes,
see the procedure topics that provide instructions for defining jobs.
■ This guide provides instructions for defining jobs interactively. You also create job
definitions in script files and then import them using the jil command or use CA
WCC to define them. For more information about the JIL command and JIL syntax,
see the Reference Guide. For more information about using CA WCC to define the
job, see the CA Workload Control Center Workload Scheduling Guide.

Example: Monitor a Running Process
This example monitors the nlnotes process. By default, the job checks if the process is
stopped. If the process is stopped, the job completes successfully. If the process is
running, the job continues monitoring it until it stops.
insert_job: omp_unix
job_type: OMP
machine: unixagt
process_name: nlnotes
monitor_mode: WAIT
Attributes with Default Values
Attributes that have a default value automatically apply to the job definition. Therefore,
you do not have to specify those attributes in the definition. Your agent administrator
can define some default values on the agent in the agentparm.txt file.
If you specify the attribute in a job definition, it overrides the default.
 Define a Process Monitoring Job

356 User Guide

The following Process Monitoring job attributes have default values:
monitor_mode
Specifies whether the job waits until the monitor conditions are met or tries to
verify them immediately.
Default: NOW (The job checks for the conditions immediately and completes.)
process_status
Specifies the status of the process to be monitored.
Default: STOPPED (The job checks if the process is stopped.)
Note: For more information about JIL job types and other job definition attributes, the
values that you can specify for those attributes, and JIL syntax, see the Reference Guide.


Example: Monitor for a STOPPED Status
The monitor_mode attribute in the following job definition overrides the default value.
This example monitors the server.exe process. The job checks the process status
immediately and completes successfully if the process is running. If the process is
running, the job continues monitoring until the process starts.
insert_job: omp_win
job_type: OMP
machine: winagt
process_name: "c:\Program files\Web_Server\server.exe"
process_status: RUNNING
monitor_mode: WAIT Define a Process Monitoring Job

Chapter 14: Monitoring Jobs 357

Examples: Monitoring Processes
The following examples are Process Monitoring Jobs:
Example: Monitor Multiple Instances
This example monitors the Microsoft SQL Server processes of two instances using the
full path name. When the server process stops, the job monitoring that instance
completes successfully. The first job monitors the sqlserver.exe process in the
…\MSSQL.1\MSSQL\Binn directory. The second job monitors the sqlserver.exe process
in the …\MSSQL.2\MSSQL\Binn directory.
insert_job: mon_sql_server_instance1
job_type: OMP
machine: mssqlserver
process_name: "C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\Binn\sqlservr.exe"
process_status: stopped
monitor_mode: wait
insert_job: mon_sql_server_instance2
job_type: OMP
machine: mssqlserver
process_name: "C:\Program Files\Microsoft SQL
Server\MSSQL.2\MSSQL\Binn\sqlservr.exe"
process_status: stopped
monitor_mode: wait
Example: Monitor the Agent Process on i5/OS
This example monitors the APPLPGM process on an i5/OS computer. The job checks the
process status immediately and completes successfully if the process is running.
insert_job: omp_i5_onejob
job_type: OMP
machine: i5agt
process_name: 123456/PROD/APPLPGM
process_status: RUNNING
monitor_mode: NOW Define a Text File Reading and Monitoring Job

358 User Guide

Example: Monitor Multiple i5/OS Processes That Have Similar Names
This example monitors all processes running on an i5/OS computer under the JDOE user
profile and whose names start with CALC. When all of these processes stop running, the
job completes successfully.
insert_job: omp_i5
job_type: OMP
machine: i5agt
process_name: *ALL/JDOE/CALC*
process_status: STOPPED
monitor_mode: WAIT
Define a Text File Reading and Monitoring Job
You can define a Text File Reading and Monitoring (OMTF) job to search a text file on a
Windows, UNIX, or i5/OS computer for a text string. For example, you can monitor a log
file for an error message after a script executes.
Note: To run these jobs, your system requires CA WA Agent for UNIX, Linux, Windows,
or i5/OS.

Follow these steps:
1. Insert a job and specify the following attributes in the definition:
job_type: OMTF
Specifies that the job type is Text File Reading and Monitoring.

machine
Specifies the name of the machine on which the job runs.

text_file_filter
Defines the text string to search for. You can specify the text string as a regular
expression.
text_file_name
Specifies the path to and name of the text file to search.
 Define a Text File Reading and Monitoring Job

Chapter 14: Monitoring Jobs 359

2. (Optional) Specify optional Text File Reading and Monitoring attributes:
■ encoding
■ job_class
■ job_terminator
■ lower_boundary
■ monitor_mode
■ text_file_filter_exists
■ text_file_mode
■ time_format
■ time_position
■ upper_boundary

3. (Optional) Specify common attributes that apply to all job types.
The Text File Reading and Monitoring job is defined.
Notes:
■ Attributes that have a default value automatically apply to the job definitions;
therefore, they are optional. For example, jobs with no specified job type are
defined as command jobs by default. Other optional attributes specify information
that is not required but affects how or when a job runs, such as attributes that
specify scheduling conditions.
■ Some optional attributes are common to all job types but others apply to certain
jobs types only. Optional attributes that apply to all job types are known as
common optional attributes. For more information about common optional
attributes and the values that you can specify for them (including their default
values when applicable), see the Reference Guide.
■ For information about required attributes and job type specific optional attributes,
see the procedure topics that provide instructions for defining jobs.
■ This guide provides instructions for defining jobs interactively. You also create job
definitions in script files and then import them using the jil command or use CA
WCC to define them. For more information about the JIL command and JIL syntax,
see the Reference Guide. For more information about using CA WCC to define the
job, see the CA Workload Control Center Workload Scheduling Guide.
 Define a Text File Reading and Monitoring Job

360 User Guide

Example: Monitor a File for a Specified String
This example monitors the entire transactions.log file for the ERROR MESSAGE string.
The job waits for the string to be found and then completes successfully.
insert_job: textfile_job
job_type: OMTF
machine: monagt
text_file_name: /export/home/logs/transactions.log
text_file_filter: ERROR MESSAGE
Attributes with Default Values
Attributes that have a default value automatically apply to the job definition. Therefore,
you do not have to specify those attributes in the definition. Your agent administrator
can define some default values on the agent in the agentparm.txt file.
If you specify the attribute in a job definition, it overrides the default.

The following Text File Reading and Monitoring job attributes have default values:
encoding
Specifies the name of the character set used to encode the data in the file.
Default: US-ASCII (The job monitors the file as US-ASCII.)
monitor_mode
Specifies whether the job waits until the monitor conditions are met or tries to
verify them immediately.
Default: WAIT (The job waits until the specified conditions are met before
completing.)
text_file_mode
Specifies the search mode when monitoring a text file.
Default: LINE (The job searches for the text in the specified line boundaries.)
text_file_filter_exists
Specifies whether the job monitors the text file to check if the text string exists or
does not exist.
Default: TRUE (The job checks if the text string exists.)
Note: For more information about JIL job types and other job definition attributes, the
values that you can specify for those attributes, and JIL syntax, see the Reference Guide.

 Define a Text File Reading and Monitoring Job

Chapter 14: Monitoring Jobs 361

Example: Search for Text Between Regular Expressions
The text_file_mode attribute in the following job definition overrides the default LINE
monitor mode.
This example searches the /export/home/systemagent/agentparm.txt file. The search
starts at the first line that contains the word "agent" at the beginning of the line (as
specified by \A in the regular expression specified for lower_boundary) and until it finds
the string "level=2" at the end of a line (as specified by \Z in the regular expression
specified for upper_boundary).
insert_job: omtf_unix_line
job_type: OMTF
machine: monagt
text_file_name: /export/home/systemagent/agentparm.txt
text_file_filter: \.0/MAIN$
text_file_mode: REGEX
lower_boundary: \Aagent
upper_boundary: level=2\Z
monitor_mode: NOW
Example: Specify a Data Encoding Value
The encoding attribute in the following job definition overrides the default US-ASCII
data encoding value.
This example monitors a text file that contains data encoded in the ISO Latin Alphabet
No. 1 (also named ISO-LATIN-1). The job checks the text file immediately and completes
successfully if the specified string is found. If the string is not found, the job fails.
insert_job: textfile_job
job_type: OMTF
machine: monagt
text_file_name: /export/home/logs/transactions.log
text_file_filter: ERROR MESSAGE
text_file_mode: LINE
lower_boundary: 1
upper_boundary: 50
encoding: ISO-8859-1
monitor_mode: NOW Define a Text File Reading and Monitoring Job

362 User Guide

Examples: Monitoring a Text File for Specified Text
The following examples are Text File Reading and Monitoring Jobs:
Example: Search for a Regular Expression
In this example, the text string contains regular expression pattern matching syntax. The
search range is also a regular expression as indicated by the text_file_mode attribute.
insert_job: omtf2
job_type: OMTF
machine: monagt
text_file_name: /export/home/agentdir/agentparm.txt
text_file_filter: ^\w{4,10}\.
text_file_mode: REGEX
lower_boundary: “log*.*”
monitor_mode: now
The regular expression can be interpreted as follows:
■ ^ or \A — match only at the beginning of string (line)
■ \Z or $ — match only at the end of string
■ \w — a word character [a-zA-Z0-9]
■ \W — a non-word character
■ \s — a whitespace character
■ {4,10} — match at least 4 times but not more than 10 times
To illustrate the last item (4, 10), consider the syntax:
text_file_filter: b1{1,3}c
Evaluating this expression yields the following conditions:
■ The line contains the text b1.
■ Numeric 1 should exist at least once, but not more than three times.
■ The specified text string must be followed by the letter c.
 Define a Text File Reading and Monitoring Job

Chapter 14: Monitoring Jobs 363

Example: Search for a String in a File Starting at a Specified Line
This example searches the c:\ca\log file in line mode. The job starts searching the
content from line 143 of the file. The upper boundary is not defined, so the job searches
to the last line of the file. The job completes successfully if the ERROR MESSAGE string is
found.
insert_job: omtf_line
job_type: OMTF
machine: monagt
text_file_name: "c:\ca\log"
text_file_filter: ERROR MESSAGE
text_file_mode: LINE
lower_boundary: 143
monitor_mode: NOW
Example: Search for a String in a File When the Search Mode is REGEX
This example searches the c:\ca\log file in regular expression mode. The lower boundary
is not defined, so the job searches the content from the first line of the file to the upper
boundary (a line that contains the word service). The job completes successfully if the
ARCHIVE string is found.
insert_job: omtf_regex
job_type: OMTF
machine: monagt
text_file_name: "c:\ca\log"
text_file_filter: ARCHIVE
text_file_mode: REGEX
upper_boundary: service
monitor_mode: NOW Define a Text File Reading and Monitoring Job

364 User Guide

Example: Search for a String in a File When the Search Mode is DATETIME
This example searches the /export/home/logs/transmitter.log file in date and time
mode. The job searches the content between May 20, 2010 at midnight and May 27,
2010 at 11:59 p.m. The date and time values are defined using the format specified in
the time_format attribute. The job completes successfully if the transmitted string is
found.
insert_job: omtf_timedate
job_type: OMTF
machine: monagt
text_file_name: /export/home/logs/transmitter.log
text_file_filter: transmitted
text_file_mode: DATETIME
lower_boundary: "Thu May 20 00:00:00.000 EDT 2010"
upper_boundary: "Thu May 27 23:59:59.999 EDT 2010"
time_format: "EEE MMM dd HH:mm:ss.SSS zzz yyyy"
time_position: 12
monitor_mode: NOW
Example: Monitor a Text File Continuously
This example searches the transmitter.log file for the text string "Warning".
insert_job: textfile_job
job_type: OMTF
machine: monagt
text_file_name: /export/home/log/transmitter.log
text_file_filter: Warning
text_file_mode: LINE
lower_boundary: 25
text_file_filter_exists: TRUE
monitor_mode: CONTINUOUS Define a Text File Reading and Monitoring Job

Chapter 14: Monitoring Jobs 365

When the job first runs, it searches the content between line 25 and the end of the file.
An alert is written to the scheduler log file the first time that the string is found. In other
words, suppose that the file contains multiple occurrences of "Warning" between lines
25 to the end of the file, as follows:
.
.
.
25
26 Warning
27
28 Warning
29
30
31 Warning
.
.
.
EOF
When the job first runs, the trigger only occurs at the first occurrence of the text (line
26). Subsequently, the job continues monitoring only the new data that is appended to
the file. An alert is triggered each time the string is found in the appended data.
Note: Alerts are not triggered for new occurrences of the "Warning" string in the data
that has already been searched. For example, suppose that the job has already searched
lines 25 to 100 of the file. The file is then modified to include "Warning" on line 30.
During continuous monitoring, an alert is not triggered for that occurrence.
This job runs until it is completed manually.

Example: Search for a Text String on an i5/OS Computer
This example searches for a text string in the DATA member of a QSYS file object on an
i5/OS computer. The job searches the content between lines 1 and 20. The job
completes successfully if the string is found.
insert_job: textfile_job3
job_type: OMTF
machine: monagt
text_file_name: /QSYS.LIB/LIBRARY.LIB/RESULTS.FILE/DATA.MBR
text_file_filter: Create file failed
text_file_mode: LINE
lower_boundary: 1
upper_boundary: 20
monitor_mode: NOW Define a Windows Event Log Monitoring Job

366 User Guide

Example: Check If a String Does Not Exist in a File
This example searches lines 1 to 200 of the transmitter.log file for the text string
"Warning". If the string is not found, the job completes successfully. If the string is
found, the job fails.
insert_job: textfile_job
job_type: OMTF
machine: monagt
text_file_name: /export/home/log/transmitter.log
text_file_filter: Warning
text_file_mode: LINE
lower_boundary: 1
upper_boundary: 200
text_file_filter_exists: FALSE
monitor_mode: NOW
Define a Windows Event Log Monitoring Job
You can define a Windows Event Log Monitoring (OMEL) job to monitor a Windows
event log in the computer where the agent is running. The monitor returns the most
recent event available or continuously monitors for events in a particular Windows
event log.
Note: To run these jobs, your system requires CA WA Agent for Windows.

Follow these steps:
1. Insert a job and specify the following attributes in the definition:
job_type: OMEL
Specifies that the job type is Windows Event Log Monitoring.

machine
Specifies the name of the machine on which the job runs.
win_log_name
Specifies the name of the event log.
 Define a Windows Event Log Monitoring Job

Chapter 14: Monitoring Jobs 367

2. (Optional) Specify optional Windows Event Log Monitoring attributes:
■ job_class
■ job_terminator
■ monitor_mode
■ win_event_category
■ win_event_computer
■ win_event_datetime
■ win_event_description
■ win_event_id
■ win_event_op
■ win_event_source
■ win_event_type

3. (Optional) Specify common attributes that apply to all job types.
The Windows Event Log Monitoring job is defined.

Notes:
■ Attributes that have a default value automatically apply to the job definitions;
therefore, they are optional. For example, jobs with no specified job type are
defined as command jobs by default. Other optional attributes specify information
that is not required but affects how or when a job runs, such as attributes that
specify scheduling conditions.
■ Some optional attributes are common to all job types but others apply to certain
jobs types only. Optional attributes that apply to all job types are known as
common optional attributes. For more information about common optional
attributes and the values that you can specify for them (including their default
values when applicable), see the Reference Guide.
■ For information about required attributes and job type specific optional attributes,
see the procedure topics that provide instructions for defining jobs.
■ This guide provides instructions for defining jobs interactively. You also create job
definitions in script files and then import them using the jil command or use CA
WCC to define them. For more information about the JIL command and JIL syntax,
see the Reference Guide. For more information about using CA WCC to define the
job, see the CA Workload Control Center Workload Scheduling Guide.
 Define a Windows Event Log Monitoring Job

368 User Guide

Example: Monitor an Application Event Log
This example monitors an Application event log. By default, the job waits until an Error
event occurs before it completes.
insert_job: eventlog_job
job_type: OMEL
machine: monagt
win_log_name: Application
Types of Event Logs
The Windows Event Log Monitoring job only monitors event logs maintained by the
operating system and available in the Event Viewer. Windows operating systems record
events in at least three types of logs, including the following:
Application log
The application log contains events logged by applications or programs. For
example, a database program might record a file error in the application log.

System log
The system log contains events logged by the Windows system components. For
example, the failure of a driver or other system component to load during startup is
recorded in the system log.

Security log
The security log can record security events (such as valid and invalid logon
attempts) and events related to resource use (such as creating, opening, or deleting
files).
For more information on Windows logs, select Start, Settings, Control Panel,
Administrative Tools, Event Viewer. Select any of the three log categories and
double-click to view its property page.

Attributes with Default Values
Attributes that have a default value automatically apply to the job definition. Therefore,
you do not have to specify those attributes in the definition. Your agent administrator
can define some default values on the agent in the agentparm.txt file.
If you specify the attribute in a job definition, it overrides the default.
 Define a Windows Event Log Monitoring Job

Chapter 14: Monitoring Jobs 369

The following Windows Event Log Monitoring job attributes have default values:
monitor_mode
Specifies whether the job waits until the monitor conditions are met or tries to
verify them immediately.
Default: WAIT (The job waits until the specified conditions are met before
completing.)

win_event_type
Specifies the event type to monitor in the Windows event log.
Default: ERROR (The job monitors for the Error event type.)
win_event_op
Specifies a comparison operator against the value of a Windows Event ID.
Default: EQ (The job monitors for an Event ID that is equal to the specified value.)
Note: For more information about JIL job types and other job definition attributes, the
values that you can specify for those attributes, and JIL syntax, see the Reference Guide.


Example: Monitor an Event Log Continuously for Info Events
The monitor_mode, win_event_op, and win_event_type attributes in the following job
definition override the default values.
This example monitors the event log for applications continuously for all instances of an
INFO event type, where the event source is LLDSAPNT223, the event description
contains the word started, and the event ID is less than or equal to 4000. Each time the
specified conditions occur, an alert is written to the scheduler log file.
insert_job: eventlog_job
job_type: OMEL
machine: monagt
win_log_name: Application
win_event_source: LLDSAPNT223
win_event_category: None
win_event_type: INFO
win_event_op: LE
win_event_id: 4000
win_event_description: started
monitor_mode: CONTINUOUS Define a Windows Event Log Monitoring Job

370 User Guide

Examples: Monitoring a Windows Event Log
The following examples are Windows Event Log Monitoring Jobs:
Example: Monitor an Application Log That Occurs on or after a Specified Date
This example monitors an application log that occurs any time on or after January 12,
2010, 6:30 a.m. When the job finds an application log that occurs any time on or after
that date and time, the job completes successfully.
insert_job: win_eventlog
job_type: OMEL
machine: winagent
win_log_name: Application
win_event_type: info
win_event_category: None
win_event_source: LLDSAPNT223
win_event_datetime: "20100112 06:30:00"
Example: Monitor Events with IDs Equal to 0
This example checks for an event ID number less than 1. The job returns the first
application event from the application log that has an event ID equal to 0.
insert_job: eventlog_job
job_type: OMEL
machine: monagt
win_log_name: Application
win_event_op: LT
win_event_id: 1
Example: Monitor a System Event Log
This example monitors a system event log for an event type of WARN, event source of
MrxSmb, and event category of None.
insert_job: eventlog_job
job_type: OMEL
machine: monagt
win_log_name: System
win_event_type: WARN
win_event_source: MrxSmb
win_event_category: None Define a Windows Service Monitoring Job

Chapter 14: Monitoring Jobs 371

Example: Monitor a Security Event Log for Audit Success Events
In this example, the security log is monitored for a successful audit of a security access
attempt. The event category is System Event, the term succeeded is excluded, but the
words Audit and log are included in the event description.
insert_job: eventlog_job
job_type: OMEL
machine: monagt
win_log_name: Security
win_event_type: AUDITS
win_event_category: System Event
win_event_source: Service Control Manager
win_event_description: "-succeeded +Audit log"
Example: Monitor a System Event Log for Particular Errors
In this example, the event description must include the words conflict and state as
indicated by the plus signs but must exclude the words deny, master, or browser as
indicated by the minus sign. The plus sign is the default and is optional.
insert_job: eventlog_job1
job_type: OMEL
machine: monagt
win_log_name: System
win_event_type: ERROR
win_event_description: "+conflict +state -deny -master -browser"
Example: Monitor an Application Log for Events Indicating Normal Shutdown
In this example, the event description must include the words Normal shutdown. This
example does not use the plus sign, and by default, the specified words are included in
the search.
insert_job: eventlog_job2
job_type: OMEL
machine: monagt
win_log_name: Application
win_event_type: INFO
win_event_description: "Normal shutdown"
Define a Windows Service Monitoring Job
You can define a Windows Service Monitoring (OMS) job to monitor a service on a
Windows computer where the agent is running.
Note: To run these jobs, your system requires CA WA Agent for Windows.
 Define a Windows Service Monitoring Job

372 User Guide

Follow these steps:
1. Insert a job and specify the following attributes in the definition:
job_type: OMS
Specifies that the job type is Windows Service Monitoring.

machine
Specifies the name of the machine on which the job runs.
win_service_name
Specifies the name of the local Windows service to be monitored.

2. (Optional) Specify optional Windows Service Monitoring attributes:
■ job_class
■ job_terminator
■ monitor_mode
■ win_service_status

3. (Optional) Specify common attributes that apply to all job types.
The Windows Service Monitoring job is defined.

Notes:
■ Attributes that have a default value automatically apply to the job definitions;
therefore, they are optional. For example, jobs with no specified job type are
defined as command jobs by default. Other optional attributes specify information
that is not required but affects how or when a job runs, such as attributes that
specify scheduling conditions.
■ Some optional attributes are common to all job types but others apply to certain
jobs types only. Optional attributes that apply to all job types are known as
common optional attributes. For more information about common optional
attributes and the values that you can specify for them (including their default
values when applicable), see the Reference Guide.
■ For information about required attributes and job type specific optional attributes,
see the procedure topics that provide instructions for defining jobs.
■ This guide provides instructions for defining jobs interactively. You also create job
definitions in script files and then import them using the jil command or use CA
WCC to define them. For more information about the JIL command and JIL syntax,
see the Reference Guide. For more information about using CA WCC to define the
job, see the CA Workload Control Center Workload Scheduling Guide.
 Define a Windows Service Monitoring Job

Chapter 14: Monitoring Jobs 373

Example: Monitor a Windows Service
This example monitors a Windows service named App Server. The win_service_status
attribute is not specified in the job definition, so the job monitors for a RUNNING status
by default. The job completes when the service is running.
insert_job: oms_job2
job_type: OMS
machine: winagt
win_service_name: App Server
monitor_mode: WAIT
Attributes with Default Values
Attributes that have a default value automatically apply to the job definition. Therefore,
you do not have to specify those attributes in the definition. Your agent administrator
can define some default values on the agent in the agentparm.txt file.
If you specify the attribute in a job definition, it overrides the default.

The following Windows Service Monitoring job attributes have default values:
monitor_mode
Specifies whether the job waits until the monitor conditions are met or tries to
verify them immediately.
Default: NOW (The job checks for the conditions immediately and completes.)
win_service_status
Specifies the status of the Windows Service to be monitored.
Default: RUNNING (The job checks if the Windows service is running.)
Note: For more information about JIL job types and other job definition attributes, the
values that you can specify for those attributes, and JIL syntax, see the Reference Guide.

 Define a Windows Service Monitoring Job

374 User Guide

Example: Monitor for a PAUSED Status Immediately
The win_service_status attributes in the following job definition overrides the default
value.
This example monitors a Windows service named Proc Server. The job checks the status
immediately and completes successfully if the service is paused. If the service is not
paused, the job fails.
insert_job: oms_job1
job_type: OMS
machine: winagt
win_service_name: Proc Server
win_service_status: PAUSED
monitor_mode: NOW
Examples: Monitoring Windows Services
The following examples are Windows Services Monitoring Jobs:
Example: Monitor for the Existence of a Windows Service
This example monitors a Windows service named Proc Server. The job completes
successfully if the service exists. By default, the job checks for the condition immediately
and completes, so the monitor_mode attribute is not required in the job definition.
insert_job: oms_job1
job_type: OMS
machine: winagt
win_service_name: Proc Server
win_service_status: EXISTS
Example: Specify a Path to a Windows Service Executable
This example monitors a Windows service named Log App. The job waits until the
service status is CONTINUE_PENDING before it completes.
insert_job: oms_job2
job_type: OMS
machine: winagt
win_service_name: "C:\Program Files\Log App\apptask.exe"
win_service_status: CONTINUE_PENDING
monitor_mode: WAIT Define a Windows Service Monitoring Job

Chapter 14: Monitoring Jobs 375

Example: Check a Service Status Immediately
This example monitors the schedmanager service for a status of RUNNING. The job
checks the status immediately and completes successfully if the service is running. If the
service is not running, the job fails.
insert_job: oms_job3
job_type: OMS
machine: winagt
win_service_name: schedmanager
win_service_status: RUNNING
monitor_mode: NOW


No comments:

Post a Comment