The Abiquo Events Notifier is a Python application that uses the Abiquo Outbound API and the Abiquo API to monitor the Abiquo platform and send emails to notify users of events in Abiquo. You can configure the users, as well as the types of events that will trigger notification emails. By default, the Email Notifier accesses the Abiquo API every five seconds but you should tune this value for your installation. You can run the Abiquo Events Notifier on the Abiquo Server or on a separate server with access to Abiquo API.
Download the Abiquo Email Notifier script from the Abiquo Enterprise Support website.
See the User Guide information on Events view for information about Abiquo Actions and Severity Levels.
Installation and Configuration
Install required Python packages
Abiquo Events Notifier require some additional python packages to run. You can get them from the default repository in CentOS6 or from a third party repository such as RPMforge in CentOS5 for example.
- python-pycurl
- python-dateutil
CentOS6 additional packages installation example:
yum install -y python-dateutil python-pycurl
Modify the notifier.cfg file and enter the appropriate values.
Set the polling interval, which is the amount of time between API checks. The default is 5 seconds and the recommended value is between 5 and 10 seconds, but you should tune the polling value for your installation.
[main] polling_interval = 5
Set the IP of Abiquo API Server, a valid Cloud Admin user account registered in Abiquo and change the port if this is required in your setup.
[abiquo] api_ip = 10.10.10.10 api_user = event-notifier api_pwd = event-password api_port = 80
Field | Description |
---|---|
api_ip | IP address of the Abiquo API Server |
api_user | Cloud Admin username |
api_pwd | Cloud Admin password |
api_port | Abiquo API Server port |
[email] from = events@abiquoserver subject = New events have occurred in the Abiquo environment body = The new events are: smtp_ip = localhost smtp_port = 25
Field | Description |
---|---|
from | Sender email address |
subject | Subject |
smtp_ip | Outgoing mail server IP address. The default is localhost |
smtp_port | The default outgoing mail server port is 25 |
Initialize the rules database
# ./init_rules_db.py
Run the events notifier utility in the background
# ./main.py &
Alternatively, the events notifier can be run as "./main.py". Events will then display on the screen.
Add rules for the events you wish to monitor
Rules can be added while the notifier is running. It will load rules every time it analyzes events, depending on the polling interval.
Examples of Rule Creation
In the following examples, USERA and USERB must be Abiquo users with valid email addresses.
1. Monitor VAPP_CREATE and VAPP_DELETE actions performed by USERA and notify USERB.
# ./add_rule.py --user USERB --action VAPP_CREATE,VAPP_DELETE --owner USERA
2. Notify all users when their deploys/undeploys have finished.
# ./add_rule.py -u all -a VAPP_POWERON,VAPP_POWEROFF
3. Notify USERA when their deploys/undeploys have finished.
# ./add_rule.py -u USERA -a VAPP_POWERON,VAPP_POWEROFF
4. Notify USERB on all major events.
# ./add_rule.py -u USERB -s MAJOR
5. Notify the cloud admin user on all critical events.
# ./add_rule.py -u admin -s CRITICAL
List the active rules
# ./list_rules.py