DX Unified Infrastructure Management

 View Only
  • 1.  create alarm by rest api

    Posted Nov 22, 2021 08:32 AM
    Hi all

    I am trying to use ceate alarm api of uim to create alarm and integrate it with backup tool so that i can get backup afailure alarm 

    what all details i need to fill in body of create api and what all i can ignore to create a alarm

    {
    "id": "string",
    "level": 0,
    "severity": "string",
    "message": "string",
    "prevLevel": 0,
    "hostname": "string",
    "source": "string",
    "timeOrigin": "2021-11-22T08:27:55.252Z",
    "timeArrival": "2021-11-22T08:27:55.252Z",
    "timeLast": "2021-11-22T08:27:55.252Z",
    "subsystem": "string",
    "prevSubsystem": "string",
    "subsystemId": "string",
    "domain": "string",
    "hub": "string",
    "robot": "string",
    "nas": "string",
    "probe": "string",
    "origin": "string",
    "suppressionKey": "string",
    "suppressionCount": 0,
    "assignedTo": "string",
    "assignedBy": "string",
    "timeAssigned": "2021-11-22T08:27:55.252Z",
    "userTag1": "string",
    "userTag2": "string",
    "visible": false,
    "custom1": "string",
    "custom2": "string",
    "custom3": "string",
    "custom4": "string",
    "custom5": "string",
    "alarmToken": "string",
    "devId": "string",
    "metId": "string",
    "ciType": "string",
    "ciName": "string",
    "variables": [
    {
    "name": "string",
    "type": "string",
    "description": "string",
    "status": 0,
    "value": "string"
    }
    ]
    }

    can anybody suggest

    regards
    Nijin


  • 2.  RE: create alarm by rest api

    Posted Nov 22, 2021 03:53 PM

    Hello,

    You don't need that much parameters. You can test with postman.
    You need to do a post request to http[s]://<operator console>/rest/alarms/createAlarm
    Authorization: Basic auth / username and password

    Body:

    <alarm>
        <domain>your domain</domain> 
        <hostname>hostname</hostname> 
        <hub>your hub</hub> 
        <level>2</level> 
        <message>This is a test. Please disregard</message> 
        <nas>hub of the nas</nas> 
        <origin>origin</origin> 
        <robot>robot</robot> 
        <severity>major</severity> 
        <source>source</source> 
        <visible>true</visible> 
    </alarm>

    After that you can export your request as a curl command.



  • 3.  RE: create alarm by rest api

    Posted Nov 22, 2021 04:18 PM
    Edited by Guillaume Briere Nov 22, 2021 04:19 PM

    Hello,

    But why don't you monitor the backup failure directly with logmon if the information is from a log file or from ntevl if the backup failure is written to a windows event viewer? Or let logmon execute a script that found the failure and open the alarm from logmon's script output.

    UIM is a monitoring tool, you should monitor the failure instead of manually found the failure and manually open an alarm.

    The solution of creating the alarm from the API call could work but you now need to monitor the return code of your api request in case it does not work or if the API was not available. At least, from logmon the alarm message goes to an alarm queue and will stay there until it get consume and transform as a real alarm. Messages that are not consumed yet are on disk inside the folder hub/q/<alarm queue> so you will not loose it.

    If you don't handle a retry from your api request in case of failure you will never know about your backup failure.




  • 4.  RE: create alarm by rest api

    Posted Nov 24, 2021 03:41 PM
    by backup failure alarm I meant integrating with backup tool which has its api calls from where I can not only monitor backup failures but other errors of backup tool itself so logs method won't work.
    Having said that I did try the api call with above body but the result is coming as no content with success code So did i miss something


  • 5.  RE: create alarm by rest api

    Posted Nov 25, 2021 02:56 PM
    Hello,
    If you received a 204 no content, no you're not supposed to have miss something


    Source: https://techdocs.broadcom.com/us/en/ca-enterprise-software/it-operations-management/ca-unified-infrastructure-management-probes/GA/probe-development-tools/restful-web-services/webservices-rest-apis/webservices-rest-call-reference/alarm-calls.html#concept.dita_90d18bfb3205046b7d6491defe72a264a6defe52_CreateanAlarm

    Return code 204 / No content means that it works.
    Did you check if you have an alarm with the information you included inside the body of your request?


  • 6.  RE: create alarm by rest api

    Posted Nov 26, 2021 04:37 AM
    yes actually visible parameter was left false hence the alarm was not there once that was corrected alarm was created.

    One doubt though the alarm that is created i coming from wasp probe i wanted to pass on a probe name like backup or something which is unique to tool i am integrating since we are using this probe segregation to further automate and create auto tickets through scripts

    regards
    Nijin


  • 7.  RE: create alarm by rest api

    Posted Nov 29, 2021 11:06 AM

    Hello,
    As far as I know, you will not be able to change the prid field from the rest call. It will always come from the wasp probe since it has been open from the rest api.

    The only solution to this I could think of id to create a pre-processing rules that will match your alarm and run a LUA script when it matched that will change the PRID.

    https://techdocs.broadcom.com/us/en/ca-enterprise-software/it-operations-management/ca-unified-infrastructure-management-probes/GA/alphabetical-probe-articles/nas-alarm-server/the-nas-extensions-to-lua-all-versions/language-extensions.html

    But I doubt you can use a probe name that does not exist.

    Also, I'm not a fan of hiding real information because it makes troubleshooting more difficult in the future. If I was you I would use any of the custom_ field to add the "backup information", use a subsystem ID or a user_tag to identify it but I would keep the prid as "wasp".