Compare commits

..

14 Commits

Author SHA1 Message Date
wh1te909
6278240526 Release 0.4.12 2021-02-18 07:36:31 +00:00
wh1te909
8c2dc5f57d typo 2021-02-18 07:34:28 +00:00
wh1te909
2e5868778a Release 0.4.11 2021-02-17 23:35:00 +00:00
wh1te909
a10b8dab9b bump versions 2021-02-17 23:31:49 +00:00
wh1te909
92f4f7ef59 go 1.16 2021-02-17 23:26:56 +00:00
wh1te909
31257bd5cb Release 0.4.10 2021-02-17 19:35:51 +00:00
wh1te909
bb6510862f bump version 2021-02-17 19:35:24 +00:00
sadnub
797ecf0780 implement exclude workstations and servers. Fix excluding individual clients, sites, and agents 2021-02-17 14:19:07 -05:00
sadnub
f9536dc67f allow viewing alert script results on resolved alerts 2021-02-17 13:29:51 -05:00
sadnub
e8b95362af fix automation manager UI. Modify agent/check/task table alert checkboxes to show if it is managed by an alert template 2021-02-17 13:29:51 -05:00
sadnub
bdc39ad4ec Create alerting.md 2021-02-16 23:11:34 -05:00
wh1te909
4a202c5585 Release 0.4.9 2021-02-16 23:39:22 +00:00
wh1te909
3c6b321f73 bump version 2021-02-16 23:38:38 +00:00
wh1te909
cb29b52799 remove unused import 2021-02-16 23:14:03 +00:00
29 changed files with 585 additions and 291 deletions

View File

@@ -15,7 +15,7 @@ RUN groupadd -g 1000 tactical && \
useradd -u 1000 -g 1000 tactical
# Copy Go Files
COPY --from=golang:1.15 /usr/local/go ${TACTICAL_GO_DIR}/go
COPY --from=golang:1.16 /usr/local/go ${TACTICAL_GO_DIR}/go
# Copy Dev python reqs
COPY ./requirements.txt /

View File

@@ -542,17 +542,22 @@ class Agent(BaseAuditModel):
for template in templates:
# check if client, site, or agent has been excluded from template
if (
client.pk in template.excluded_clients.all()
or site.pk in template.excluded_sites.all()
or self.pk in template.excluded_agents.all()
client.pk
in template.excluded_clients.all().values_list("pk", flat=True)
or site.pk in template.excluded_sites.all().values_list("pk", flat=True)
or self.pk
in template.excluded_agents.all()
.only("pk")
.values_list("pk", flat=True)
):
continue
# see if template is excluding desktops
if (
self.monitoring_type == "workstation"
and not template.agent_include_desktops
):
# check if template is excluding desktops
if self.monitoring_type == "workstation" and template.exclude_workstations:
continue
# check if template is excluding servers
elif self.monitoring_type == "server" and template.exclude_servers:
continue
else:
return template

View File

@@ -56,6 +56,20 @@ class AgentTableSerializer(serializers.ModelSerializer):
logged_username = serializers.SerializerMethodField()
italic = serializers.SerializerMethodField()
policy = serializers.ReadOnlyField(source="policy.id")
alert_template = serializers.SerializerMethodField()
def get_alert_template(self, obj):
alert_template = obj.get_alert_template()
if not alert_template:
return None
else:
return {
"name": alert_template.name,
"always_email": alert_template.agent_always_email,
"always_text": alert_template.agent_always_text,
"always_alert": alert_template.agent_always_alert,
}
def get_pending_actions(self, obj):
return obj.pendingactions.filter(status="pending").count()
@@ -83,6 +97,7 @@ class AgentTableSerializer(serializers.ModelSerializer):
model = Agent
fields = [
"id",
"alert_template",
"hostname",
"agent_id",
"site_name",

View File

@@ -0,0 +1,72 @@
# Generated by Django 3.1.6 on 2021-02-17 17:36
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('alerts', '0005_auto_20210212_1745'),
]
operations = [
migrations.RemoveField(
model_name='alerttemplate',
name='agent_include_desktops',
),
migrations.AddField(
model_name='alerttemplate',
name='exclude_servers',
field=models.BooleanField(blank=True, default=False, null=True),
),
migrations.AddField(
model_name='alerttemplate',
name='exclude_workstations',
field=models.BooleanField(blank=True, default=False, null=True),
),
migrations.AlterField(
model_name='alerttemplate',
name='agent_always_alert',
field=models.BooleanField(blank=True, default=None, null=True),
),
migrations.AlterField(
model_name='alerttemplate',
name='agent_always_email',
field=models.BooleanField(blank=True, default=None, null=True),
),
migrations.AlterField(
model_name='alerttemplate',
name='agent_always_text',
field=models.BooleanField(blank=True, default=None, null=True),
),
migrations.AlterField(
model_name='alerttemplate',
name='check_always_alert',
field=models.BooleanField(blank=True, default=None, null=True),
),
migrations.AlterField(
model_name='alerttemplate',
name='check_always_email',
field=models.BooleanField(blank=True, default=None, null=True),
),
migrations.AlterField(
model_name='alerttemplate',
name='check_always_text',
field=models.BooleanField(blank=True, default=None, null=True),
),
migrations.AlterField(
model_name='alerttemplate',
name='task_always_alert',
field=models.BooleanField(blank=True, default=None, null=True),
),
migrations.AlterField(
model_name='alerttemplate',
name='task_always_email',
field=models.BooleanField(blank=True, default=None, null=True),
),
migrations.AlterField(
model_name='alerttemplate',
name='task_always_text',
field=models.BooleanField(blank=True, default=None, null=True),
),
]

View File

@@ -170,10 +170,9 @@ class AlertTemplate(models.Model):
# agent alert settings
agent_email_on_resolved = BooleanField(null=True, blank=True, default=False)
agent_text_on_resolved = BooleanField(null=True, blank=True, default=False)
agent_include_desktops = BooleanField(null=True, blank=True, default=False)
agent_always_email = BooleanField(null=True, blank=True, default=False)
agent_always_text = BooleanField(null=True, blank=True, default=False)
agent_always_alert = BooleanField(null=True, blank=True, default=False)
agent_always_email = BooleanField(null=True, blank=True, default=None)
agent_always_text = BooleanField(null=True, blank=True, default=None)
agent_always_alert = BooleanField(null=True, blank=True, default=None)
agent_periodic_alert_days = PositiveIntegerField(blank=True, null=True, default=0)
# check alert settings
@@ -194,9 +193,9 @@ class AlertTemplate(models.Model):
)
check_email_on_resolved = BooleanField(null=True, blank=True, default=False)
check_text_on_resolved = BooleanField(null=True, blank=True, default=False)
check_always_email = BooleanField(null=True, blank=True, default=False)
check_always_text = BooleanField(null=True, blank=True, default=False)
check_always_alert = BooleanField(null=True, blank=True, default=False)
check_always_email = BooleanField(null=True, blank=True, default=None)
check_always_text = BooleanField(null=True, blank=True, default=None)
check_always_alert = BooleanField(null=True, blank=True, default=None)
check_periodic_alert_days = PositiveIntegerField(blank=True, null=True, default=0)
# task alert settings
@@ -217,11 +216,15 @@ class AlertTemplate(models.Model):
)
task_email_on_resolved = BooleanField(null=True, blank=True, default=False)
task_text_on_resolved = BooleanField(null=True, blank=True, default=False)
task_always_email = BooleanField(null=True, blank=True, default=False)
task_always_text = BooleanField(null=True, blank=True, default=False)
task_always_alert = BooleanField(null=True, blank=True, default=False)
task_always_email = BooleanField(null=True, blank=True, default=None)
task_always_text = BooleanField(null=True, blank=True, default=None)
task_always_alert = BooleanField(null=True, blank=True, default=None)
task_periodic_alert_days = PositiveIntegerField(blank=True, null=True, default=0)
# exclusion settings
exclude_workstations = BooleanField(null=True, blank=True, default=False)
exclude_servers = BooleanField(null=True, blank=True, default=False)
excluded_sites = models.ManyToManyField(
"clients.Site", related_name="alert_exclusions", blank=True
)

View File

@@ -14,6 +14,24 @@ class TaskSerializer(serializers.ModelSerializer):
assigned_check = CheckSerializer(read_only=True)
schedule = serializers.ReadOnlyField()
last_run = serializers.ReadOnlyField(source="last_run_as_timezone")
alert_template = serializers.SerializerMethodField()
def get_alert_template(self, obj):
if obj.agent:
alert_template = obj.agent.get_alert_template()
else:
alert_template = None
if not alert_template:
return None
else:
return {
"name": alert_template.name,
"always_email": alert_template.task_always_email,
"always_text": alert_template.task_always_text,
"always_alert": alert_template.task_always_alert,
}
class Meta:
model = AutomatedTask

View File

@@ -20,6 +20,23 @@ class CheckSerializer(serializers.ModelSerializer):
assigned_task = serializers.SerializerMethodField()
last_run = serializers.ReadOnlyField(source="last_run_as_timezone")
history_info = serializers.ReadOnlyField()
alert_template = serializers.SerializerMethodField()
def get_alert_template(self, obj):
if obj.agent:
alert_template = obj.agent.get_alert_template()
else:
alert_template = None
if not alert_template:
return None
else:
return {
"name": alert_template.name,
"always_email": alert_template.check_always_email,
"always_text": alert_template.check_always_text,
"always_alert": alert_template.check_always_alert,
}
## Change to return only array of tasks after 9/25/2020
def get_assigned_task(self, obj):

View File

@@ -29,23 +29,5 @@ class Command(BaseCommand):
self.style.SUCCESS(f"Migrated disks on {agent.hostname}")
)
# install go
if not os.path.exists("/usr/local/rmmgo/"):
self.stdout.write(self.style.SUCCESS("Installing golang"))
subprocess.run("sudo mkdir -p /usr/local/rmmgo", shell=True)
tmpdir = tempfile.mkdtemp()
r = subprocess.run(
f"wget https://golang.org/dl/go1.15.5.linux-amd64.tar.gz -P {tmpdir}",
shell=True,
)
gotar = os.path.join(tmpdir, "go1.15.5.linux-amd64.tar.gz")
subprocess.run(f"tar -xzf {gotar} -C {tmpdir}", shell=True)
gofolder = os.path.join(tmpdir, "go")
subprocess.run(f"sudo mv {gofolder} /usr/local/rmmgo/", shell=True)
shutil.rmtree(tmpdir)
# load community scripts into the db
Script.load_community_scripts()

View File

@@ -46,7 +46,7 @@ def setup_periodic_tasks(sender, **kwargs):
from agents.tasks import agent_outages_task
from core.tasks import core_maintenance_tasks
from alerts.tasks import unsnooze_alerts, periodic_alert_notifications
from alerts.tasks import unsnooze_alerts
sender.add_periodic_task(60.0, agent_outages_task.s())
sender.add_periodic_task(60.0 * 30, core_maintenance_tasks.s())

View File

@@ -15,14 +15,14 @@ EXE_DIR = os.path.join(BASE_DIR, "tacticalrmm/private/exe")
AUTH_USER_MODEL = "accounts.User"
# latest release
TRMM_VERSION = "0.4.8"
TRMM_VERSION = "0.4.12"
# bump this version everytime vue code is changed
# to alert user they need to manually refresh their browser
APP_VER = "0.0.112"
APP_VER = "0.0.113"
# https://github.com/wh1te909/rmmagent
LATEST_AGENT_VER = "1.4.5"
LATEST_AGENT_VER = "1.4.6"
MESH_VER = "0.7.68"

View File

@@ -7,7 +7,7 @@ POSTGRES_PW="hunter2"
#####################################################
SCRIPT_VERSION="8"
SCRIPT_VERSION="9"
SCRIPT_URL='https://raw.githubusercontent.com/wh1te909/tacticalrmm/master/backup.sh'
GREEN='\033[0;32m'
@@ -53,7 +53,6 @@ fi
printf >&2 "${GREEN}Running postgres vacuum${NC}\n"
sudo -u postgres psql -d tacticalrmm -c "vacuum full logs_auditlog"
sudo -u postgres psql -d tacticalrmm -c "vacuum full logs_pendingaction"
sudo -u postgres psql -d tacticalrmm -c "vacuum full agents_agentoutage"
dt_now=$(date '+%Y_%m_%d__%H_%M_%S')
tmp_dir=$(mktemp -d -t tacticalrmm-XXXXXXXXXXXXXXXXXXXXX)

View File

@@ -40,7 +40,7 @@ COPY api/tacticalrmm ${TACTICAL_TMP_DIR}/api
COPY scripts ${TACTICAL_TMP_DIR}/scripts
# copy go install from build stage
COPY --from=golang:1.15 /usr/local/go ${TACTICAL_GO_DIR}/go
COPY --from=golang:1.16 /usr/local/go ${TACTICAL_GO_DIR}/go
COPY --from=CREATE_VENV_STAGE ${VIRTUAL_ENV} ${VIRTUAL_ENV}
# install deps

69
docs/docs/alerting.md Normal file
View File

@@ -0,0 +1,69 @@
# Alerting Overview
## Notification Types
* *Email Alerts* - Sends email
* *SMS Alerts* - Sends text message
* *Dashboard Alerts* - Adds a notification in the dashboard alert icon
## Alert Severities
* Informational
* Warning
* Error
#### Agents
Agent offline alerts always have an error severity.
#### Checks
Checks can be configured to create alerts with different severities
* Memory and Cpuload checks can be configured with a warning and error threshold. To disable one of them put in a 0.
* Script checks allow for information and warning return codes. Everything else, besides a 0 will result in an error severity.
* Event Log, service, and ping checks require you to set the severity to information, warning, or error.
#### Automated Tasks
For automated tasks, you set the what the alert severity should be directly on the task.
## Configure Alert Templates
Alert template allow you to setup alerting and notifications on many agents at once. Alert templates can be applied to Sites, Client, Automation Policies, and in the Global Settings.
To create an alert template, go to Settings > Alerts Manager. Then click New
In the form, give the alert template a name and make sure it is enabled.
Optionally setup any of the below settings:
* *Failure Action* - Runs the selected script once on any agent. This is useful for running one-time tasks like sending an http request to an external system to create a ticket.
* *Failure action args* - Optionally pass in arguments to the failure script.
* *Failure action timeout* - Sets the timeout for the script.
* *Resolved action* - Runs the selected script once on any agent if the alert is resolved. This is useful for running onetime tasks like sending an http request to an external system to close the ticket that was created.
* *Resolved action args* - Optionally pass in arguments to the resolved script.
* *Resolved action timeout* - Sets the timeout for the script.
* *Email Recipients* - Overrides the default email recipients in Global Settings.
* *From Email* - Overrides the From email address in Global Settings.
* *SMS Recipients* - Overrides the SMS recipients in Global Settings.
* *Include desktops* - Will apply to desktops
#### agent/check/task settings
* *Email on resolved* - Sends a email when the alert clears
* *Text on resolved* - Sends a text when the alert clears
* *Always email* - This enables the email notification setting on the agent/check/task
* *Always sms* - This enables the text notification setting on the agent/check/task
* *Always dashboard alert* - This enables the dashboard alert notification setting on the agent/check/task
* *Periodic notification* - This sets up a periodic notification on for the agent/check/task alert
* *Alert on severity* - When configured, will only send a notification through the corresponding channel if the alert is of the specified severity
## Applying Alert Templates
Alerts are applied in the following over. The agent picks the closest matching alert template.
* Right-click on any Client or Site and go to Assign Alert Template
* In Automation Manager, click on Assign Alert Template for the policy you want to apply it to
* In Global Settings, select the default alert template
1. Policy w/ Alert Template applied to Site
2. Site
3. Policy w/ Alert Template applied to Client
4. Client
5. Default Alert Template

8
go.mod
View File

@@ -1,12 +1,12 @@
module github.com/wh1te909/tacticalrmm
go 1.15
go 1.16
require (
github.com/go-resty/resty/v2 v2.4.0
github.com/go-resty/resty/v2 v2.5.0
github.com/josephspurrier/goversioninfo v1.2.0
github.com/nats-io/nats.go v1.10.1-0.20210107160453-a133396829fc
github.com/ugorji/go/codec v1.2.3
github.com/wh1te909/rmmagent v1.4.3
github.com/ugorji/go/codec v1.2.4
github.com/wh1te909/rmmagent v1.4.6
golang.org/x/net v0.0.0-20210119194325-5f4716e94777 // indirect
)

28
go.sum
View File

@@ -10,8 +10,8 @@ github.com/elastic/go-windows v1.0.0/go.mod h1:TsU0Nrp7/y3+VwE82FoZF8gC/XFg/Elz6
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM=
github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
github.com/go-resty/resty/v2 v2.4.0 h1:s6TItTLejEI+2mn98oijC5w/Rk2YU+OA6x0mnZN6r6k=
github.com/go-resty/resty/v2 v2.4.0/go.mod h1:B88+xCTEwvfD94NOuE6GS1wMlnoKNY8eEiNizfNwOwA=
github.com/go-resty/resty/v2 v2.5.0 h1:WFb5bD49/85PO7WgAjZ+/TJQ+Ty1XOcWEfD1zIFCM1c=
github.com/go-resty/resty/v2 v2.5.0/go.mod h1:B88+xCTEwvfD94NOuE6GS1wMlnoKNY8eEiNizfNwOwA=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
@@ -23,7 +23,6 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw
github.com/gonutz/w32 v1.0.1-0.20201105145118-e88c649a9470/go.mod h1:Rc/YP5K9gv0FW4p6X9qL3E7Y56lfMflEol1fLElfMW4=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/iamacarpet/go-win64api v0.0.0-20200715182619-8cbc936e1a5a/go.mod h1:oGJx9dz0Ny7HC7U55RZ0Smd6N9p3hXP/+hOFtuYrAxM=
@@ -31,10 +30,8 @@ github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJS
github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901/go.mod h1:Z86h9688Y0wesXCyonoVr47MasHilkuLMqGhRZ4Hpak=
github.com/josephspurrier/goversioninfo v1.2.0 h1:tpLHXAxLHKHg/dCU2AAYx08A4m+v9/CWg6+WUvTF4uQ=
github.com/josephspurrier/goversioninfo v1.2.0/go.mod h1:AGP2a+Y/OVJZ+s6XM4IwFUpkETwvn0orYurY8qpw1+0=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/minio/highwayhash v1.0.0 h1:iMSDhgUILCr0TNm8LWlSjF8N0ZIj2qbO8WHp6Q/J2BA=
github.com/minio/highwayhash v1.0.0/go.mod h1:xQboMTeM9nY9v/LlAOxFctujiv5+Aq2hR5dxBpaMbdc=
@@ -75,24 +72,20 @@ github.com/rickb777/date v1.14.2/go.mod h1:swmf05C+hN+m8/Xh7gEq3uB6QJDNc5pQBWojK
github.com/rickb777/date v1.15.3/go.mod h1:+spwdRnUrpqbYLOmRM6y8FbQMXwpNwHrNcWuOUipge4=
github.com/rickb777/plural v1.2.2/go.mod h1:xyHbelv4YvJE51gjMnHvk+U2e9zIysg6lTnSQK8XUYA=
github.com/rickb777/plural v1.3.0/go.mod h1:xyHbelv4YvJE51gjMnHvk+U2e9zIysg6lTnSQK8XUYA=
github.com/shirou/gopsutil/v3 v3.20.12/go.mod h1:igHnfak0qnw1biGeI2qKQvu0ZkwvEkUcCLlYhZzdr/4=
github.com/shirou/gopsutil/v3 v3.21.1/go.mod h1:igHnfak0qnw1biGeI2qKQvu0ZkwvEkUcCLlYhZzdr/4=
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/ugorji/go v1.2.3 h1:WbFSXLxDFKVN69Sk8t+XHGzVCD7R8UoAATR8NqZgTbk=
github.com/ugorji/go v1.2.3/go.mod h1:5l8GZ8hZvmL4uMdy+mhCO1LjswGRYco9Q3HfuisB21A=
github.com/ugorji/go/codec v1.2.3 h1:/mVYEV+Jo3IZKeA5gBngN0AvNnQltEDkR+eQikkWQu0=
github.com/ugorji/go/codec v1.2.3/go.mod h1:5FxzDJIgeiWJZslYHPj+LS1dq1ZBQVelZFnjsFGI/Uc=
github.com/ugorji/go v1.2.4 h1:cTciPbZ/VSOzCLKclmssnfQ/jyoVyOcJ3aoJyUV1Urc=
github.com/ugorji/go v1.2.4/go.mod h1:EuaSCk8iZMdIspsu6HXH7X2UGKw1ezO4wCfGszGmmo4=
github.com/ugorji/go/codec v1.2.4 h1:C5VurWRRCKjuENsbM6GYVw8W++WVW9rSxoACKIvxzz8=
github.com/ugorji/go/codec v1.2.4/go.mod h1:bWBu1+kIRWcF8uMklKaJrR6fTWQOwAlrIzX22pHwryA=
github.com/wh1te909/go-win64api v0.0.0-20201021040544-8fba2a0fc3d0/go.mod h1:cfD5/vNQFm5PD5Q32YYYBJ6VIs9etzp8CJ9dinUcpUA=
github.com/wh1te909/rmmagent v1.4.2 h1:noG/ELSue3d6UF7o0gp1ty0DpGbfrVz0VG6NEQm9kGM=
github.com/wh1te909/rmmagent v1.4.2/go.mod h1:mcI27szhAGjAQzhX8eCsluE5670kUAyi3tJVJa6LNTo=
github.com/wh1te909/rmmagent v1.4.3-0.20210202083714-12142d6dfd1f h1:9r7AFleOMiVs8AiAsUezau3GVL22bqbUDz6qlRUIMFM=
github.com/wh1te909/rmmagent v1.4.3-0.20210202083714-12142d6dfd1f/go.mod h1:mcI27szhAGjAQzhX8eCsluE5670kUAyi3tJVJa6LNTo=
github.com/wh1te909/rmmagent v1.4.3 h1:9jbze6oqUBe8HJedXTrZ5i7C8dDEQt+Ifmp9am4HtZQ=
github.com/wh1te909/rmmagent v1.4.3/go.mod h1:mcI27szhAGjAQzhX8eCsluE5670kUAyi3tJVJa6LNTo=
github.com/wh1te909/rmmagent v1.4.6 h1:6cHJQRGe0YCcPJwggPU7X9tlF6Cxn41OX4Vt4YADt0Y=
github.com/wh1te909/rmmagent v1.4.6/go.mod h1:qh346DIU177vsveCjMLjdrsMVvt0hFYQHC4uRYL7RLU=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
@@ -105,7 +98,6 @@ golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/
golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20201216054612-986b41b23924/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20201224014010-6772e930b67b h1:iFwSg7t5GZmB/Q5TjiEAsdoLDrdJRC1RiF2WhuV29Qw=
golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210119194325-5f4716e94777 h1:003p0dJM77cxMSyCPFphvZf/Y5/NXf5fzg6ufd1/Oew=
golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
@@ -136,7 +128,6 @@ golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1 h1:NusfzzA6yGQ+ua51ck7E3omN
golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
@@ -146,7 +137,6 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi
google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM=
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=

View File

@@ -1,6 +1,6 @@
#!/bin/bash
SCRIPT_VERSION="38"
SCRIPT_VERSION="39"
SCRIPT_URL='https://raw.githubusercontent.com/wh1te909/tacticalrmm/master/install.sh'
sudo apt install -y curl wget dirmngr gnupg lsb-release
@@ -185,9 +185,9 @@ print_green 'Installing golang'
sudo mkdir -p /usr/local/rmmgo
go_tmp=$(mktemp -d -t rmmgo-XXXXXXXXXX)
wget https://golang.org/dl/go1.15.8.linux-amd64.tar.gz -P ${go_tmp}
wget https://golang.org/dl/go1.16.linux-amd64.tar.gz -P ${go_tmp}
tar -xzf ${go_tmp}/go1.15.8.linux-amd64.tar.gz -C ${go_tmp}
tar -xzf ${go_tmp}/go1.16.linux-amd64.tar.gz -C ${go_tmp}
sudo mv ${go_tmp}/go /usr/local/rmmgo/
rm -rf ${go_tmp}

View File

@@ -1,6 +1,6 @@
package main
// env CGO_ENABLED=0 go build -v -a -tags netgo -installsuffix netgo -ldflags "-s -w" -o nats-api
// env CGO_ENABLED=0 go build -v -a -ldflags "-s -w" -o nats-api
import (
"flag"
@@ -9,7 +9,7 @@ import (
"github.com/wh1te909/tacticalrmm/natsapi"
)
var version = "1.0.7"
var version = "1.0.8"
func main() {
ver := flag.Bool("version", false, "Prints version")

Binary file not shown.

View File

@@ -7,7 +7,7 @@ pgpw="hunter2"
#####################################################
SCRIPT_VERSION="16"
SCRIPT_VERSION="17"
SCRIPT_URL='https://raw.githubusercontent.com/wh1te909/tacticalrmm/master/restore.sh'
sudo apt install -y curl wget dirmngr gnupg lsb-release
@@ -120,9 +120,9 @@ print_green 'Installing golang'
sudo apt update
sudo mkdir -p /usr/local/rmmgo
go_tmp=$(mktemp -d -t rmmgo-XXXXXXXXXX)
wget https://golang.org/dl/go1.15.8.linux-amd64.tar.gz -P ${go_tmp}
wget https://golang.org/dl/go1.16.linux-amd64.tar.gz -P ${go_tmp}
tar -xzf ${go_tmp}/go1.15.8.linux-amd64.tar.gz -C ${go_tmp}
tar -xzf ${go_tmp}/go1.16.linux-amd64.tar.gz -C ${go_tmp}
sudo mv ${go_tmp}/go /usr/local/rmmgo/
rm -rf ${go_tmp}

View File

@@ -1,6 +1,6 @@
#!/bin/bash
SCRIPT_VERSION="106"
SCRIPT_VERSION="107"
SCRIPT_URL='https://raw.githubusercontent.com/wh1te909/tacticalrmm/master/update.sh'
LATEST_SETTINGS_URL='https://raw.githubusercontent.com/wh1te909/tacticalrmm/master/api/tacticalrmm/tacticalrmm/settings.py'
YELLOW='\033[1;33m'
@@ -174,6 +174,20 @@ if ! [[ $CHECK_NGINX_WORKER_CONN ]]; then
sudo sed -i 's/worker_connections.*/worker_connections 2048;/g' /etc/nginx/nginx.conf
fi
CHECK_HAS_GO116=$(/usr/local/rmmgo/go/bin/go version | grep go1.16)
if ! [[ $CHECK_HAS_GO116 ]]; then
printf >&2 "${GREEN}Updating golang to version 1.16${NC}\n"
sudo rm -rf /home/${USER}/go/
sudo rm -rf /usr/local/rmmgo/
sudo mkdir -p /usr/local/rmmgo
go_tmp=$(mktemp -d -t rmmgo-XXXXXXXXXX)
wget https://golang.org/dl/go1.16.linux-amd64.tar.gz -P ${go_tmp}
tar -xzf ${go_tmp}/go1.16.linux-amd64.tar.gz -C ${go_tmp}
sudo mv ${go_tmp}/go /usr/local/rmmgo/
rm -rf ${go_tmp}
sudo chown -R $USER:$GROUP /home/${USER}/.cache
fi
cd /rmm
git config user.email "admin@example.com"
git config user.name "Bob"
@@ -224,7 +238,7 @@ EOF
echo "${keepsalt}" | tee --append /rmm/api/tacticalrmm/tacticalrmm/local_settings.py > /dev/null
if [[ $rmsalt == "y" ]]; then
printf >&2 "${Green}Removing salt-master and salt-api${NC}\n"
printf >&2 "${GREEN}Removing salt-master and salt-api${NC}\n"
for i in salt-api salt-master; do sudo systemctl stop $i; sudo systemctl disable $i; done
sudo apt remove -y --purge salt-master salt-api salt-common
else
@@ -242,11 +256,6 @@ sudo cp /rmm/natsapi/bin/nats-api /usr/local/bin
sudo chown ${USER}:${USER} /usr/local/bin/nats-api
sudo chmod +x /usr/local/bin/nats-api
printf >&2 "${GREEN}Running postgres vacuum${NC}\n"
sudo -u postgres psql -d tacticalrmm -c "vacuum full logs_auditlog"
sudo -u postgres psql -d tacticalrmm -c "vacuum full logs_pendingaction"
sudo -u postgres psql -d tacticalrmm -c "vacuum full agents_agentoutage"
if [[ "${CURRENT_PIP_VER}" != "${LATEST_PIP_VER}" ]]; then
rm -rf /rmm/api/env
cd /rmm/api

View File

@@ -253,6 +253,16 @@
</q-menu>
<q-td>
<q-checkbox
v-if="props.row.alert_template && props.row.alert_template.always_text !== null"
:value="props.row.alert_template.always_text"
disable
dense
>
<q-tooltip> Setting is overidden by alert template: {{ props.row.alert_template.name }} </q-tooltip>
</q-checkbox>
<q-checkbox
v-else
dense
@input="overdueAlert('text', props.row.id, props.row.overdue_text_alert)"
v-model="props.row.overdue_text_alert"
@@ -260,6 +270,16 @@
</q-td>
<q-td>
<q-checkbox
v-if="props.row.alert_template && props.row.alert_template.always_email !== null"
:value="props.row.alert_template.always_email"
disable
dense
>
<q-tooltip> Setting is overidden by alert template: {{ props.row.alert_template.name }} </q-tooltip>
</q-checkbox>
<q-checkbox
v-else
dense
@input="overdueAlert('email', props.row.id, props.row.overdue_email_alert)"
v-model="props.row.overdue_email_alert"
@@ -267,6 +287,16 @@
</q-td>
<q-td>
<q-checkbox
v-if="props.row.alert_template && props.row.alert_template.always_alert !== null"
:value="props.row.alert_template.always_alert"
disable
dense
>
<q-tooltip> Setting is overidden by alert template: {{ props.row.alert_template.name }} </q-tooltip>
</q-checkbox>
<q-checkbox
v-else
dense
@input="overdueAlert('dashboard', props.row.id, props.row.overdue_dashboard_alert)"
v-model="props.row.overdue_dashboard_alert"
@@ -369,7 +399,6 @@
</template>
<script>
import axios from "axios";
import { notifySuccessConfig, notifyErrorConfig } from "@/mixins/mixins";
import mixins from "@/mixins/mixins";
import { mapGetters } from "vuex";

View File

@@ -109,6 +109,16 @@
<!-- text alert -->
<q-td>
<q-checkbox
v-if="props.row.alert_template && props.row.alert_template.always_text !== null"
:value="props.row.alert_template.always_text"
disable
dense
>
<q-tooltip> Setting is overidden by alert template: {{ props.row.alert_template.name }} </q-tooltip>
</q-checkbox>
<q-checkbox
v-else
dense
@input="taskAlert(props.row.id, 'Text', props.row.text_alert, props.row.managed_by_policy)"
v-model="props.row.text_alert"
@@ -118,6 +128,16 @@
<!-- email alert -->
<q-td>
<q-checkbox
v-if="props.row.alert_template && props.row.alert_template.always_email !== null"
:value="props.row.alert_template.always_email"
disable
dense
>
<q-tooltip> Setting is overidden by alert template: {{ props.row.alert_template.name }} </q-tooltip>
</q-checkbox>
<q-checkbox
v-else
dense
@input="taskAlert(props.row.id, 'Email', props.row.email_alert, props.row.managed_by_policy)"
v-model="props.row.email_alert"
@@ -127,6 +147,16 @@
<!-- dashboard alert -->
<q-td>
<q-checkbox
v-if="props.row.alert_template && props.row.alert_template.always_alert !== null"
:value="props.row.alert_template.always_alert"
disable
dense
>
<q-tooltip> Setting is overidden by alert template: {{ props.row.alert_template.name }} </q-tooltip>
</q-checkbox>
<q-checkbox
v-else
dense
@input="taskAlert(props.row.id, 'Dashboard', props.row.dashboard_alert, props.row.managed_by_policy)"
v-model="props.row.dashboard_alert"

View File

@@ -133,6 +133,16 @@
<!-- text alert -->
<q-td>
<q-checkbox
v-if="props.row.alert_template && props.row.alert_template.always_text !== null"
:value="props.row.alert_template.always_text"
disable
dense
>
<q-tooltip> Setting is overidden by alert template: {{ props.row.alert_template.name }} </q-tooltip>
</q-checkbox>
<q-checkbox
v-else
dense
@input="checkAlert(props.row.id, 'Text', props.row.text_alert, props.row.managed_by_policy)"
v-model="props.row.text_alert"
@@ -142,6 +152,16 @@
<!-- email alert -->
<q-td>
<q-checkbox
v-if="props.row.alert_template && props.row.alert_template.always_email !== null"
:value="props.row.alert_template.always_email"
disable
dense
>
<q-tooltip> Setting is overidden by alert template: {{ props.row.alert_template.name }} </q-tooltip>
</q-checkbox>
<q-checkbox
v-else
dense
@input="checkAlert(props.row.id, 'Email', props.row.email_alert, props.row.managed_by_policy)"
v-model="props.row.email_alert"
@@ -151,6 +171,16 @@
<!-- dashboard alert -->
<q-td>
<q-checkbox
v-if="props.row.alert_template && props.row.alert_template.always_alert !== null"
:value="props.row.alert_template.always_alert"
disable
dense
>
<q-tooltip> Setting is overidden by alert template: {{ props.row.alert_template.name }} </q-tooltip>
</q-checkbox>
<q-checkbox
v-else
dense
@input="checkAlert(props.row.id, 'Dashboard', props.row.dashboard_alert, props.row.managed_by_policy)"
v-model="props.row.dashboard_alert"

View File

@@ -9,7 +9,7 @@
<q-tooltip content-class="bg-white text-primary">Close</q-tooltip>
</q-btn>
</q-bar>
<q-card-section style="min-height: 35vh; max-height: 35vh">
<q-card-section>
<div class="q-gutter-sm">
<q-btn label="New" dense flat push unelevated no-caps icon="add" @click="showAddPolicyForm" />
<q-btn
@@ -45,154 +45,156 @@
@click="showPolicyOverview"
/>
</div>
<q-table
:table-class="{ 'table-bgcolor': !$q.dark.isActive, 'table-bgcolor-dark': $q.dark.isActive }"
class="tabs-tbl-sticky"
:data="policies"
:columns="columns"
:pagination.sync="pagination"
:rows-per-page-options="[0]"
dense
row-key="id"
binary-state-sort
hide-pagination
virtual-scroll
no-data-label="No Policies"
>
<!-- header slots -->
<template v-slot:header-cell-active="props">
<q-th :props="props" auto-width>
<q-icon name="power_settings_new" size="1.5em">
<q-tooltip>Enable Policy</q-tooltip>
</q-icon>
</q-th>
</template>
<template v-slot:header-cell-enforced="props">
<q-th :props="props" auto-width>
<q-icon name="security" size="1.5em">
<q-tooltip>Enforce Policy (Will override Agent tasks/checks)</q-tooltip>
</q-icon>
</q-th>
</template>
<!-- body slots -->
<template v-slot:body="props">
<q-tr
:props="props"
class="cursor-pointer"
:class="rowSelectedClass(props.row.id, selectedPolicy)"
@click="selectedPolicy = props.row"
@contextmenu="selectedPolicy = props.row"
@dblclick="showEditPolicyForm(props.row)"
>
<!-- context menu -->
<q-menu context-menu>
<q-list dense style="min-width: 200px">
<q-item clickable v-close-popup @click="showEditPolicyForm(props.row)">
<q-item-section side>
<q-icon name="edit" />
</q-item-section>
<q-item-section>Edit</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="showCopyPolicyForm(props.row)">
<q-item-section side>
<q-icon name="content_copy" />
</q-item-section>
<q-item-section>Copy</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="deletePolicy(props.row)">
<q-item-section side>
<q-icon name="delete" />
</q-item-section>
<q-item-section>Delete</q-item-section>
</q-item>
<q-separator></q-separator>
<q-item clickable v-close-popup @click="showRelations(props.row)">
<q-item-section side>
<q-icon name="account_tree" />
</q-item-section>
<q-item-section>Show Relations</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="showPatchPolicyForm(props.row)">
<q-item-section side>
<q-icon name="system_update" />
</q-item-section>
<q-item-section>{{ patchPolicyText(props.row) }}</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="showAlertTemplateAdd(props.row)">
<q-item-section side>
<q-icon name="warning" />
</q-item-section>
<q-item-section>{{ alertTemplateText(props.row) }}</q-item-section>
</q-item>
<q-separator></q-separator>
<q-item clickable v-close-popup>
<q-item-section>Close</q-item-section>
</q-item>
</q-list>
</q-menu>
<!-- enabled checkbox -->
<q-td>
<q-checkbox dense @input="toggleCheckbox(props.row, 'Active')" v-model="props.row.active" />
</q-td>
<!-- enforced checkbox -->
<q-td>
<q-checkbox dense @input="toggleCheckbox(props.row, 'Enforced')" v-model="props.row.enforced" />
</q-td>
<q-td>
{{ props.row.name }}
<q-chip v-if="props.row.default_server_policy" color="primary" text-color="white" size="sm"
>Default Server</q-chip
>
<q-chip v-if="props.row.default_workstation_policy" color="primary" text-color="white" size="sm"
>Default Workstation</q-chip
>
</q-td>
<q-td>{{ props.row.desc }}</q-td>
<q-td>
<span
style="cursor: pointer; text-decoration: underline"
class="text-primary"
@click="showRelations(props.row)"
>{{ `Show Relations (${props.row.agents_count})` }}</span
>
</q-td>
<q-td>
<span
style="cursor: pointer; text-decoration: underline"
class="text-primary"
@click="showPatchPolicyForm(props.row)"
>{{ patchPolicyText(props.row) }}</span
>
</q-td>
<q-td>
<span
style="cursor: pointer; text-decoration: underline"
class="text-primary"
@click="showAlertTemplateAdd(props.row)"
>{{ alertTemplateText(props.row) }}</span
>
</q-td>
<q-td>
<q-icon name="content_copy" size="1.5em" @click="showCopyPolicyForm(props.row)">
<q-tooltip>Create a copy of this policy</q-tooltip>
<div class="scroll" style="min-height: 35vh; max-height: 35vh">
<q-table
:table-class="{ 'table-bgcolor': !$q.dark.isActive, 'table-bgcolor-dark': $q.dark.isActive }"
class="tabs-tbl-sticky"
:data="policies"
:columns="columns"
:pagination.sync="pagination"
:rows-per-page-options="[0]"
dense
row-key="id"
binary-state-sort
hide-pagination
virtual-scroll
no-data-label="No Policies"
>
<!-- header slots -->
<template v-slot:header-cell-active="props">
<q-th :props="props" auto-width>
<q-icon name="power_settings_new" size="1.5em">
<q-tooltip>Enable Policy</q-tooltip>
</q-icon>
</q-td>
</q-tr>
</template>
</q-table>
</q-th>
</template>
<template v-slot:header-cell-enforced="props">
<q-th :props="props" auto-width>
<q-icon name="security" size="1.5em">
<q-tooltip>Enforce Policy (Will override Agent tasks/checks)</q-tooltip>
</q-icon>
</q-th>
</template>
<!-- body slots -->
<template v-slot:body="props">
<q-tr
:props="props"
class="cursor-pointer"
:class="rowSelectedClass(props.row.id, selectedPolicy)"
@click="selectedPolicy = props.row"
@contextmenu="selectedPolicy = props.row"
@dblclick="showEditPolicyForm(props.row)"
>
<!-- context menu -->
<q-menu context-menu>
<q-list dense style="min-width: 200px">
<q-item clickable v-close-popup @click="showEditPolicyForm(props.row)">
<q-item-section side>
<q-icon name="edit" />
</q-item-section>
<q-item-section>Edit</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="showCopyPolicyForm(props.row)">
<q-item-section side>
<q-icon name="content_copy" />
</q-item-section>
<q-item-section>Copy</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="deletePolicy(props.row)">
<q-item-section side>
<q-icon name="delete" />
</q-item-section>
<q-item-section>Delete</q-item-section>
</q-item>
<q-separator></q-separator>
<q-item clickable v-close-popup @click="showRelations(props.row)">
<q-item-section side>
<q-icon name="account_tree" />
</q-item-section>
<q-item-section>Show Relations</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="showPatchPolicyForm(props.row)">
<q-item-section side>
<q-icon name="system_update" />
</q-item-section>
<q-item-section>{{ patchPolicyText(props.row) }}</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="showAlertTemplateAdd(props.row)">
<q-item-section side>
<q-icon name="warning" />
</q-item-section>
<q-item-section>{{ alertTemplateText(props.row) }}</q-item-section>
</q-item>
<q-separator></q-separator>
<q-item clickable v-close-popup>
<q-item-section>Close</q-item-section>
</q-item>
</q-list>
</q-menu>
<!-- enabled checkbox -->
<q-td>
<q-checkbox dense @input="toggleCheckbox(props.row, 'Active')" v-model="props.row.active" />
</q-td>
<!-- enforced checkbox -->
<q-td>
<q-checkbox dense @input="toggleCheckbox(props.row, 'Enforced')" v-model="props.row.enforced" />
</q-td>
<q-td>
{{ props.row.name }}
<q-chip v-if="props.row.default_server_policy" color="primary" text-color="white" size="sm"
>Default Server</q-chip
>
<q-chip v-if="props.row.default_workstation_policy" color="primary" text-color="white" size="sm"
>Default Workstation</q-chip
>
</q-td>
<q-td>{{ props.row.desc }}</q-td>
<q-td>
<span
style="cursor: pointer; text-decoration: underline"
class="text-primary"
@click="showRelations(props.row)"
>{{ `Show Relations (${props.row.agents_count})` }}</span
>
</q-td>
<q-td>
<span
style="cursor: pointer; text-decoration: underline"
class="text-primary"
@click="showPatchPolicyForm(props.row)"
>{{ patchPolicyText(props.row) }}</span
>
</q-td>
<q-td>
<span
style="cursor: pointer; text-decoration: underline"
class="text-primary"
@click="showAlertTemplateAdd(props.row)"
>{{ alertTemplateText(props.row) }}</span
>
</q-td>
<q-td>
<q-icon name="content_copy" size="1.5em" @click="showCopyPolicyForm(props.row)">
<q-tooltip>Create a copy of this policy</q-tooltip>
</q-icon>
</q-td>
</q-tr>
</template>
</q-table>
</div>
</q-card-section>
<q-card-section style="min-height: 35vh; max-height: 35vh">
<q-card-section>
<q-tabs
v-model="subtab"
dense
@@ -210,10 +212,14 @@
<q-separator />
<q-tab-panels v-model="subtab" :animated="false">
<q-tab-panel name="checks">
<PolicyChecksTab v-if="!!selectedPolicy" :selectedPolicy="selectedPolicy.id" />
<div class="scroll" style="min-height: 25vh; max-height: 25vh">
<PolicyChecksTab v-if="!!selectedPolicy" :selectedPolicy="selectedPolicy.id" />
</div>
</q-tab-panel>
<q-tab-panel name="tasks">
<PolicyAutomatedTasksTab v-if="!!selectedPolicy" :selectedPolicy="selectedPolicy.id" />
<div class="scroll" style="min-height: 25vh; max-height: 25vh">
<PolicyAutomatedTasksTab v-if="!!selectedPolicy" :selectedPolicy="selectedPolicy.id" />
</div>
</q-tab-panel>
</q-tab-panels>
</q-card-section>

View File

@@ -13,7 +13,6 @@
<q-btn v-if="!!selectedPolicy" dense flat push @click="getTasks" icon="refresh" />
<template>
<q-table
style="max-height: 35vh"
:table-class="{ 'table-bgcolor': !$q.dark.isActive, 'table-bgcolor-dark': $q.dark.isActive }"
class="tabs-tbl-sticky"
:data="tasks"

View File

@@ -52,7 +52,6 @@
<q-btn v-if="!!selectedPolicy" dense flat push @click="getChecks" icon="refresh" />
<template>
<q-table
style="max-height: 35vh"
:table-class="{ 'table-bgcolor': !$q.dark.isActive, 'table-bgcolor-dark': $q.dark.isActive }"
class="tabs-tbl-sticky"
:data="checks"

View File

@@ -63,6 +63,11 @@
/>
</q-card-section>
<q-card-section>
<q-checkbox v-model="localTemplate.exclude_workstations" label="Exclude Workstations" />
<q-checkbox v-model="localTemplate.exclude_servers" label="Exclude Servers" />
</q-card-section>
<q-card-actions align="right">
<q-btn dense flat label="Cancel" v-close-popup />
<q-btn dense flat label="Save" color="primary" type="submit" />
@@ -84,6 +89,8 @@ export default {
excluded_clients: [],
excluded_sites: [],
excluded_agents: [],
exclude_servers: false,
exclude_workstations: false,
},
clientOptions: [],
siteOptions: [],

View File

@@ -214,33 +214,32 @@
<div class="col-4"></div>
<div class="col-4">
<q-toggle v-model="template.agent_always_email" color="green" left-label>
<q-toggle v-model="template.agent_always_email" color="green" left-label toggle-indeterminate>
<span style="text-decoration: underline; cursor: help"
>Always email<q-tooltip>Overrides the email alert option on the agent</q-tooltip></span
>Always email<q-tooltip
>Overrides the email alert option on the agent if configured. Default: Not Configured</q-tooltip
></span
>
</q-toggle>
</div>
<div class="col-4">
<q-toggle v-model="template.agent_always_text" color="green" left-label>
<q-toggle v-model="template.agent_always_text" color="green" left-label toggle-indeterminate>
<span style="text-decoration: underline; cursor: help"
>Always sms<q-tooltip>Overrides the sms alert option on the agent</q-tooltip></span
>Always sms<q-tooltip
>Overrides the sms alert option on the agent if configured. Default: Not Configured</q-tooltip
></span
>
</q-toggle>
</div>
<div class="col-4">
<q-toggle v-model="template.agent_always_alert" color="green" left-label>
<q-toggle v-model="template.agent_always_alert" color="green" left-label toggle-indeterminate>
<span style="text-decoration: underline; cursor: help"
>Always dashboard alert<q-tooltip>Overrides the dashboard alert option on the agents</q-tooltip></span
>
</q-toggle>
</div>
<div class="col-12">
<q-toggle v-model="template.agent_include_desktops" color="green" left-label>
<span style="text-decoration: underline; cursor: help"
>Include desktops<q-tooltip>Includes desktop agent's offline alerts</q-tooltip></span
>Always dashboard alert<q-tooltip
>Overrides the dashboard alert option on the agents if configured. Default: Not
Configured</q-tooltip
></span
>
</q-toggle>
</div>
@@ -337,26 +336,35 @@
<div class="col-4"></div>
<div class="col-4">
<q-toggle v-model="template.check_always_email" color="green" left-label>
<q-toggle v-model="template.check_always_email" color="green" left-label toggle-indeterminate>
<span style="text-decoration: underline; cursor: help"
>Always email <q-tooltip>Overrides the email alert setting on checks</q-tooltip></span
>Always email
<q-tooltip
>Overrides the email alert setting on checks if configured. Default: Not Configured</q-tooltip
></span
>
</q-toggle>
</div>
<div class="col-4">
<q-toggle v-model="template.check_always_text" color="green" left-label>
<q-toggle v-model="template.check_always_text" color="green" left-label toggle-indeterminate>
<span style="text-decoration: underline; cursor: help"
>Always sms <q-tooltip>Overrides the SMS alert setting on checks</q-tooltip></span
>Always sms
<q-tooltip
>Overrides the SMS alert setting on checks if configured. Default: Not Configured</q-tooltip
></span
>
</q-toggle>
</div>
<div class="col-4">
<q-toggle v-model="template.check_always_alert" color="green" left-label>
<q-toggle v-model="template.check_always_alert" color="green" left-label toggle-indeterminate>
<span style="text-decoration: underline; cursor: help"
>Always dashboard alert
<q-tooltip>Overrides the dashboard alert option on the agents</q-tooltip></span
<q-tooltip
>Overrides the dashboard alert option on the agents if configured. Default: Not
Configured</q-tooltip
></span
>
</q-toggle>
</div>
@@ -453,25 +461,34 @@
<div class="col-4"></div>
<div class="col-4">
<q-toggle v-model="template.task_always_email" color="green" left-label>
<q-toggle v-model="template.task_always_email" color="green" left-label toggle-indeterminate>
<span style="text-decoration: underline; cursor: help"
>Always email <q-tooltip>Overrides the email alert option on the task</q-tooltip></span
>Always email
<q-tooltip
>Overrides the email alert option on the task if configured. Default: Not Configured</q-tooltip
></span
>
</q-toggle>
</div>
<div class="col-4">
<q-toggle v-model="template.task_always_text" color="green" left-label>
<q-toggle v-model="template.task_always_text" color="green" left-label toggle-indeterminate>
<span style="text-decoration: underline; cursor: help"
>Always sms <q-tooltip>Overrides the SMS alert option on the task</q-tooltip></span
>Always sms
<q-tooltip
>Overrides the SMS alert option on the task if configured. Default: Not Configured</q-tooltip
></span
>
</q-toggle>
</div>
<div class="col-4">
<q-toggle v-model="template.task_always_alert" color="green" left-label>
<q-toggle v-model="template.task_always_alert" color="green" left-label toggle-indeterminate>
<span style="text-decoration: underline; cursor: help"
>Always dashboard alert <q-tooltip>Overrides the dashboard alert option on the task</q-tooltip></span
>Always dashboard alert
<q-tooltip
>Overrides the dashboard alert option on the task if configured. Default: Not Configured</q-tooltip
></span
>
</q-toggle>
</div>
@@ -519,30 +536,29 @@ export default {
email_recipients: [],
email_from: "",
text_recipients: [],
agent_include_desktops: false,
agent_email_on_resolved: false,
agent_text_on_resolved: false,
agent_always_email: false,
agent_always_text: false,
agent_always_alert: false,
agent_always_email: null,
agent_always_text: null,
agent_always_alert: null,
agent_periodic_alert_days: 0,
check_email_alert_severity: [],
check_text_alert_severity: [],
check_dashboard_alert_severity: [],
check_email_on_resolved: false,
check_text_on_resolved: false,
check_always_email: false,
check_always_text: false,
check_always_alert: false,
check_always_email: null,
check_always_text: null,
check_always_alert: null,
check_periodic_alert_days: 0,
task_email_alert_severity: [],
task_text_alert_severity: [],
task_dashboard_alert_severity: [],
task_email_on_resolved: false,
task_text_on_resolved: false,
task_always_email: false,
task_always_text: false,
task_always_alert: false,
task_always_email: null,
task_always_text: null,
task_always_alert: null,
task_periodic_alert_days: 0,
},
scriptOptions: [],

View File

@@ -97,9 +97,26 @@
<template v-slot:body-cell-actions="props">
<q-td :props="props">
<div v-if="!props.row.resolved">
<q-icon
v-if="props.row.action_run"
name="mdi-archive-alert"
size="sm"
class="cursor-pointer"
@click="showScriptOutput(props.row, true)"
>
<q-tooltip>Show failure action run results</q-tooltip>
</q-icon>
<q-icon
v-if="props.row.resolved_action_run"
name="mdi-archive-check"
size="sm"
class="cursor-pointer"
@click="showScriptOutput(props.row, false)"
>
<q-tooltip>Show resolved action run results</q-tooltip>
</q-icon>
<q-icon
v-if="!props.row.snoozed"
v-if="!props.row.resolved && !props.row.snoozed"
name="snooze"
size="sm"
class="cursor-pointer"
@@ -107,30 +124,12 @@
>
<q-tooltip>Snooze alert</q-tooltip>
</q-icon>
<q-icon v-else name="alarm_off" size="sm" class="cursor-pointer" @click="unsnoozeAlert(props.row)">
<q-icon v-else-if="!props.row.resolved && props.row.snoozed" name="alarm_off" size="sm" class="cursor-pointer" @click="unsnoozeAlert(props.row)">
<q-tooltip>Unsnooze alert</q-tooltip>
</q-icon>
<q-icon name="flag" size="sm" class="cursor-pointer" @click="resolveAlert(props.row)">
<q-icon v-if="!props.row.resolved" name="flag" size="sm" class="cursor-pointer" @click="resolveAlert(props.row)">
<q-tooltip>Resolve alert</q-tooltip>
</q-icon>
<q-icon
v-if="props.row.action_run"
name="mdi-archive-alert"
size="sm"
class="cursor-pointer"
@click="showScriptOutput(props.row, true)"
>
<q-tooltip>Show failure action run results</q-tooltip>
</q-icon>
<q-icon
v-if="props.row.resolved_action_run"
name="mdi-archive-check"
size="sm"
class="cursor-pointer"
@click="showScriptOutput(props.row, false)"
>
<q-tooltip>Show resolved action run results</q-tooltip>
</q-icon>
</div>
</q-td>
</template>