Hi!
sure...not a beauty, but should give you an idea ... dont get messed up it will not run, because you are missing my PyToolsMG3-Lib (there is all my cypher/decyper-Stuff for passwords etc. in it, so I can not post it ^^, furthermore some shortcuts for the REST-Handling ;->)
I simply set up an nginx-Web-Server which listens at a specific port and has a fastcgi-python include
thats the simple fcgiwrap.conf
location ~* (^/prometheus)/(.+\.py)$ {
gzip off;
root /opt/UIMWebhook/lib;
auth_basic "Authentication required";
auth_basic_user_file /etc/nginx/.htpasswd;
fastcgi_pass unix:/var/run/fcgiwrap/fcgiwrap-nginx.sock;
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root/$2;
}
but the simple idea is, the nginx got the webhook with the json-payload and deliver it via "stdin" to the python-script, who parses the json, fetches the needed parameters for the alarm (or clear) and send a REST-alarm, quite straight forward...
cheers
Matthias
Original Message:
Sent: Jun 24, 2022 10:35 AM
From: Miller Echagarreta
Subject: Consume API from DXUIM
Hi Mattias how are you, thanks for this comment.
Is possible that you send me an example of this configuration? i am new with this of API and i don't know how to start.
Regards.
M.E
Original Message:
Sent: Jun 20, 2022 09:16 AM
From: Matthias Gruber
Subject: Consume API from DXUIM
Hi!
We had the same "problem", a Prometheus monitoring our K8s and UIM as Lead-Monitoring-System.
I simply wrote a WebHook, since polling is not the right way in my point of view. I develped a little Python-Skript which works behind a nginx-webserver and converts the webhook I receive from Prometheus and make a Alarm (via UIMRest) out of it. Thats not so tricky, and no polling.
Since Prometheus simply sends a JSON it took only to extract the needed values and got that "alarms/create"-UIMRest satisfied. The Login an "mutlithreading" does the nginx for me.. therefore you can use any Language which is "CGI"-able :-)
cheers
Matthias
Original Message:
Sent: Jun 17, 2022 12:46 PM
From: Miller Echagarreta
Subject: Consume API from DXUIM
Hi Everyone.
With DXUIM I can consume from an API another monitoring system like Redhat's Prometheus. I understand that with DXOI I can make this a little easier, but we don't have DXOI. Redhat Ing can publish Prometheus monitoring information with an API, can I consume this information with UIM to publish alarms and dashboards in UIM?