Enabling alerts posted to a URL

OpsCenter can post alerts to a URL if you provide a correctly formatted POST script. For example, a simple PHP script containing print_r($_POST); should be sufficient for getting started.

To enable URL posting on the OpsCenter side:

Procedure

  1. Edit the posturl.conf file and provide a path to your script.
    • Package installations: /etc/opscenter/event-plugins
    • Binary tarball installations (Linux and Mac OSX): <install_location>/opscenter/conf/event-plugins
    • Windows installations: Program Files (x86)\DataStax Community\opscenter\conf\event-plugins
  2. Make sure your web server and posting script are configured to receive alerts.
  3. On the OpsCenter daemon host, open posturl.conf for editing.
  4. Set enabled to 1. For url, provide a valid path to your posting script.
    url=http://50.1.1.11/postOPSCevents.php
  5. Optionally, select the desired logging level. The default is to listen for all levels of events.
  6. Save posturl.conf and restart the OpsCenter daemon.

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