As per definition, in a JBoss AS 7/WildFly Domain there can be at most one Domain Controller, which is in charge to manage the other Host Controllers and the Domain configuration. In this tutorial we will show how to check for the Domain Controller availability using JBoss Operations Network and get a notification in case of failure.
The requisite is that you have installed and configured JBoss Operations Network. You can read this JBoss Operation Network (JON) installation tutorial for further information. Once installed and started JON, you will be able to discover servers in the Inventory > Discovery Queue, as indicated by the following picture:
Choose to Import the above server, that will be included into the Inventory. Next step will be configuring the Management UserName and Password so that JBoss Operations Network can connect and manage the application server. From the Inventory tab click on your Server, then choose Inventory > Connection Settings:
As indicated, check that the UserName and Password matches with the Domain Controller ones and verify as well the Port used by the Domain Management Interfaces. Click Save. Your JON console should be now connected to the Domain Controller.
If you select the EAP Domain Controller from the Inventory tree of resources (on the left), you will be able to see as well the Child Resources which are the EAP Servers that are controlled by the Domain Controller. In the following picture, we have the default Domain configuration which includes three servers (server-one, server-two, server-three) the first two being active by default.
Now we will create an Alert which will inform us in case of failure of the Domain Controller. Choose the “Alerts” tab in your resource window and click on New. The first thing we will enter is the Alert name and (not mandatory) a Description.
Now switch to the Conditions tab. In the following Dialog you will be able to select the Condition/s that will trigger the Alert. In our case the Condition is a change of Availability:
Click OK. Now we will choose the action to be taken when the Condition is verified. From the Notifications tab you can opt for a simple one, such as a Mail delivery which will inform us about the incident:
You can even choose to trigger an action on a Resource (the same resource or another). For example, let’s say you want to attempt to restart the Domain Controller itself. Hence, you could choose a Resource Operations and select as Resource the same resource and as operation Restart:
Whatever is your choice, you can now shutdown your Domain Controller and check that an alert has been emitted. It is visible in the JBoss Operations Network Dashboard:
You should receive as well a Mail notification or (if you have chosen Server Restart) check that the Domain Controller has been restarted.