Automation of two HP Systems Insight Manager 5.3 servers to provide Failover Event Handling Table of Contents Introduction......................................................................................................................................... 2 Creating a Custom Events List................................................................................................................ 4 Creating a Custom Systems List ..........................................................................
Introduction In very large environments, one HP Systems Insight Manager (HP SIM) may not provide all the coverage needed for all the devices in disaster recovery (DR). It might be desirable to have two HP SIM servers covering for each other. In this scenario, we will create a set of Event Handlers which allow two HP SIM (Central Management Server or CMS) servers to specifically watch each other and take over coverage for the other’s Event Notification in the event of failure of one CMS.
Figure 1 Normal Operation When Server B dies, then Server A processes events for Servers in B’s territory until Se rver B comes back, because all agents are configured to send events to both servers, no changes are needed to agents for achieving failover.
Both CMSes have a full population of all devices in both territories, events from CMS A are active only for A’s devices; likewise for B’s. All agents send events to both CMSes. Events received by a CMS for devices in the others territory are ignored and/or purged until partner CMS is determined to be unavailable. See Appendix B for instruction on purging events. Creating a Custom Events List You must create a Custom Event List for the events that you are interested in handling.
2. Wait for a minute after clicking New and notice the New Collection at the bottom of the screen. Select Choose members by Attribute. Figure 4 New Customize Collections 3. Select Event Type is from where combo box and select the set of events you are interested in as shown below. Click Add to add other event criteria.
Figure 5 Add Customize Collections 4. Click Save As to save the Collection and give it a name. For example, you could enter the name MRO Events, select Events By Severity from the Existing Collection dropdown list, and click OK to save.
Figure 6 Save As Collection 5. Create two of these collections, in this case one for City A and one for City B. Creating a Custom Systems List Use Customize link to create system collection. To create a custom system collection or list: 1. Click on Customize (see the red oval). The Customize Collections screen appears. Select Systems (see green oval) from the dropdown list and click New.
Figure 7 Create a Custom Systems List 2. After waiting a minute after clicking New, the New Collection appears at the bottom of the screen. Select Choose members by Attribute.
Figure 8 New Collection 3. From the dropdown list under New Collection, select the set of devices to create a system collection where it can be System Name Starts With (see red oval below). In this case the letters dc – so we are looking for all servers whose names start with the letter dc. Fit the naming scheme to your environment or with any other system criteria.
Figure 9 System Name Starts With 4. Click Save As to save the collection and give it a name. In the example, the name CITYB Systems was used. Click OK to save the settings. This collection can be used to create a handler.
Figure 10 Save as Collection 5. Create two of these collections, in this case one for City A and one for City B. Creating a Custom Event System Combo collection You must create a Custom Event System combo collection for the events that you want to include. U se the two collections shown above, Events (“MRO Events”) and Systems (“CITYB Systems”) collection to create a new Event-System combo collection. 1. Click Customize (see the red oval below). The Customize Collections screen appears.
Figure 11 Customize Collections 2. After waiting a minute after clicking New, select Choose members from the existing event and system collections under the New Collection section.
Figure 12 New Collection 3. Under New Collection, select newly created MRO Events and CITYB Systems from the events and systems collection list.
Figure 13 New Collection 4. Click Save As to save the collection and give it a name. In this example, the name CITYB Event Combo is used. Click OK to save the settings.
Figure 14 Save as Collection You must have at least two of these collections, one for City A’s systems and one for City B’s systems. For devices in City A, you must create a normal event handler (use OptionsAutomatic Event HandlingNew menu options to set up this standard Notification) for those devices in City A using the above Event System combo collection and it is enabled all the time. Do the same for City B.
Figure 15 Custom Tools menu 2. From the New Custom Tool screen, there are three types of tools. Select CMS tool as shown. Click Next.
Figure 16 Select the tool to create Creating the tool definition Enter the required name (for example, AddHandler), command file, and parameters. The path names must be in DOS 8-dot-3 format. In this example, the command path is the location of the MXTASK command MXTASK is used to create a new event handler using and XML file for the rules. In this example, the command file path is /opt/mx/bin/mxtask (Linux and HPUX) C:\Program Files\HP\Systems Insight Manager\bin\mxtask (Windows).
Figure 17 Manage Custom Tools 3. Enter the below command in Command with parameters textbox: C:\Program Files\HP\Systems Insight Manager\bin\mxtask –cf C:\cap.xml 4. Click OK to create the tool.
Figure 18 Create Custom Tool 19
5. To test the new tool, select it and click Run Now/Schedule.
6. Below is an example of a Tool that was successfully created. Figure 20 Task results Removing event handler tool You must create a Remove Event Handler tool that executes when the partner CMS is available again. The following disables and removes the event handlers for the other CMS. 1.
Figure 21 Create Custom Task 2. Enter the below command in Command with parameters textbox: C:\Program Files\HP\Systems Insight Manager\bin\mxtask –r ClaudiaEvents 3. This time the parameters are –r ClaudiaEvents which removes the event handler task, as shown below.
Figure 22 Task Results Creating the Watch Dog event handler Now that we have created our Custom Event System combo collections, one set for City A and another for City B, and we have also created our Add and Remove Event Handlers Custom Tools, we can now create the Event Handler that provides the watch dog service to indicate that the partner CMS has failed and that the AddHandler event needs to be created and turned on.
Figure 23 Options menu 24
1. Give it a name: For this example, name it Watcher Event Handler. Figure 24 Automatic Event Handling – New Task 2. Select use event attributes that I will specify option and then click Next.
Figure 25 Use event attributes that I will specify 3. Select the events by Event Type where it is a Systems Insight Management Event of System is unreachable, then click Next.
Figure 26 System is unreachable 4. Select the other HP SIM server to watch where System Name is the device name of the other HP SIM server.
Figure 27 HP SIM server to watch 5. Select the Event Tool we created earlier, (in this example, the tool-A Custom Tool) and create an email notification so you know when the event occurs.
Figure 28 Select the Event Tool 6. No Time Filters are necessary, just click Next.
Figure 29 No Time Filters 7. Review and finish.
Figure 30 Review and finish 8. Repeat these steps for the Remove Event Handler, by selecting the status of the other CMS as Available and select the Remove Event Handler Custom Tool. Conclusions This paper has demonstrated how HP Systems Insight Manager’s Command Line Interface can be used to achieve some disaster recovery capabilities. There are many CLI tools that can also be used to automate processes within HP SIM.
Appendix A – Event handler Creating an event handler Using Custom Event System combo Collections created for City A and another for City B, we can now create the Event Handler that is enabled when CITYB CMS is unreachable. This Task is created by the Custom tool. To get tool definition of this task in a XML format, you must create the event handler shown below and then run the command mxtask -If .
Figure 2 Enter a name 2. Select newly created Event-System combo Collection CITYB Event combo collection and then click Next.
Figure 3 Select event collection 3. Assign it to CMSB SYSTEMS and click Next.
Figure 4 Assign event 4. No Time Filters are necessary. Click Next.
Figure 5 No time filters 5. Review and finish.
Figure 6 Review and finish 6. Repeat these steps for the other CMS.
Appendix B – Sample event handler XML file Here is the XML extracted using mxtask -lf. Note it uses queryname CITYB Event combo. For this example, you can cut & paste from this document,. The XML file in the previous example is named C:\Docume~1\Administrator\cap.xml. Edit the queryname to match the queries you have created. You can create the Event Handler Task using the GUI (same steps are for creating the Watch Dog Event Handler above); then export it using the CLI tool.
false
true CMS-A false false
Appendix C – Purging unwanted events To purge unwanted or old events from HP SIM: 1. Click OptionsEventsDelete Events menu selection.
2. Select the Event Collection. For this example, use MRO Events. Figure 2 Event Collection 3. Click Apply and click Schedule.
Figure 3 Schedule 4. Enter a name for the task. For this example, Delete MRO Events and Schedule it to run once a week. This is a good idea to do for all events on a weekly or monthly basis as it helps keep the CMS database cleaner and more responsive. This allows you to keep a back log of a weeks worth of events.
Figure 4 Delete Events 43
For more information www.hp.com/go/hpsim © 2009 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice. The only warranties for HP products and services are set forth in the express warranty statements accompanying such products and services. Nothing herein should be construed as constituting an additional warranty. HP shall not be liable for technical or editorial errors or omissions contained herein.