Scheduling in IBM Director

Schedule simple tasks, view the scheduler calendar, see the running task, a

Over the past several columns, I've written about the wide variety of tasks you can perform using IBM Director to manage your System i. Whether it's i5/OS, Linux, Windows, AIX, HMC, or related storage devices, IBM Director can manage it all.

This month I want to highlight IBM Director's scheduling ability. Here, I show you how to schedule a simple task, view the scheduler calendar, and see running tasks and their progress. I also discuss some special considerations you should know about.

A Little Terminology

Before we get started, a little education on the terminology that IBM Director uses is needed:

  • Interactive task is a task in IBM Director that requires user input before it can be run. Usually, these tasks can't be scheduled. Examples include viewing the event log, setting a threshold, or creating a virtual server.
  • Noninteractive task is a task in IBM Director that does not require user input before it can be run. All the task needs is a target system or group to be identified, and then it is ready to run. Usually, these tasks can be scheduled. Examples include power on, collect inventory, or running a saved customized task such as a process task or a saved relocate virtual server task.
  • Job is an instance of a task. In other words, a job is an object in IBM Director that receives a task, the custom parameters specified by the user, and the target system, and then the job combines it all to perform the work and track its progress. For example, if I select to collect inventory, the task is "collect inventory," but once I say to schedule it, a job is created. The job knows it should run once a week at 2:00 a.m. on a group called "i5 Systems," and if the task fails on any system, the job must send an event.

Schedule Your First Task

Okay, let's give it a try. The simplest way to schedule a task is to select a system, right-click, and choose Power Off. Immediately you will receive a dialog asking, "Do you wish to create a scheduled job for this task or execute immediately?" (Figure 1).

If you select Schedule, a basic schedule dialog will appear. If you need to schedule the task only once, this basic schedule dialog works well. However, many times you will want to schedule the task to run weekly or in other combinations, or you may have additional options to set. For this, select the Advanced button (Figure 2) to display the advanced job scheduler.

Viewing Your Scheduled Jobs

Once your job is scheduled, you'll want to view it. To do so, simply select the Scheduler toolbar to display the initial Month view (Figure 3). Any job that is scheduled will appear in the day it is schedule to run. As you can see, repeated tasks show up in each day they are scheduled for. Additional views include the Week, Day, and Jobs — which displays all the jobs in a list, with additional details available when a job is selected.

When the job starts running, the Jobs view is the most interesting. From here, you can see the detailed status of the job. In Figure 4, notice that the job is called "Collect on i5 Systems." That is a name I gave it, and every time the job runs, it has a date indented under it. If you schedule it weekly, eventually you will have several dates under the job you created. Also, when you select one of the dates, you will see the current status for each system the job is running on. As Figure 4 shows, inventory is being collected on six systems that are in different statuses.

Finally, at each level you can view the job log history. Figure 5 displays the job log for the collect inventory job, which combines status logs for all systems. You could drill down even more into each system that you've targeted.

Advanced Scheduling

Now let's set up some advanced scheduling options. As I mentioned earlier, you could click Advanced in the basic schedule dialog. You could also create a scheduled job right from the scheduler window. This is useful because you can select the day you want to have inventory collected, choose New Job, and then specify the task and targets. Either way, you will end up with a dialog containing four tabs (Figure 6): Date/Time, Task, Targets, and Options.

The Date/Time tab shows a summary of when the job will run, and if you click Repeat, you will see Figure 7, which presents many advanced options for setting up a repeating scheduled job. One important note: The time you select for the job to run is the time on the IBM Director server. That means that if you collect inventory at 2:00 a.m., it will be 2:00 a.m. Director server time, not the time of the system you've targeted. If you want to specify to run the task based on the target system time, open the Options tab and select "Execute in client time zone." And in this case, the word "client" means the target system, not the graphical client.

The Task tab lists all the tasks that you can schedule. As Figure 8 shows, the tasks are grouped into major categories that can be expanded. Simply select a task and click Select (or drag and drop the task to the right side). After the task appears on the right side, you can add another task. Tasks on the right side are run in the order they are listed. It doesn't matter whether the task works or not — as soon as the task is completed, the next task will run.

Note: To have more creativity in when a task runs based on whether the previous one succeeded, look into the Event Action Plans. Using both scheduled jobs and Event Action Plans, you can create a workflow of sorts that runs a single task at a scheduled time; that task then generates an event (see the Options tab again) to communicate whether it succeeded or failed. Then, an Event Action Plan can listen for one of those events, and if the scheduled task succeeded, it can run task2, but if it failed, it can run task3 instead.

The Options tab (Figure 9) provides options for specifying which system's time to base the schedule on, options for generating events, and a couple more options worth mentioning. "Delay execution on unavailable systems" is helpful for tasks that you want run as soon as a system is restarted. This option keeps the task active and the individual system status as Pending until the system is available. "Execute on systems that are added to the target group" should always be selected when you specify a group of systems. This option means that if you schedule a collect inventory to run weekly on your i5/OS Systems group, whenever you add a new i5/OS system, inventory will be collected on the newly added systems the next time the scheduled job runs. This is a must.

Scheduling CL Commands

To schedule running CL commands is fairly straightforward, but there are a few steps to note. Make sure to create a process task that lists the CL command you want to run, along with the user ID/password you want to run as, and most importantly, select the Log check box (Figure 10). The reason for doing so is that once the job is scheduled, if it does not wait for the command to end, it will always say "job completed successfully." That's because it only makes sure the command was started properly. If you select the Log check box, not only does the job show the status more accurately, but it also displays the command messages in the log (Figure 11).

The end result is that you can schedule a sequence of your favorite CL commands to run from IBM Director. You could even run a CL command before or after a Collect Inventory task — it's all up to you.

Scheduling Discovery

One last bit of info to know is how to schedule Discovery. Strangely, you won't use anything I just talked about. Discovery Preferences are available from the Director Console under the Options menu. The Discovery Preferences window shows the various types of resources that IBM Director can discover, and each tab asks how often you want that kind of resource discovered. Figure 12 shows IBM Director Agents preferences. Unlike the calendar and job option, this option simply asks how frequently to discover level-2 agents "Auto-discover period (hours)."

After you've set these options, discovery will happen as frequently as specified for that type of object. One other note about Discovery: There is a Discovery toolbar button that is easy to select, but when selected, it will automatically discover all resource types in your data center based on those discovery preferences. I suggest hiding that task for most users and letting only your lead administrators see it. Your network will thank you.

Loads of Features

Scheduling in IBM Director offers many features to help you with the daily management of your systems, as well as keeping your i5/OS systems in line via scheduled CL commands. For more information about process management in IBM Director, check out the IBM Director site (ibm.com/systems/management/director).

Greg Hintermeister works at IBM as a user interaction designer and is an IBM master inventor. He has extensive experience designing user interaction for IBM’s systems management and virtualization products, wireless applications, and numerous web applications. Greg is a regular speaker at user groups and technical conferences.

ProVIP Sponsors

ProVIP Sponsors