Enterprise Alert offers various interfaces which allow you to submit events and thereby generate alert notifications. Besides the so called smart connectors for code-less integration with specific products Enterprise Alert also offers generic interfaces for programmatic integration of your backend systems. One very convenient option for integration with just one line is the command line interface (CLI).
With the command line interface you can for example integrate IT tools, production or facility management systems. Even sensors that can run a command lines can be integrated without the need to write any code.
Basically the CLI client encapsulates the Web Service API of Enterprise Alert. The Web Service API can be used to submit new events to Enterprise Alert and thereby trigger configured Alert Policies (which can then raise new alert notifications).
When you wish to raise events via the command line, you first of all need to register a new event provider in Enterprise Alert. This action only needs be performed once, in order to create a new event source in Enterprise Alert and in order to define the event parameters for this specific type of events. Afterwards you can raise new events from the registered source (event provider). In case your client needs to be removed, you simply need to un-register the according event provider. All these steps are performed from the command line using the CLI executable.
How to use the CLI
The CLI client executable is located in the following folder on the Enterprise Alert server:
“C:\Program Files (x86)\Enterprise Alert\CommandLine\RemoteCLI.exe”
The CLI client comes with a configuration file and is named “RemoteCLI.exe.config”. This file needs to be copied along with the RemoteCLI.exe file when you are deploying the CLI client to your desired client machine.
To help you getting started, after launching the application it appears a description of all switches and there usage. There are five important switches:
SETURL – Use this switch first, in order to set the URL to the Web Service API of Enterprise Alert to communicate with
SETLOGIN – Use this switch to provide login credentials for Enterprise Alert. Since, registering event providers and raising new events is kind of an administrative function in Enterprise Alert, please provide your Enterprise Alert admin login credentials here. For security reason, the credentials will be saved in your local Windows user folder e.g.: “C:\Users\johndoe\AppData\Local\Derdack\RemoteCLI.exe_Url_z2meuhhahzfmdfx3f4gtlcs4b1tggzcd184.108.40.206”
Once you have called SETLOGIN, you won’t need to provide the “user” and “password” parameters in subsequent calls. SETLOGIN only needs to be called once since the credentials are saved in the above-named file.
REGISTER – This switch can be used to register a new event provider respectively event source. Once this switch has been executed, the according event provider can raise new events via the RAISE switch. REGISTER only needs to be called once when initially setting up the event provider. You can specify event parameters in the register switch that you would like to pass in with your events and typically include in your notifications. An example could be the actual notification recipient passed in as a parameter called “destination”.
RAISE – This switch can be used to raise new events and thereby trigger new notifications in Enterprise Alert.
UNREGISTER – As the name implies, you can use this switch to remove a registered event provider from Enterprise Alert. From there on, the provider won’t be able to submit new events via RAISE.
The following example shows a practical usage for the CLI when it is used for the first time:
RemoteCLI.exe SETURL /url:”http://yourserver/EAWebService/EventProviderAPI.asmx”
RemoteCLI.exe SETLOGIN /user:”Administrator” /password:”something-safe”
RemoteCLI.exe REGISTER /provider:”Automation” /params:”Product;Pressure;Destination”
RemoteCLI.exe RAISE /provider:”Automation” /params Product:”Sensors” Destination:”Conveyor”
RemoteCLI.exe RAISE /provider:”Automation” /params Product:”Actors” Destination:”Unit”
If you execute the command line tool without any additional parameters you get a help text that contains additional information. Please also make sure your firewall allows for HTTP traffic between the command line tool and Enterprise Alert.
The command line tool is a very convenient yet powerful option for integrating proprietary remote backend systems or even for testing alerting scenarios.