DX Unified Infrastructure Management

 View Only
Expand all | Collapse all

Consume API from DXUIM

  • 1.  Consume API from DXUIM

    Posted Jun 17, 2022 12:47 PM
    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?


  • 2.  RE: Consume API from DXUIM

    Posted Jun 17, 2022 12:55 PM
    Does it has a REST API available to be polled by UIM?


  • 3.  RE: Consume API from DXUIM

    Posted Jun 17, 2022 07:28 PM
    Edited by Miller Echagarreta Jun 17, 2022 07:29 PM
    Hi @David Michel yes they have an API. Any idea?


  • 4.  RE: Consume API from DXUIM

    Posted Jun 20, 2022 08:18 AM
    UIM RESTMon starter guide
    Article ID: 244146
    https://knowledge.broadcom.com/external/article?articleId=244146


  • 5.  RE: Consume API from DXUIM

    Posted Jun 24, 2022 12:50 PM
    Hey... @David Michel is possible to use the probe rhev for monitoring the VM of Redhat Openshit Container Platform?​


  • 6.  RE: Consume API from DXUIM

    Posted Jun 24, 2022 01:19 PM
    It does have a lot of VM metrics. 
    https://techdocs.broadcom.com/us/en/ca-enterprise-software/it-operations-management/ca-unified-infrastructure-management-probes/GA/alphabetical-probe-articles/rhev-red-hat-enterprise-virtualization/rhev-metrics.html


  • 7.  RE: Consume API from DXUIM

    Posted Jun 20, 2022 09:17 AM

    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




  • 8.  RE: Consume API from DXUIM

    Posted Jun 24, 2022 10:36 AM
    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


  • 9.  RE: Consume API from DXUIM

    Posted Jun 29, 2022 05:02 PM
      |   view attached

    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


    Attachment(s)

    gz
    Webhook_forum.py.gz   3 KB 1 version