Enabling alerts posted to a URL
OpsCenter can post alerts to a URL if you provide a correctly formatted POST script.
OpsCenter can be configured to send alerts within an HTTP POST request to a specified
URL. For example, a simple PHP script containing print_r($_POST);
will echo the received POST request. An example POST request is:
POST / HTTP/1.0
Host: localhost
User-Agent: Twisted PageGetter
Content-Length: 184
Content-type: application/x-www-form-urlencoded
connection: close
target_node=None&event_source=OpsCenter&success=None&level=1&level_str=INFO&api_source_ip=None&user=None&time=1400098707681966&action=18&message=OpsCenter+starting+up.&source_node=None
The request body contains fields described in Alerts.
To enable URL posting on the OpsCenter side:
Procedure
Example
In a system with posting enabled for critical and alert-level events, posturl.conf looks like:
[posturl]
enabled = 1
url =http://10.1.1.11/postOPSCevents.php
# levels can be comma delimited list of any of the following:
# DEBUG,INFO,WARN,ERROR,CRITICAL,ALERT
# If left empty, will listen for all levels
levels =CRITICAL,ALERT