Resolve an Alarm by API

mbudke
mbudke Member Posts: 137 ✭✭✭
edited December 2023 in Scripts

Hey all,

I am not sure if this is possible so I hope someone of you already tried it :)

I would like to make more use of the alarm type "Information" to just track actions like when a specific user logged in to a server or a backup has been succesfuly. This type of alarm does not require a specific action/task from my side so Information should be the best type. I only need this info when something goes wrong to track back into the past.

Alarms with the type "Information" cannot be auto-closed which makes not much sense to me.
Currently I have thousands of open alarms just because of sucesful backups. This is not very productive as it hides other types of alarms. Closing them manual would be a daily task which I would like to avoid.

Therefore I thought to automate it via the API. Unfortunately from the API documentation I did not find a method how to update an alarm.

Do you know if this is possible?

Comments

  • nina
    nina Internal Posts: 428 ✭✭✭✭✭

    Hi @Matthias -  I don't believe it's possible.

    You can use the Alerts tab and filter the necessary alerts and then resolve them in bulk. Would that work? Or too manual?

  • mbudke
    mbudke Member Posts: 137 ✭✭✭

    Hi @nina ,

    Thanks for the reply.
    I am more looking into something full automatic. "Info" should not require any interaction and is just for tracking purpose. Or do I use the "Info" wrongly?

  • kim
    kim Member Posts: 113 ✭✭✭

    Hi @Matthias,

    i wonder if we could leverage the AI tools to help automate these tasks? I haven't tried it yet, but I feel like potentially we could use that.

  • mbudke
    mbudke Member Posts: 137 ✭✭✭

    Hi @kim

    I think AI would be a great help in a lot of different actions but in some actions I would prefer just defining a static simple rule :-)
    The reason is that AI got a lot better within the last few years but from my point of view it still requires a human to look at it and confirm the action.
    My request is a very basic action which could be handled in a rule. In case that AI e.g. misinterprets an ERROR with an INFO and closes it down then this would be a very huge impact.

    AI is a great hype and most like a very big part in the future but we are still in 2023 ;-)

  • nina
    nina Internal Posts: 428 ✭✭✭✭✭

    Hi @Matthias - You could limit the 'noise' generated by the Threshold by only generating Information Alerts from certain Event IDs. The only other option would be for you to export the Information Alerts to a different tool via API and set up auto-close rules using a 3rd party.

  • mbudke
    mbudke Member Posts: 137 ✭✭✭

    Hi,

    someone did raise a support ticket for me (Thanks! :-) ) and support did confirm that by today it is not possible to perform my request.
    I think the following feature request shall cover what I need:
    https://atera.uservoice.com/forums/936306-ideas-and-feedback/suggestions/44893273-allow-to-resolve-alerts-via-api-rather-than-only

  • nina
    nina Internal Posts: 428 ✭✭✭✭✭

    Yes, I opened the ticket. Okay, thank you for updating!

  • mavenoso
    mavenoso Member Posts: 4

    Its not a great solution, but I've had to deal with the pain of not being able to change a status of an alert via the API with my script for monitoring servers for being offline and have used the work around of deleting the alert with the API. In your need, you should be able to filter out the successful backup alerts and just delete them

  • larsandersen
    larsandersen Member Posts: 5

    @mbudke

    It is possible to delete alerts through API .
    you just have to be a bit selective when you run through the list of alerts, and there aren't many sorting options, when getting the alerts.
    but it definately is doable.

  • mbudke
    mbudke Member Posts: 137 ✭✭✭

    @larsandersen
    I do not want to delete the alerts but I would like to resolve the alerts.

    Example:
    I want an "Info" alert for each succesful backup process to just track it. But for me it is only an information and thereforer should be resolved immediately. Deleting would mean that I lose the information.

  • larsandersen
    larsandersen Member Posts: 5

    @mbudke

    My bad,

    It is also possible to resolve them just as easy...

  • MisterDuval
    MisterDuval Member Posts: 4

    You could use PSAtera version 1.7+ with a command simple as:

    Install-Module -Name PSAtera -MinimumVersion 1.7.0
    Import-Module PSAtera
    Set-AteraAPIKey "YOUR_API_KEY"
    get-AteraAlerts -Open -Information | ForEach-Object { set-AteraAlert -AlertID $_.AlertID }

    You could execute that script on your computer, or on a distant server within Atera.