Automation of two HP SIM 5.1 or 5.2 servers to provide Failover Event Handling C reating a C ustom Events List ............................................................................................................. 4 Creating a Custom Systems List ............................................................................................................. 7 Creating a Custom Event-System Combo collection ................................................................................
In very large environments, one HP Systems Insight Manager (HP SIM) may not provide all the coverage needed for all the devices or for 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 the 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 2: Server B is Unavailable When Server B dies, then Server A processes events for Servers in B’s territory until Server B comes back, because all agents are configure to send events to both server, not changes are needed to agents for achieve 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.
C reating a C ustom Events List You m ust create a C ustom Event List for the even ts that you are interestin g in handling. In this exam ple, custom list called “M R O Events” w hich consisted of specific hardw are related events on specific servers. To create a custom collection or list: 1. C lick on C ustom ize (see the red oval), the C ustom ize C ollections screen appears. In the drop dow n list, select Events (see green oval show n ) then click N e w .
2. W ait for a m inute after clicking N e w and n otice the N e w C ollection at the bottom of the screen. Select C h o o s e m e m b e r s b y A tt r ib u t e . 3. Select Event Type is and select the set of events you are interested in as shown below. Click Add to add other event criteria.
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.
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.
2. After waiting a minute after clicking New, the New Collection appears at the bottom of the screen. Select Choose members by Attribute.
3. From the dropdown list under New Collection, select the set of devices to create a system collection where it can be Server 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. 4. Create two of these collections, in this case one for City A and one for City B.
5. 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.
Creating a Custom Event-System Combo collection You must create a Custom Event -System combo collection for the events that you want to include. Use the two collections shown above, Events (“MRO Events”) and Systems (“CITYB Systems”) collection to create a new Event- System combo collection. To create a custom combo-collection: 1. Click Customize (see the red oval below). The Customize Collections screen appears. From the dropdown list, select System (see green oval) and click New. 2.
3. Under New Collection, select newly created MRO Events and CITYB Systems from the events and systems collection list.
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.
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 for those devices in City A using the above Event System combo collection and it is enabled all the time.
2. From the New Custom Tool screen, there are three types of tools. Select CMS tool as shown. Click Next.
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 an XML file for the rules. In this example, the command file path is /opt/mx/bin/mxtask (Linux) C:\Program Files\HP\Systems Insight Manager\bin\mxtask (Windows). The parameters are: -cf /root/cap.xml (Linux) , -cf C:\cap.
3. Enter the following command: C:\Program Files\HP\Systems Insight Manager\bin\mxtask" -cf C:\cap.xml 4. Click OK to create the tool.
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.
Removing event handler tool You must create a Remove Event Handler tool that executes when the partner CMS is available again. This disables and removes the event handlers for the other CMS. 1. Create another custom tool definition, in this example, the Command Execution path is the same as add task: - /opt/mx/bin/mxtask (Linux) C:\Program Files\HP\Systems Insight Manager\bin\mxtask ( Windows) 2.
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 created and turned on.
1. Give it a name: For this example, name it Watcher Event Handler. 2. Select use event attributes that I will specify option and then click Next.
3. Select the events by Event Type where it is a Systems Insight Management Event of System is unreachable, then click Next.
4. Select the other HP SIM server to watch where System Name is the device name of the other HP SIM server.
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. 6. No Time Filters are necessary, just click Next. 7. Review and finish.
8. Repeat this steps for the Remove Event Handler, by select 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 with in 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 hander shown below and then run the command mxtask –lf “”.
2. Select newly created Event-System combo Collection CITYB Event combo collection and then click Next.
3. Assign it to CMSB SYSTEMS, and click Next.
4. No Time Filters are necessary. Click Next.
5. Review and finish. 6. Repeat this 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.
</Property> <Property name="appLaunchTool"> <Simple></Simple> </Property> <Property name="appLaunchTaskName"> <Simple></Simple> </Property> <Property name="forwardTrap"> <Simple>false</Simple> </Property> <Property name="trapRecepients"> <List size="0"> </List> </Property> <Property name="assignEvent"> <Simple>true</Simple> </Property> <Property name="assignee"> <Simple>C
2. Select the Event C ollection. For this exam ple, use M R O E v e n t s .
3. C lick A p p ly and click S c h e d u le . 4. Enter a nam e for the task. For this exam ple, D e le t e M R O E v e n t s and Schedule it to run once a w eek. This is a good idea to do for all events on a w eekly or m onthly basis as it helps keep the C M S database cleaner and m ore responsive. This allow s you to keep a back log of a w eeks w orth of events.
For more information www.hp.com/go/hpsim © 2006 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.