System Center is Microsoft’s suite of computer management products. The most popular of these products are Configuration Manager, Operations Manager and Virtual Machine manager. But if you’ve been listening closely in sessions, you’ve probably heard about System Center Orchestrator and how you can use it to tie the disparate components in your datacenter together.
Even though you’ve heard about Orchestrator, you might not have actually used Orchestrator to build a runbook to perform a task. The best way to learn Orchestrator is to start using it. In this article I’ll take you through the basics of building a runbook that will perform a simple task. It will check the status of a particular service, in this case the World Wide Web Publishing service, and if the service is stopped, the service will be started. Once you understand how a basic runbook works, you can consult books at Safari’s Online library to learn how to build more complicated runbooks. You can find out more about System Center Orchestrator in Chapter 17, System Center Orchestrator 2012 Design, Planning, and Implementation of Microsoft System Center 2012 Unleashed.
To start with, if you’ve watched a few Microsoft Management Summit (MMS) presentations, you’ll have seen the Orchestrator Runbook Designer. The Runbook Designer provides you with the canvas upon which you build your runbooks. You build a runbook by dragging together, connecting, and configuring activities.
Orchestrator ships with a default set of activities. These activities allow you to automate tasks using Orchestrator. You can add extra activities to Orchestrator by importing Integration Packs. The default installation of Orchestrator 2012 includes the following activities:
- System. This includes tasks such as Run Program, Start/Stop Service, End Process, and Restart System.
- Scheduling. This includes the Monitor Date/Time and Check Schedule tasks.
- Monitoring. This includes the Get Computer/IP Status, Get Service Status, Monitor Event Log, and Monitor Service status tasks.
- File Management. This includes the Compress File, Create Folder, PGP Encrypt File and Rename File tasks.
- Email. The only activity in this category is Send Email.
- Notification. Includes the Send Event Log Message, Send Platform Event, and Send Syslog Message.
- Utilities. Contains items such as Map Network Path, Query Database, Connect/Disconnect Dial-Up, Write Web Page and Read Text Log.
- Text File Management. Includes items such as Append Line, Find Text, Insert Line, Search and Replace Text.
- Runbook Control. Includes items such as Initialize Data, Return Data, Junction, and Invoice Runbook.
Building a runbook involves knowing what the tasks do. For example, the Get Service task allows you to get the status of a specific service on a specific computer. In the Exhibit you can see that Get Service Status is configured to find the status of the World Wide Web Publishing service on LON-SM1.
If you created a runbook with just this content and then ran it in the runbook tester, you could see what the result looked like. As the exhibit shows, if the service is running, the task returns “Service running” as shows in the exhibit. If the service is stopped, the task shows the service status as “Service stopped”.
Once we understand how the Get Service Status task works, we need to then configure the Start/Stop Service task. We do this by dragging the task from the list of activities and then using the runbook designer to connect them as shown in the Exhibit.
Once we’ve linked the two tasks, we need to configure the conditions under which the link is used. We only want the Start/Stop Service task to be triggered if the service is in a stopped state. To do this, we double click on the line between the two tasks and configure the properties under which the link is used. As the exhibit shows, we set this so that if the Get Service Status task returns Service stopped, the link is used.
Once we’ve configured the link, we need to configure the Start/Stop Service task. When configuring this task, we need to configure an Action. As we want to have the service Started if it is stopped, we choose the Start service action as shown in the Exhibit. In the Execution area, we could simply enter the name of the Computer and the Service as we did in the Get Service Status task, but as we’ve already provided that information, what we can do instead is subscribe to that existing data. When we subscribe to data, we take data that already has been entered and use it again. To make this runbook even more useful, we could have configured the Get Service Status task to subscribe to input data, so that we could manually enter the computer and service name rather than having them entered through the runbook designer.
This basic runbook is ready to go. When executed it will check the status of the World Wide Web Publishing service and if it’s in a stopped state, it will restart it.
In this short article you’ve learned the basic principles of building Orchestrator runbooks: configuring tasks, subscribing to data, and configuring links between tasks.
Safari Books Online has the content you need
Check out these books that will help you master the use of Microsoft System Center 2012 Orchestrator Runbook:
|Microsoft® System Center 2012 Unleashed is the definitive real-world guide to Microsoft System Center 2012, Microsoft’s newest and most powerful version of System Center. You’ll learn how to use System Center’s powerful capabilities to build highly-efficient managed environments that encompass datacenters, cloud environments, client computers, mobile devices, and more. The authors address planning, design, implementation, integration, and administration, and cover every component, including Configuration Manager, Operations Manager, Data Protection Manager, Virtual Machine Manager, Service Manager, and Orchestrator.|
|Mastering System Center 2012 Operations Manager introduces many exciting new and enhanced System Center 2012 feature sets that allow for large-scale management of mission-critical servers. This comprehensive guide provides invaluable coverage to help organizations monitor their environments across computers, network, and storage infrastructures while maintaining efficient and effective service levels across their applications.|
|System Center 2012 Operations Manager Unleashed, Second Edition is the first comprehensive Operations Manager 2012 technical resource for every IT implementer and administrator. You’ll find all the information you need to efficiently manage cloud and datacenter applications and services in even the most complex environment. The authors provide up-to-date best practices for planning, installation, migration, configuration, administration, security, compliance, dashboards, forecasting, backup/recovery, management packs, monitoring including .NET monitoring, PowerShell automation, and much more.|
About the author
|Orin Thomas is an MVP, an MCT and has a string of Microsoft MCSE and MCITP certifications. He has written more than 25 books for Microsoft Press and is a contributing editor at Windows IT Pro magazine. He has been working in IT since the early 1990’s. He regularly speaks at events like TechED in Australia and around the world on Windows Server, Windows Client, System Center and security topics. Orin founded and runs the Melbourne System Center Users Group. You can follow him on twitter at http://twitter.com/orinthomas.|