amidaware / tacticalrmm

A remote monitoring & management tool, built with Django, Vue and Go.
https://docs.tacticalrmm.com
Other
2.92k stars 422 forks source link

Agent history shows the name of the alert action script instead of the alert resolved script #1852

Closed sebvonhelsinki closed 2 months ago

sebvonhelsinki commented 2 months ago

Server Info (please complete the following information):

Installation Method:

Agent Info (please complete the following information):

Describe the bug I created two scripts: "Failure_Action_CreateTicket" and "Resolve_Action_CloseTicket". As the name implies, these are used in an alerting template to create or close tickets in our issue tracking system. However, the history shows the name of the "Failure_Action_CreateTicket" as the executed script no matter if an alert was triggered or resolved.

To Reproduce Steps to reproduce the behavior:

  1. Create two scripts
  2. Create an Alert Template
  3. In the Alert Template, under Alert Actions, set one script in "Alert Failure Settings" and the other under "Alert Resolved Settings"
  4. Apply the template to an agent
  5. Create a check that will always fail (i.e.: pingcheck to a private IP range different from the one the agent is part of)
  6. Wait for the check to fail. The agent history should show an action "Script Run", the name of the script set at Alert Failure Settings, and Initiated by "alert-action-failure"
  7. resolve the check (i.e.: change the IP in the ping-check to the IP of a known active device)
  8. wait for the check to resolve. The agent history now shows an action "Script Run", still the name of the script set at Alert Failure Settings, but Initiated by "alert-action-resolved"

Expected behavior The history should show that the script "Resolve_Action_CloseTicket" has been run.

Screenshots Screenshot of the Alert template: grafik

Screenshot of the client history: grafik

Additional context My understanding is that this is only a display error in the History section of the agents. The scripts I wrote and the alert template work as intended and tickets are created and closed as expected, so I can confirm that the alert template actually runs the second script as it should. The "output" column in the History section also returns the output I expect form the second script.

wh1te909 commented 2 months ago

thanks, fix will be in next release (for new entries only, can't fix what's already in db)

sebvonhelsinki commented 2 months ago

Great, thanks for the quick fix!