Frequently Asked Questions
Alerta
Why can’t I see any alerts in the web browser?
If you can send and query for alerts using the alerta
CLI tool this
problem is almost certainly related to cross-origin browser errors. Open
up the Javascript developer console in your browser of choice and look
for CORS errors like:
XMLHttpRequest cannot load http://api.alerta.io/alerts?status=open.
No 'Access-Control-Allow-Origin' header is present on the requested
resource. Origin 'http://web.alerta.io' is therefore not allowed access.
To fix this you can either serve the web UI from the same origin as
the API using a web server to reverse proxy the
web UI or ensure that the API server allows the origin where the
web UI is hosted by adding it to the CORS_ORIGINS
server
configuration setting.
Why do I need to set an environment
and service
when they are not mandatory?
Only resource
and event
are technically required to ensure that
Alerta can process alerts correctly. However, the “out-of-the-box” default
server setting for PLUGINS
has the reject
plugin enabled. This plugin
enforces an alert “policy” of requiring an environment
attribute of either
Production
or Development
and a value for the service
attribute.
This is to encourage good habits early in defining useful alert attributes
that can be used to “namespace” alerts (this is what the environment
attribute is for) and so that the web console can organise by environemnt
and filter alerts by service
.
However, one of the principles of Alerta is not to enforce its view of the world on users so the plugin can be easily configured, modified or completely disabled. It’s up to you.
Can I define custom severity codes and levels?
Yes, you can now completely change the severity names, severity levels and colours. See Alerta Web UI for more information.
How can I add a priority to an alert eg. High, Medium, Low?
Use a custom attribute called priority
when sending alerts to
Alerta:
$ alerta send ... --attributes priority=high ...
Alerts of differing priority could be queried by alerta
command-line tool using:
$ alerta query --filters attributes.priority=high
Using the web console to sort alerts by priority as well as severity would require some development effort.
What’s the difference between ack, close and delete?
Alerts are meant to auto-close when a corresponding normal or cleared alert is received for that event-resource combination. If no normal alert exists for a particular event (which may be the case for alerts from log files or SNMP traps, for example) then the alert will be deleted when the timeout period has expired. Alerts timeout after 1 day by default but that is configurable on a per-alert basis.
If, as an operator, you want to remove an event from view then you can either ack the alert or DELETE it. If the alert is DELETED a new alert with the same event-resource combination will trigger a new notification email (if configured) whereas an ack’ed alert will not.
Why don’t you have a plugin or integration for X, where X is whatever you use in your job?
We could spend countless hours writing plugins for everything and never finish or we could focus on building an easily extensible system with great documentation and let the end-user build the plugins they need. Having said that, we have still created many plugins and integrations as working examples and we are not against writing more if there is popular demand. We are also happy to accept submissions.
What’s this MongoDB “ServerSelectionTimeoutError”?
With the update to PyMongo 3.x multiprocessing applications “parent process and each child process must create their own instances of MongoClient”.
For Apache WSGI applications, an example Apache “vhost” configuration for the Alerta API would look like this:
<VirtualHost *:8080>
ServerName localhost
WSGIDaemonProcess alerta processes=5 threads=5
WSGIProcessGroup alerta
WSGIApplicationGroup %{GLOBAL}
WSGIScriptAlias / /var/www/api.wsgi
WSGIPassAuthorization On
<Directory /opt/alerta>
Require all granted
</Directory>
</VirtualHost>
Full examples are available on GitHub and more information on why this is necessary is available on stackoverflow and the PyMongo where they discussion PyMongo in relation to forking and mod_wsgi site.
Does Alerta support Python 2.7 or Python 3?
Alerta Release 5.2 is the last version to support Python 2.7 and from 31 August, 2018 it will only receive crtical bug fixes and security patches.
Alerta Release 6 supports Python 3.5+ and is recommended for new production environments and existing installations should be switched to Python 3 well before 1 January, 2020 when Python 2.7 becomes End-of-Life.