Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
  • May 18 2016 15:33
    @satterly banned @sandeepl337
Pantelis Karamolegkos
Same goes for the webhook that I am supposed to implement
Arindam Choudhury
Hi, i was checking out the pagination. but i am not clear how to use it with python-alerta-client.
@pkaramol Yes, you need to "import" your custom webhook on dockerfile. The alerta-docker already have all plugins in contrib repo, you just need to add parameter of plugins you want use.
Hi Team, could you please let me know is there any limitations on environments that will show in Alerta UI.

Hi, all. First time trying out Alerta and trying to run it in a docker container on windows running WSL2 and following instructions here and here. Once I start the alerta-web container and tail its logs, I'm seeing this error:

mounting wsgi:app on /api

2020-08-31 05:02:09,649 DEBG 'uwsgi' stdout output:
Traceback (most recent call last):
  File "./wsgi.py", line 2, in <module>

2020-08-31 05:02:09,649 DEBG 'uwsgi' stdout output:
    app = create_app()
  File "/venv/lib/python3.7/site-packages/alerta/app.py", line 67, in create_app
  File "/venv/lib/python3.7/site-packages/alerta/database/base.py", line 47, in init_db
    self.create_engine(app, uri=app.config['DATABASE_URL'], dbname=app.config['DATABASE_NAME'])
  File "/venv/lib/python3.7/site-packages/alerta/database/backends/mongodb/base.py", line 26, in create_engine
  File "/venv/lib/python3.7/site-packages/alerta/database/backends/mongodb/base.py", line 43, in _create_indexes

2020-08-31 05:02:09,649 DEBG 'uwsgi' stdout output:
    db.customers.drop_indexes()  # FIXME: should only drop customers index if it's unique (ie. the old one)
  File "/venv/lib/python3.7/site-packages/pymongo/collection.py", line 2060, in drop_indexes

2020-08-31 05:02:09,649 DEBG 'uwsgi' stdout output:
    self.drop_index("*", session=session, **kwargs)
  File "/venv/lib/python3.7/site-packages/pymongo/collection.py", line 2116, in drop_index

2020-08-31 05:02:09,650 DEBG 'uwsgi' stdout output:
  File "/venv/lib/python3.7/site-packages/pymongo/collection.py", line 250, in _command

2020-08-31 05:02:09,650 DEBG 'uwsgi' stdout output:
  File "/venv/lib/python3.7/site-packages/pymongo/pool.py", line 613, in command

2020-08-31 05:02:09,650 DEBG 'uwsgi' stdout output:
  File "/venv/lib/python3.7/site-packages/pymongo/network.py", line 167, in command

2020-08-31 05:02:09,650 DEBG 'uwsgi' stdout output:
  File "/venv/lib/python3.7/site-packages/pymongo/helpers.py", line 159, in _check_command_response
    raise OperationFailure(msg % errmsg, code, response)
pymongo.errors.OperationFailure: ns not found monitoring.customers
unable to load app 0 (mountpoint='/api') (callable not found or import error)
*** no app loaded. going in full dynamic mode ***

It looks like the MongoDB setup script is trying to drop indexes that don't exist yet which then causes the rest of the script to fail? If I try to connect to the endpoint I get a failure to connect to Alerta API error due to missing or invalid config.json file. Lines 43 and 48 in /venv/lib/python3.7/site-packages/alerta/database/backends/mongodb/base.py seem to be the culprits of the errors above so I tried to figure out the syntax for catching the error but eventually I just commented out those lines completely. After restarting the container, I can hit the web UI and begin configuration like normal. I'm guessing this isn't normal behavior though, right? This isn't a config file you would normally need to touch right out of the box is it?

3 replies

Hey All
I'm working on a custom plugin. We are running our alerta instance in a docker (docker-compose) environment.
According to the alerta/docker-alerta readme I quote: "Custom plugins should be installed as an additional image layer."

Can anyone clarify this statement, how does this work exactly?
Thanks in advance!

Burak Köseoğlu
@Yentel you should add pip install command to your dockerfile while creating image. If you don't have dockerfile you should create custom one. There are examples for this on the web
Hi, What do you think about extending the correletion rule with environment-resource-event and add fourth the value or text field into it? I’ve implemented custom SNMP integration with LinkDown/LinkUp corelated events where interface name is send as value and inside a text field. In such a case when two interfaces fail on the same device I’m getting only one event displayed with interface names being updated in the event history. Instead of this it should be possible to create two separate events and correlate them properly based on the inteface name which has been restored (LinkUp received). The only possible solution I’ve found to overcome this right now is to add inteface name to the event name so they look like this LinkDown-eth1/0/1, LinkUp-eth1/0/1. Is there a different way to solve this?
Mateusz Kulacki Teaminternational
Anybody tried to deploy alerta in Rancher 1.6? I have hard times to reverse proxy alerta outside and connect dns to it
Hi, is there any way to have different permissions for non-authenticated users when using AUTH_REQUIRED=False? We need our unauthenticated users to only be able to view alerts and not delete/ack them.
Nemanja Delic
Is there a way to pass credentials while using simple ldap binding? according to config options there's no such option. If so how do you integrate with AD. The server where alerta is running already joined in AD.
Pantelis Karamolegkos
When creating a new custom webhook, at which point is the url path specified? in setup.py? I am asking for this /api/webhook/<mywebhook>
3 replies
Dear all, I've found something weird I cannot explain. I've a custom plugin with take_action method. After the custom action is fired alerta overwrites the alert timeout putting it Null in the postgres db - it results in the web ui as 86400. This happen also with an empty take_action method (having just the return alert, action, text line).
In the alerta log, right after the call of my take_action there are some alerta queries logged, among them:
UPDATE alerts
SET severity='major', status='open', tags=ARRAY(SELECT DISTINCT UNNEST(tags || ARRAY['general',''])),
", "customer": "**"}', timeout=NULL, previous_severity='indeterminate',
update_time='2020-09-11T13:47:06.879Z', history=(....omissis....)
WHERE id='49e700b9-b647-4729-b04a-79b2d066cb1c' OR id LIKE '49e700b9-b647-4729-b04a-79b2d066cb1c%'
(omissis are mine)
Burak Köseoğlu

Hey @satterly! I've created an issue for you to look at. There might be breaking changes in Zabbix 5.0 for the encoding of Zabbix plugin. I can help you out with more information.



2 replies

Hey @satterly ! I am new to alerta . I am trying to use the docker images used the commands as give but it seems to be throwing a database error.
/// 2020-09-16 18:05:01,675 DEBG fd 8 closed, stopped monitoring <POutputDispatcher at 139927201480504 for <Subprocess at 139927201596264 with name housekeeping in state RUNNING> (stdout)>
2020-09-16 18:05:01,675 INFO exited: housekeeping (exit status 1; not expected)
2020-09-16 18:05:01,675 DEBG received SIGCLD indicating a child quit
2020-09-16 18:05:02,677 INFO spawned: 'housekeeping' with pid 74
2020-09-16 18:05:02,809 DEBG 'uwsgi' stdout output:
--- no python application found, check your startup logs for errors ---
[pid: 20|app: -1|req: -1/25] () {36 vars in 421 bytes} [Wed Sep 16 18:05:02 2020] GET /api/config => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 0)

2020-09-16 18:05:02,809 DEBG 'nginx' stdout output:
ip=- [\16/Sep/2020:18:05:02 +0000] "\GET /api/config HTTP/1.1" \500 \32 "-" "\python-requests/2.24.0"
/web | /api/config | > GET /api/config HTTP/1.1

2020-09-16 18:05:02,809 DEBG 'nginx' stdout output:
2020/09/16 18:05:02 [info] 14#14: *57 client closed keepalive connection

2020-09-16 18:05:02,809 DEBG 'heartbeats' stdout output:
Error: Failed to get config from http://localhost:8080/api/config. Reason: 500 Server Error: Internal Server Error for url: http://localhost:8080/api/config

Could someone please help me on this
1 reply
Hi. I'm trying to create plugin routing. I have managed to route alerts to telegram and it works fine. But now I want to send only 'critical' and 'ok'. 'OK' should be send only if the previous severity state was 'critical'. I am trying to do this with previousSeverity (previous_severity) attribute but it doesn't work. I suppose that alerta doesn't know previousSeverity at the moment when routing plugin runs. Is this configuration possible? Any ideas, tips on how to achieve it? Thanks!
Hi. I am trying to run alerta on development mode but i keep running into this error when i start the WebUI.
vue.runtime.esm.js:1888 TypeError: i.replace is not a function
at m.getAlerts (alerts.store.ts:123)
at Array.<anonymous> (vuex.esm.js:747)
at m.dispatch (vuex.esm.js:438)
at m.dispatch (vuex.esm.js:332)
at s.getAlerts (Alerts.vue:364)
at s.refreshAlerts (Alerts.vue:385)
at s.created (Alerts.vue:331)
at ne (vue.runtime.esm.js:1854)
at Fn (vue.runtime.esm.js:4219)
at s.t._init (vue.runtime.esm.js:5008)
Hi, I realized that I can login with any admin user (ADMIN_USERS list) without setting credentials in the login page :o
5 replies
can anyone confirm if it reproduces or am I having something wrong in configuration?
note I use LDAP authentication
Pantelis Karamolegkos
Does anyone know whether the newrelic webhook is broken or not? On my docker alerta/alerta-web:8.0.2 instance, the test notification from New Relic returns Bad Request
Screenshot 2020-09-25 at 2.16.05 PM.png
Pantelis Karamolegkos
Pantelis Karamolegkos
What exactly is the role of attributes in an Alert object? (and how for example do they differ from extra info that can be conveyed in tags) ?
2 replies
Pantelis Karamolegkos

Why doesn't a BAD REQUEST/400 error does not come along with some helpful error logs?

      - DEBUG=True  # remove this line to turn DEBUG off

I have set this in my docker-compose stack, yet I see no errors

Pantelis Karamolegkos
We have set up Google Auth2, added mycompanydomain.com to ALLOWED_EMAIL_DOMAINS but when I try to login I get Error: User pkaramol@mycompanydomain.com is not authorized. What more needs to be done?
Pantelis Karamolegkos
I have even set ALLOWED_OIDC_ROLES = ['*']
Hi is there any way to make 'resource' and 'even' non-mandatory?
Matthew Jenkins
@pkaramol if new relic responded with a 400, you'd need to look on the newrelic side what that means. I've seen apis before basically return a 400 for every type of error even if it doesn't make sense.
1 reply
not logged in? 400. missing a semi colon? 400. Missing a field? 400

Hi, I’m running Alerta using Apache WSGI with the following configuration:

LOG_HANDLERS = ['wsgi','file']
LOGGER_NAME = 'alerta'
LOG_MAX_BYTES = 100000
LOG_FILE = '/tmp/alerta.log'
LOG_FORMAT = 'verbose'

Listen 8080
WSGISocketPrefix /var/run/wsgi
<VirtualHost *:8080>
  ServerName localhost
  WSGIDaemonProcess alerta processes=5 threads=5 python-home=/opt/alerta
  WSGIProcessGroup alerta
  WSGIApplicationGroup %{GLOBAL}
  WSGIScriptAlias / /var/www/api.wsgi
  WSGIPassAuthorization On
  CustomLog /var/log/httpd/alerta.log combined

  ProxyPass  /api http://localhost:8080
  ProxyPassReverse /api http://localhost:8080
  DocumentRoot /var/www/html/alerta

I’m not able to get any information logged in the /tmp/alerta.log file? Any ideas what might be wrong/missing?

1 reply
Pantelis Karamolegkos

I am creating a webhook for CloudAMQP. At the end of the module I am returning the following Alert object

        return Alert(

However I now see in my tests that description is not added to the Alert object, given that I receive:

sut_1  | >           self.assertEqual(data['alert']['description'],
sut_1  |                              'connection for instance-to-test-alerta is below the threshold of 1')
sut_1  | E                            KeyError: 'description'
Pantelis Karamolegkos
Ι see that the Alert object has no description attribue. Where should we add the description so that it appears under Description UI field
2 replies

I've seen that there are a few questions regarding this alerta.exceptions.ApiError: Severity (5) is not one of critical, warning, indeterminate, ok, unknown
I have this in my alertad.conf

# Severity settings
    'critical': 1,
    'warning': 4,
    'indeterminate': 5,
    'ok': 5,
    'unknown': 9


    'severity': {
        'fatal': 'blue',
        'critical': '#FFCDD2',
        'warning': '##FFE0B2',
        'indeterminate': '#6ED0E0',
        'ok': '#00CC00',
        'unknown': 'silver'

I'm trying to integrate with prometheus

3 replies

I'm using Alert with the Alert-webui interface.
Sometimes I'm getting the error below on the webui:

TypeError: "this.$store.getters['alerts/alerts'] is undefined"
    alerts Alerts.vue:227
    VueJS 3
    alertsByEnvironment Alerts.vue:251
    VueJS 3
    ne Alerts.vue:1
    He VueJS
    ne Alerts.vue:1
    VueJS 7
    s es6.promise.js:75
    E es6.promise.js:92
    c _microtask.js:18

After clearing the cache and reloading the page, the error no longer occurs. Any tips on what I should check?

Jan Pechek
Hello, i noticed some issue with alerta - alerts are sent to Alerta from Alertmanager via webhook but Alerta drop this alert and return HTTP error 500. In log are errors like this https://pastebin.com/xWhe273q.
1 reply

Hi. I'm trying to create plugin routing. I have managed to route alerts to telegram and it works fine. But now I want to send only 'critical' and 'ok'. 'OK' should be send only if the previous severity state was 'critical'. I am trying to do this with previousSeverity (previous_severity) attribute but it doesn't work. I suppose that alerta doesn't know previousSeverity at the moment when routing plugin runs. Is this configuration possible? Any ideas, tips on how to achieve it? Thanks!

any idea :)?

Matthew Jenkins
Is there a way to update the alerta docs? I see here https://docs.alerta.io/en/latest/api/reference.html#retrieve-an-alert it references a status_table . However when I check the DB there is no status table.
Arjun Dandagi
hi , wanted to understand how alerta is able to discover the custom webhooks deployed in my python environment .can someone help me understand this
i wrote a custom webhook , its up and running with application able to discover it . but not sure how this magic works :smile:
Matthew Jenkins
@ArjunDandagi I don't know specifically w.r.t alerta, but a webhook is generally a request that goes out to the hook location when some trigger is hit. It's fairly basic functionality wise to impliment which is why webhooks have become a thing for almost everything.
Matthew Jenkins
@ArjunDandagi here is ahere you can see the webhook logic: https://github.com/alerta/alerta/blob/master/alerta/webhooks/__init__.py
You can see it's just sitting there and chilling until it recieves a request, parses it then does whatever the webhook was made to do
Cédric Verhaeghe
Hi, I have a question regarding alerta plugins
I have already created a plugin that changes the status of an incoming alert based on some parameters
but how would I go about modifying related alerts
What's the best way to log debug info in a custom webhook? I want to figure out what payload contains in order to understand what's wrong with the parsing of the received payload