Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • May 18 2016 15:33
    @satterly banned @sandeepl337
HocineT2
@HocineT2
On different criteria including custom attributes
Then we want to be able to reuse those filters
At will. On the configuration file so far we can set only one set of criterai
Criteria like 'open'
As you provided it with one of your last commit
To be more clear i made a Quick and dirty poc on the webui part
Can i share it with you tomorrow ? It will help understand what we are trying to add
Nick Satterly
@satterly
Of course. Thanks
gabricar
@gabricar
@satterly how are you? I'm trying to run an "alerta send" for testing from inside the container but I'm getting this error msg:
alerta send --resource net01 --event down --severity Disaster --environment GUBOV --service Network --text 'net01 is down.'
Error: Failed to get config from http://localhost:8080/config: Reason: not a JSON object
Am I doing something wrong?
gabricar
@gabricar
ok... my mistake
I had an API KEY setup
gabricar
@gabricar
ok... It is almost perfect here... I have one last issue. Looks like alerta is not respecting my severity map color.
this is what I have based on my zabbix config:
SEVERITY_MAP = {
'Disaster' : 0,
'High' : 1,
'Average' : 2,
'Warning' : 3,
'Information' : 4,
'OK' : 5,
'Not classified': 6,
'unknown' : 9
}
DEFAULT_NORMAL_SEVERITY = 'OK'
DEFAULT_PREVIOUS_SEVERITY = 'Not classified'
COLOR_MAP = {
'severity': {
'Disaster': '#CC0000',
'High': '#EE0000',
'Average': '#FFA059',
'Warning': '#FFFF33',
'Information': '#7499FF',
'Not classified': '#97AAB3',
'OK': '#59DB8F',
'unknown': '#BA2222'
},
'text': 'gray',
'highlight': 'skyblue'
}
but when I do an "alerta send" it does not add the colors. everything is gray. Only the "warning" box is blue... but it was supposed to be yellow and not only the box but the full line
Nick Satterly
@satterly
@gabricar can you share the docker command (or docker-compose file) you are using to launch alerta, please?
Burak Köseoğlu
@burakksglu
Hey @satterly ! Have a great day first of all. I created a PR for you to review about the guest user feature. Since I was working on it already I want to contribute and created a PR for you. You can check it out here : alerta/alerta#1127
Nick Satterly
@satterly
Thanks. I'll take a look.
moix
@moix
hi @satterly , about ui performance we commented a couple of days ago, Do you think is something worth checking and if I can be useful somehow providing more information? I know my case with such amount of alerts/environments can be unusual
api is performing perfect and we use it to extract alerts often so were thinking on building a simple ui with a simple html table to be used as a simple noc in the meantime
Nick Satterly
@satterly
if the UI is unusable for you and you need a simple NOC dashboard then that is a good idea.
It's on my "to do" list to investigate the performance of the web ui but it's not going to happen for a few weeks.
moix
@moix
yes for sure, I know it takes time to reproduce probably and more to fix if anything. Alright ping or ask anything if you need more debug data or env size
Thanks!
Nick Satterly
@satterly
I added 4000 alerts to https://beta.alerta.io on the weekend. and it seems fine.
gabricar
@gabricar

only problem right now is the "alerta send" test not getting any colors.

alerta send --resource net05 --event down --severity Warning --environment GUBOV --service Network --text 'net05 is down.' --type zabbixAlert

docker run --name alerta-web --link alerta-db:db -d -p 8080:8080 -v /home/gabriel/tk/monitoring/ansible/files/alerta/alertad.conf:/app/alertad.conf:ro -e ADMIN_PASSWORD="xxxxxxxxxxxxxxxxx" -e DATABASE_URL="mongodb://db:27017/monitoring" -e ADMIN_USERS="gabriel.carneiro@xxxxxxxxxxxx" -e AUTH_REQUIRED="True" -e ALLOWED_EMAIL_DOMAIN="xxxxxxxxxxxx.com" alerta/alerta-web

my alertad.conf file:

SECRET_KEY = 'xxxxxxxxxxxxxxxxxxxxxxxxxxw2hPqKGs'
AUTH_REQUIRED = 'true'
SECRET_KEY = 'xxxxxxxxxxxxxxxxxx'
ADMIN_USERS = 'gabricarbr@mydomain'
PLUGINS = ['zabbix']
ZABBIX_USER = 'Alerta'
ZABBIX_PASSWORD = 'xxxxxxxxxxxxxxxxxxxxxxx'
SEVERITY_MAP = {
    'Disaster'      : 0,
    'High'          : 1,
    'Average'       : 2,
    'Warning'       : 3,
    'Information'   : 4,
    'OK'            : 5,
    'Not classified': 6,
    'unknown'       : 9
}
DEFAULT_NORMAL_SEVERITY = 'OK'
DEFAULT_PREVIOUS_SEVERITY = 'Not classified'
COLOR_MAP = {
    'severity': {
        'Disaster': '#CC0000',
        'High': '#EE0000',
        'Average': '#FFA059',
        'Warning': '#FFFF33',
        'Information': '#7499FF',
        'Not classified': '#97AAB3',
        'OK': '#59DB8F',
        'unknown': '#BA2222'
    },
'text': 'gray',
'highlight': 'skyblue'
}
ALLOWED_ENVIRONMENTS=['WOMBT', 'GUBOV', 'REVOV', 'ERDAL', 'HOFFS', 'NUBAV', 'SIKBO', 'VOBIN', 'KLP1', 'CGY3']
Nick Satterly
@satterly
Thanks. I'll see if I can reproduce.
Nick Satterly
@satterly
@cisco92 To include rawData from a file (or stdin) the easiest thing is to just use the latest version of the python alerta client. See alerta/python-alerta-client#200
I tried curl and couldn’t get it to work. You’ll need to install the alerta client from GitHub master branch as this rawData fix hasn’t been released yet. If you can test and give it an OK I’ll publish a new version.
Burak Köseoğlu
@burakksglu
Hey @satterly sorry I couldn't reply earlier. I saw your request on the alerta/alerta#1127 and I wanted to ask you that would you be able to make those changes. I can try to debug more and learn the dB backend but letting you go at it would be much faster and reliable I guess.
Sorry if I got the TBA wrong there and just wanted to be sure :) Thanks for the effort again!
cisco92
@cisco92
@satterly I've solved the issue by writing to the file in another format (using raw \n). It is not really a possibility to use the python alerta client for this , becuase it's at this moment 100+ servers in a production environment which needed this function, so installing the client on all of them is not plausible. :) But thank you!
Nick Satterly
@satterly
@cisco92 no problem. be careful about encoding plain strings in json. you'll need to escape not just newlines and other special characters but also double quotes and backslashes. See https://www.freeformatter.com/json-escape.html
cisco92
@cisco92
Yes exactly, but the raw file with information is created by the same script so it shouldn't be any strange characters etc
cisco92
@cisco92
@satterly a completely different question, but is there any possibility to set a service on a heartbeat? So the service isn't "Alerta" in the alarm page
Nick Satterly
@satterly
@cisco92 not at the moment. it's hardcoded to "Alerta". it could work the same way as setting an environment. ie. via a tag.
@burakksglu i'll take a look when i get a chance.
cisco92
@cisco92
Yes, I'm currently setting tags, but can you check if you're able to add a feature in the future to add a service flag to heartbeat? Or if there is a current way to do it
Nick Satterly
@satterly
that would be possible. in the mean time you can do this yourself in a plugin. ie. look for a tag starting with "service:" and set the service attribute.
cisco92
@cisco92
Okey cool! So I could also add in that plugin to look for "attribute:" in the tag and add that to attributes?
Burak Köseoğlu
@burakksglu

Thanks! @satterly I'm working on another issue btw. I'm debugging it right now. The issue is that if I send a user from keycloak with no role or unallowed role they can enter the app with 'user' role. It gets 'user' role from this declaration in oidc.py until that roles parameter is empty. Will let you know if I can find a fix:

user = User.find_by_id(id=subject) if not user: user = User(id=subject, name=name, login=login, password='', email=email, roles=[], text='', email_verified=email_verified) user.create() else: user.update(login=login, email=email)

image.png
Nick Satterly
@satterly
no role should get the default "user" role. an unallowed role should be 403 response
Burak Köseoğlu
@burakksglu

Ok, thank you for the guidance. That brings up a question on my head though. Could it be a problem on my end with the 'ALLOWED_KEYCLOAK_ROLES' variable? Because while I'm debugging I also see that it stays empty and couldn't get the correct parameters. I checked my '/etc/alertad.conf' file. Site logo url is working from that file by the way.

Again thank you for your effort!

Nick Satterly
@satterly
Does it work if you set ALLOWED_OIDC_ROLES instead of ALLOWED_KEYCLOAK_ROLES?
Burak Köseoğlu
@burakksglu
I tried and it didn't get the parameters. ALLOWED_OIDC_ROLES = ['admin','guest','user'] that's how I set in the alertad.conf. As you can see at the picture below, when it enters inside the condition it didn't change on the watcher and says "name error". Also when the app starts and ready to wait for login watcher changes to "not available".
image.png
Burak Köseoğlu
@burakksglu
After a further debug, inside the current_app.config('OIDC_ROLE_CLAIM') I can see the set parameters by the way.
image.png
sherif84
@sherif84
hi @satterly and alerta experts , are there any docs on bulk apis ? specifically status updates ? does it still require a celery backend ? i just tested it and tried to use it and it worked without celery . but not sure if that is safe or might cause issues . curl coimmand below
curl -X PUT \
>   'http://localhost:8080/api/_bulk/alerts/status?id=31dc48f5&id=6fd37134&id=24307c9b' \
>   -H 'authorization: Key -f8uB6cG2c4o4icMDayvT3kbCnOTR1-YsTm1tQvT' \
>   -H 'cache-control: no-cache' \
>   -H 'content-type: application/json' \
>   -H 'postman-token: cbd07ea8-955d-5739-ffa6-1dd388d421c3' \
>   -d '{
> "status":"closed",
> "text":"testing bulk API",
> "":""
> }'
{
  "count": 3,
  "status": "ok",
  "updated": [
    "24307c9b-37ee-44c5-bd37-b58ca91e51c2",
    "31dc48f5-2786-4bac-964a-e9c0e7d1a39d",
    "6fd37134-81e3-47eb-b105-83dab4a2f434"
  ]
}