lsjob command
Use the lsjob command to list information about scheduled tasks (called jobs).
Synopsis
smcli lsjob [-h | -? | --help]
smcli lsjob [-v] -J {low | medium | high} job
smcli lsjob [-v] [-m] [-s {status}] [-t system_type] [-o | -p] [-l] [-f file_name | -w query | -i ip_address_list | -N group_list | [-n] system_list| [-j] job_list]
Description
If no options are specified, this command displays the job name for all jobs.
If this command targets systems, it displays all jobs scheduled for those systems. If the command targets jobs, it displays information about the jobs, including on which systems a job is scheduled.
Operands
This command optionally uses a list of job names or ID as an operand. The list can optionally be preceded by the -j | --jobs option.
Options
- -f | --file {file_name | -}
- Retrieves data either from the input file file_name or
from input piped from another command.
To retrieve input piped from another command, specify a hyphen (-) instead of a file name (for example, smcli cmd1 | smcli cmd2 -f -). To retrieve input from a file, specify the full path. If the path contains spaces, enclose it in quotation marks.
- The input data is the list of jobs to be displayed. This list can be a mixture of job names and ID, separated by commas or line breaks.
- -h | -?
- Displays the syntax and a brief description of the command. Tip: If you specify additional options other than -h | -? | --help, the options are ignored.
- --help
- Displays detailed information about the command, including the
syntax, a description of the command, a description of the options
and operands, error codes, and examples. Tips:
- If you specify additional options other than -h | -? | --help, the options are ignored.
- You can also display detailed help in the form of man pages using the man command_name command.
- -i | --ipaddress {ip_address | host_name}[,{ip_address | host_name}...]
- Targets one or more systems, specified
by IP address or host name.
The list can be a mixture of IP addresses and host names, separated by a comma.
- ip_address
- The IP address of the system.Tips:
- You can enter lssys -A IP_address to list the IP address of each discovered system.
- You can use either the IPv4 or IPv6 format to specify the IP address.
- host_name
- Either the host name or the host name and Domain Name System (DNS)
suffix of the system. If the host name contains spaces, enclose it in quotation
marks. If it contains a comma, prefix the comma with a backslash (\).Tips:
- You can enter lssys -A HostName to list the host name of each discovered system.
- The host names are not locale specific.
- A given IP address or host name might resolve multiple systems. For example, both the OperatingSystem and Server instance of a particular system will have the same host name. Use system Object ID (option -n) to target a system uniquely.
- -j | --jobs {job_oid | job_name}[,{job_oid | job_name}...]
- Targets one or more jobs, specified by names or ID.
This list can be a mixture of job names and ID, separated by a comma.
- job_oid
- The unique job ID, specified as a hexadecimal value prefixed with
0x (for example, 0x54).Tip: You can use the lsjob -o command to get a list of all job IDs.
- job_name
- The name of the job. Tips:
- Job names might not be unique. This command acts on all jobs with the specified name. Use the -v | --verbose option to generate a message when this command targets multiple jobs with the same name. To target a job that has a name that is not unique, identify the job by specifying its unique, hexadecimal group ID, or use additional target options to refine the selection.
- The job name can be locale specific. The name specified must match the locale being used by the command line interface.
- If the job name contains a comma, prefix the comma with a backslash (\).
- You can use the lsjob command with no options to get a list of all job names.
- -J | --joblog [low | med | high]
- Displays the job log for the specified job. You display the log for only one job at a time. Specify low, med (medium), or high to identify the level of detail to display in the job log. The default value is low.
- -l | --long
- Displays detailed information about the specified jobs.
This option returns these attributes for each job:
- Job name and ID
- Task performed
- Targeted system names
- Name of the user that created the job
- Email address of the user that created the job
- Notification condition
- Notification server
- Last run date and time
- Next scheduled run date and time
- Tasks
- Status of the job. Values are Completed and Scheduled.
- Next scheduled date and time. This field is empty if the job does not repeat.
- Status
- -m | --summary
- Displays scheduled jobs that ran in the last 30 days.
- -n | --names {system_oid | system_name}[,{system_oid | system_name}...]
- Targets one or more jobs scheduled for the specified systems, identified
by name or ID. The list can be a mixture of system names
and IDs, separated by a comma.
- system_oid
- The unique ID of the system, specified
as a hexadecimal value prefixed with 0x (for example, 0x37)
or a decimal value (for example, 123).Tip: Use the lssys -o command to list all system IDs.
- system_name
- The name of the system.
If the system name
contains a comma, prefix the comma with a backslash (\).Tips:
- The system names might not be unique. This command acts on all systems with the specified name. Use the -v | --verbose option to generate a message when this command targets multiple systems with the same name. To target a particular system that has a name that is not unique, identify the system by specifying its unique, hexadecimal ID, or use additional target options to refine the selection.
- Use the lssys command without any options to list all system names.
- The system names are not locale specific.
- -N | --groups {group_oid | group_name}[,{group_oid | group_name}...]
- Targets one or more jobs scheduled for the specified groups, identified
by name or ID. The list can be a mixture of group names and IDs, separated
by a comma.
If the same systems are members of more than one group, they are targeted only once.
- group_oid
- The unique ID of the group, specified as a hexadecimal value prefixed
with 0x (for example, 0x3e7). Tip: Use the lsgp -o command to list all group IDs.
- group_name
- The name of the group. If the group name contains spaces, enclose
it in quotation marks. If it contains a comma, prefix the comma with
a backslash (\) and enclose the name in quotation
marks.Tips:
- Group names are unique.
- Use the lsgp command without any options to list all group names.
- The group names are not locale specific.
- -o | --oid
- Displays the unique IDs associated with the targeted jobs. The
IDs are displayed as hexadecimal values, prefixed with 0x (for example, 0x3e).Tip: You cannot use this option with the -p | --pipe option.
- -p | --pipe
- Displays only the unique IDs for the targeted jobs. IDs are displayed
as hexadecimal values, prefixed with 0x (for example, 0x37).Tips:
- Use this option to pipe output from this command into other smcli commands.
- This option cannot be used with the -o | --oid options.
- -s | --status {scheduled |running | inactive | complete }
- Lists all the jobs with the specified status. You can specify
one of these values:
- scheduled - Scheduled status lists all jobs that have not run before and are currently scheduled.
- running - Running status shows all jobs that have future scheduled runs and are enabled.
- inactive - Inactive status shows all jobs that have been disabled.
- complete - Completed status shows all jobs that have completed and with no future scheduled runs
- -t | --type system_type
- Targets jobs that run on systems of the specified
type.
The system types are organized in a hierarchy in which child subtypes extend parent types. When you specify a parent type (for example, Platforms), its children (in this case, PhysicalPlatforms) are also targeted.
Tips:- This options is not a targeting option by itself. It must be used with another targeting option, such as -n | --names or -i | --ipaddress.
- You can use this option in conjunction with other targeting options; however, this targeting option acts before all other targeting options.
- Use the lssys -T command to obtain a list of valid system types.
- The system types are not locale specific.
- -v | --verbose
- Writes verbose messages to standard output.
If this option is not specified, this command suppresses noncritical messages.
- -w | --where "query"
- Targets jobs that run on one or more systems based on system attributes
specified by query.The query operand is a string, enclosed in quotation marks, that defines a simple SELECT query using the following format:
"attribute_key=value [{AND | OR} attribute_key=value...]"
where attribute_key can be any valid attribute, and value is the value of the attribute. The value must match the expected type for the associated attribute. For example, if the attribute is of type integer, an integer must be specified.
Tips:- Use logical operators AND or OR to combine attributes.
- Use parentheses to create nested logical constructs.
- The query operand must be enclosed in quotation marks. Do not use double quotation marks in the query.
- If the value contains spaces, enclose it in single quotation marks.
- Only system attributes can be specified. Use the lssys -l command to list the available system attributes.
Exit status
The following codes are returned by this command.- 0: The operation completed.
- 1: A usage error occurred.
- 2: The command or bundle was not found.
- 3: The command was not performed because either authentication failed or you are not authorized to perform the action.
- 10: The file was not found.
- 20: A specified system is not valid.
- 21: A specified system group is not valid.
- 25: A number-formatting error occurred.
- 26: A specified system type is not valid.
- 29: The specified locale is not valid or not supported.
Examples
- List all scheduled jobs
This example illustrates how to list all scheduled jobs.
smcli lsjob cleareventlog download updates collectinventory powerdown
- Display detailed information about a specific job using the job
ID
This example illustrates how to display detailed information about a job with job ID 0x7d.
Tip: For jobs that are yet to be run, the status would be scheduled. The Next Run attribute is blank for jobs that do not repeat.smcli lsjob -l 0x7d Job: collectinventory, 0x7d Tasks: Collect Inventory Targets: dbserver, dataBK, bobmachine Creator Name: ibm user Creator E-mail: ibmUser@server.ibm.com Notification Condition: None Notification Server: localhost.austin.ibm.com Notification Server Port: 9090 Last Run: June 20, 2007 8:00:00 AM CDT Next Run: June 20, 2007 9:00:00 AM CDT Status: Active
- List all completed jobs
This example illustrates how to list all completed jobs with the status complete.
smcli lsjob -s complete cleareventlog download updates collectinventory
- List jobs scheduled to run on a specific type of system
This example illustrates how to list all jobs that are scheduled on systems with a type of Clusters.
smcli lsjob -t Clusters cleareventlog download updates
- Display a job log
This example illustrates how to display the job log for the job with job ID 0x50:
smcli lsjob -J high 0x50 JobLog for job: 0x50 11/30/2006 6:08:35 PM Job "MakeError" activated. 11/30/2006 6:08:35 PM Subtask "Collect Inventory" activated. 11/30/2006 6:08:35 PM Starting clients 11/30/2006 6:08:35 PM Clients started for task "Collect Inventory" 11/30/2006 6:08:35 PM Subtask instance status changed to "Active". 11/30/2006 6:08:36 PM Job instance status changed to "Active". 11/30/2006 6:08:36 PM 2FDIBM407 client job status changed to "Pending". 11/30/2006 6:08:36 PM The collection failed due to a security failure for client 2FDIBM407. 11/30/2006 6:08:36 PM 2FDIBM407 client job status changed to "Error". 11/30/2006 6:08:36 PM Subtask instance status changed to "Complete". 11/30/2006 6:08:36 PM Job instance status changed to "Active with errors". 11/30/2006 6:08:36 PM Job instance status changed to "Complete with errors".
- List jobs running on a system
This example illustrates how to list all jobs that can run on the system named system1.
smcli lsjob -n system1 cleareventlog download updates collectinventory
- List job summary
This example illustrates how to list a summary of scheduled jobs in the last 30 days.
smcli lsjob -m Number of jobs scheduled: 3 Number of jobs complete successfully: 0 Number of jobs failed with errors: 19 Upcoming job runs: 1/24/08 3:22 PM, Task1 1/24/08 3?50 PM, Task3 1/24/08 4:06 PM, Task4 Most recent job runs: 1/24/08 3:06 PM, Task1 Active 1/24/08 2:50 PM, Task1 Completed