9.8. Использование CLI

9.8.1. Creating and managing a situation

Before you do this task, run through the task of creating a basic situation (in Creating a situation) so that you have a situation to work with.

For this procedure, create a new situation based on the My_Situation situation. Run the following steps on the computer where you installed the monitoring server:

1.Open a command line window.

2.Change to the directory where you installed IBM Tivoli Monitoring.

3.Change to the \BIN subdirectory.

4.Run the following command to log into the computer:

tacmd login -s hostname -u sysadmin

where hostname is the host name of your monitoring server.

5.Press Enter when you are prompted for a password. Do not type a password.

Note:

You might still see a blinking cursor after you press Enter. Do not press Enter again. Wait a few minutes for the command to process.

6.Run the following command to export the details of my_situation to a file:

tacmd viewSit -s My_Situation -e viewmysituation.out

7.Edit the output file in a text editor to change one situation variable - Interval. Change the following values:

SITNAME

Change from My_Situation to new_situation

REEV_TIME

Change from 000030 to 001500

8.Run the following command to create the new situation.

tacmd createSit -i viewmysituation.out

To view your new situation, you can either run the tacmd viewSit command again, using the new situation name, or open the Tivoli Enterprise Portal and look there.

To view all of the situations on your monitoring server, run the following command:

tacmd listSit

Now we'll delete new_situation. Run the following command:

tacmd deleteSit -s new_situation -f

The -f parameter prevents a confirmation from displaying before the situation is deleted.

You can use the preceding commands to export a situation from one monitoring server and import it on another. To import a situation from Computer A to Computer B do the following steps:

1.On Computer A, where the situation already exists, run the tacmd viewSit -s situation_name -e filename command.

2.Transfer the output file to Computer B.

3.On Computer B, where you want to create the situation, run the tacmd createSit -i filename command. If a situation with the same name does not already exist on Computer B, you need not edit the output file to change the situation name (as in the preceding procedure).