DX Operational Intelligence

Expand all | Collapse all

Changes to the webservice model - how to create alarms?

Jump to Best Answer
  • 1.  Changes to the webservice model - how to create alarms?

    Posted 07-15-2015 06:04 AM

    The universal connectors syntax again changed somewhere between 3.2 and current 3.3 CU2

     

    I am running a python script for a customer, which is creating CIs and sending them alerts via SOAP requests. After upgrading to 3.3CU2, my script was no longer working

    While I managed to get the CI creation process working again, the alarming still is not functioning properly:

     

    Sending an alarm will alert the correct CI, but a subsequent alarm to another CI will sort of 'move' the first alarm to the second CI, instead of producing a second alarm

    Seems I am missing somthing to identify the alarm properly.

     

    The event looks like this:

     

    (Item){

       className = "Alert"

       eventtype = "AddEvents"

       ciProperties[] =

          (CIProperty){

             name = "instanceID"

             value = "myApp:myHostname"

          },

          (CIProperty){

             name = "deviceID"

             value = "myApp:myHostname"

          },

          (CIProperty){

            name = "severity"

              value = 3

          },

          (CIProperty){

             name = "situationMessage"

             value = "myApp"

          },

          (CIProperty){

             name = "eventDetail"

             value = "OK - ActiveMQ Version - 5.4.1.2"

          },

    }

     

     

    Any ideas what I am doing wrong?

    Does anybody have a working example how to construct a correct event ?

     

     

    Thanks

    Jan



  • 2.  Re: Changes to the webservice model - how to create alarms?

    Posted 07-15-2015 06:15 AM

    Hello Jan,

     

    The valid values "Severity" attribute are 'Normal', 'Minor','Major','Critical' and 'Fatal'.

    Please use these values for alert publication.

     

    Let me know if this helps.

    Thanks

    Brahma



  • 3.  Re: Changes to the webservice model - how to create alarms?

    Posted 07-15-2015 06:19 AM

    Hello Brahma,

     

    but my alarm gets created with correct Severity, so "Severity=<integer>" does not sem to be a problem

     

    Cheers

    Jan



  • 4.  Re: Changes to the webservice model - how to create alarms?

    Posted 07-15-2015 07:13 AM

    Hi Brahma,

     

    just tested: "Minor/Major/..." does not work at all!

     

    Regds

    Jan



  • 5.  Re: Changes to the webservice model - how to create alarms?

    Posted 07-15-2015 07:24 AM

    Hi Jan,

     

    What is the result when generating an alert by running 'GCEventAddCmd.bat' command by passing arguments or input the .xml file?

     

    Thanks

    Brahma



  • 6.  Re: Changes to the webservice model - how to create alarms?

    Posted 07-15-2015 08:09 AM

    Hi Brahma,

     

    yes, I tried that but the command behaves not as expected

    In order to not clutter this thread, I have opened a new one for this

    https://communities.ca.com/message/241808388#241808388

     

    Cheers Jan



  • 7.  Re: Changes to the webservice model - how to create alarms?

    Posted 07-16-2015 05:31 AM

    OK after this is resolved, I now tested with sending the alerts through the command-line

     

    This behaves correctly, alerts are assigned to the correct CI and do not get cleared by subsequent alerts to other CIs

     

    So there must be something wrong with the event created by my SOAP request

     

    I already tried to include

      (CIProperty){
         name = "mdrElementID"
         value = "something 1"
      },

    in order to include different AlarmIDs for the differetn alarms, but this did not help

     

    What am I missing?



  • 8.  Re: Changes to the webservice model - how to create alarms?

    Posted 07-16-2015 07:41 AM

    Hello Jan,

     

    The attributes are case-sensitive, can you change this to "MdrElementID", let me know if this works.

     

    Thanks

    Brahma



  • 9.  Re: Changes to the webservice model - how to create alarms?

    Posted 07-16-2015 07:44 AM

    yes already tried it and this works



  • 10.  Re: Changes to the webservice model - how to create alarms?
    Best Answer

    Posted 08-27-2015 03:57 AM

    There were some mistakes in my attempts above

     

    - The main problem was that the alarm now needs a unique identification, the MdrElementID. It was called AlarmID in previous versions and it was not necessary back then. If you miss it now, you do not create new alarms by repeatedly firing the event above, but just update the original one. This accounts for my observation of alarms wandering from CI to CI

     

    - The old instanceID is now called AlertedMdrElementID

     

    - As pointed out by Brahma, the names are case-sensitive, so there is a difference between Severity and severity

       Severity is the new name and has values of 'Minor, Major, ...'

       severity is the old name and accepts 0,1,2...

     

    - deviceID is not necessary anymore

     

    Confusingly, UC sometimes accepts both old and new syntax and converts it in the background, but this does not work always.

     

    So a working example of settings for an Alert, as constructed in python, is:

     

    >>> event

    (Item){

       ciProperties[] =

          (CIProperty){

             name = "AlertType"

             value = "Risk"

          },

          (CIProperty){

             name = "MdrElementID"

             value = "alarm:myHost:myCheck"

          },

          (CIProperty){

             name = "AlertedMdrElementID"

             value = "myCheck:myHost"

          },

          (CIProperty){

             name = "Severity"

             value = "Minor"

          },

          (CIProperty){

             name = "Summary"

             value = "myCheck"

          },

          (CIProperty){

             name = "EventDetail"

             value = "WARN - ActiveMQ old Version - 5.0"

          },

       className = "Alert"

       eventtype = "AddEvents"

    }