[GH-ISSUE #89] Feature Request: Run Script in addition to SMS/Email alerts #48

Closed
opened 2026-03-02 02:13:07 +03:00 by kerem · 2 comments
Owner

Originally created by @bradhawkins85 on GitHub (Sep 1, 2020).
Original GitHub issue: https://github.com/amidaware/tacticalrmm/issues/89

Originally assigned to: @wh1te909, @sadnub on GitHub.

Adding the ability to run scripts would allow some integration between Tactical and other apps.
EG, osTicket, there is a script that would accept variables to create a ticket when an issue occurs.

raiseticket.py --issuesummary "{HOST.NAME} - {EVENT.NAME}" --issuedetails "{HOST.NAME} {EVENT.NAME}" --email {$TICKETCONTACT}

`#!/usr/bin/python
import argparse
import requests
import json

parser = argparse.ArgumentParser(description="Raises tickets in OSTicket")
parser.add_argument('--issuesummary', required=True, help='The issue summary that will appear in osTicket', dest='summary')
parser.add_argument('--issuedetails', required=True, help='The issue detail that will appear in osTicket', dest='detail')
parser.add_argument('--email', required=True, help='The issue detail that will appear in osTicket', dest='email')
args = parser.parse_args()

url = "https://osticket.mydomain.com/api/tickets.json"
key = "apikeyhere"

data = {
"name":"Zabbix",
"email":args.email,
"phone":"0123456789",
"subject":args.summary,
"message":args.detail,
"topicId":10
}

headers = {
"X-API-Key": key
}

r = requests.post(url,data=json.dumps(data),headers=headers)
print r.text
`

In this case raiseticket.py would be located on the RMM server and executed with the appropriate variables to log the ticket against the correct user in osTicket.

This would allow anyone to build their own script for alerting etc.

For checks this could be probably handled with Checks/Tasks when variables are implemented but it would be good if it could be performed for offline servers etc too.

Originally created by @bradhawkins85 on GitHub (Sep 1, 2020). Original GitHub issue: https://github.com/amidaware/tacticalrmm/issues/89 Originally assigned to: @wh1te909, @sadnub on GitHub. Adding the ability to run scripts would allow some integration between Tactical and other apps. EG, osTicket, there is a script that would accept variables to create a ticket when an issue occurs. raiseticket.py --issuesummary "{HOST.NAME} - {EVENT.NAME}" --issuedetails "{HOST.NAME} {EVENT.NAME}" --email {$TICKETCONTACT} `#!/usr/bin/python import argparse import requests import json parser = argparse.ArgumentParser(description="Raises tickets in OSTicket") parser.add_argument('--issuesummary', required=True, help='The issue summary that will appear in osTicket', dest='summary') parser.add_argument('--issuedetails', required=True, help='The issue detail that will appear in osTicket', dest='detail') parser.add_argument('--email', required=True, help='The issue detail that will appear in osTicket', dest='email') args = parser.parse_args() url = "https://osticket.mydomain.com/api/tickets.json" key = "apikeyhere" data = { "name":"Zabbix", "email":args.email, "phone":"0123456789", "subject":args.summary, "message":args.detail, "topicId":10 } headers = { "X-API-Key": key } r = requests.post(url,data=json.dumps(data),headers=headers) print r.text ` In this case raiseticket.py would be located on the RMM server and executed with the appropriate variables to log the ticket against the correct user in osTicket. This would allow anyone to build their own script for alerting etc. For checks this could be probably handled with Checks/Tasks when variables are implemented but it would be good if it could be performed for offline servers etc too.
kerem 2026-03-02 02:13:07 +03:00
Author
Owner

@wh1te909 commented on GitHub (Sep 1, 2020):

great point, currently you can create a task (script) and have it run only on check failure (which is calculated agent side atm, and then if status is failing the agent will download the script from the rmm and run it locally) so yea won't work for agents that are offline.

<!-- gh-comment-id:684518903 --> @wh1te909 commented on GitHub (Sep 1, 2020): great point, currently you can create a task (script) and have it run only on check failure (which is calculated agent side atm, and then if status is failing the agent will download the script from the rmm and run it locally) so yea won't work for agents that are offline.
Author
Owner

@sadnub commented on GitHub (Apr 27, 2021):

This is now possible with alert templates and failure and resolved actions. You can also access the alert object in using script args.
https://wh1te909.github.io/tacticalrmm/script_variables/#alert

<!-- gh-comment-id:827734353 --> @sadnub commented on GitHub (Apr 27, 2021): This is now possible with alert templates and failure and resolved actions. You can also access the alert object in using script args. https://wh1te909.github.io/tacticalrmm/script_variables/#alert
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tacticalrmm#48
No description provided.