mirror of
https://github.com/amidaware/tacticalrmm.git
synced 2026-04-26 15:05:57 +03:00
[GH-ISSUE #89] Feature Request: Run Script in addition to SMS/Email alerts #1992
Labels
No labels
In Process
bug
bug
dev-triage
documentation
duplicate
enhancement
fixed
good first issue
help wanted
integration
invalid
pull-request
question
requires agent update
security
ui tweak
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tacticalrmm#1992
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.
@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.
@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