HP Systems Insight Manager 6.0 Command Line Interface Guide

Using the c option to create a task can be complicated if all of the options are required to properly define
the task. You can create a task by defining the task in XML format, and use the mxtask command use the
XML definition. The command is:
# mxtask cf taskfile.xml
The XML format for the task is defined in the mxtask(4) man page. The general format of the XML syntax
for the task is:
<?xml version="1.0" encoding="UTF-8"?>
<task-list>
<task name="task name" type="add|remove|manual|schedule" owner="taskowner"
runmode="runnow|runatstartup">
<toolname>tool name</toolname>
<queryname>query name</queryname>
<scheduleinfo interval="x" periodic="x" time="x" day="x" date="x"/>
<timefilter />
<toolparams />
</task>
</task-list>
To remove an existing task, enter:
# mxtask r taskname
Where taskname is the name of the task you want to remove.
To run an existing task immediately, enter:
# mxtask e taskname
To change the owner of a task, use the o option, for example:
# mxtask o taskname newowner
In this example, newowner, an existing user in HP SIM, becomes the owner of the task taskname. To execute
this command, you must have the authorization to change task ownership (see “Managing users and
authorizations).
There are different options available for displaying task information. To see a tabular list of all exiting tasks
in HP SIM, use one of the following commands:
# mxtask
# mxtask lt
The output is a table that displays the task name, the name of the tool associated with the task, the time the
task was last run, and the schedule for the task. To see details about a specific task, use, # mxtask ld
taskname
This command displays the name of the task, tool, and collection associated with the task, task owner, task
schedule information, the times of the last run and next run, the last time the task was modified, and XML
format of any parameters for the tool associated with this task.
The lf option displays the task definition in XML format. By using file redirection, you can save the output
for use in creating additional tasks. For example, # mxtask lf Daily Device Identification
displays on the terminal the XML for the “Daily Device Identification” task. However, # mxtask lf
Daily Device Identification > deviceid.xml saves the XML for the “Daily Device
Identification” task in the file deviceid.xml.
There is additional information beyond the data provided in the man pages for mxtask. This information
is displayed on the console terminal, and is available by using the following command:
# mxtask h
HP recommends that the output be piped to more or redirected to a file for easier viewing.
Managing task execution
The mxexec command enables you to execute tools that are defined in HP SIM, whether those tools are HP
SIM tools, or tools that you have created. As discussed in the previous section, mxtask is used to create
tasks to enable scheduled execution of tools, and mxexec is used for immediate execution of a tool, as well
124 Infrastructure management using CLI