diff --git a/index.json b/index.json index 0579a66..579370d 100644 --- a/index.json +++ b/index.json @@ -20,8 +20,12 @@ "download_url": "https://raw.githubusercontent.com/amidaware/reporting-templates/master/templates/Agent%20Specs.json" }, { - "name": "Agent Uptime_By Client (html) v1.4", - "download_url": "https://raw.githubusercontent.com/amidaware/reporting-templates/master/templates/Agent%20Uptime_By%20Client%20%28html%29%20v1.4.json" + "name": "Agent TRMM Install date_descending v1.3", + "download_url": "https://raw.githubusercontent.com/amidaware/reporting-templates/master/templates/Agent%20TRMM%20Install%20date_descending%20v1.3.json" + }, + { + "name": "Agent Uptime_By Client (html) v1.5", + "download_url": "https://raw.githubusercontent.com/amidaware/reporting-templates/master/templates/Agent%20Uptime_By%20Client%20%28html%29%20v1.5.json" }, { "name": "Agent_ListClientThenSite (csv)", @@ -144,8 +148,8 @@ "download_url": "https://raw.githubusercontent.com/amidaware/reporting-templates/master/templates/Antivirus%20Report.json" }, { - "name": "Antivirus Report (csv)", - "download_url": "https://raw.githubusercontent.com/amidaware/reporting-templates/master/templates/Antivirus%20Report%20%28csv%29.json" + "name": "Antivirus Report v1.1", + "download_url": "https://raw.githubusercontent.com/amidaware/reporting-templates/master/templates/Antivirus%20Report%20v1.1.json" }, { "name": "Audit Logs (csv)", diff --git a/templates/Agent TRMM Install date_descending v1.3.json b/templates/Agent TRMM Install date_descending v1.3.json new file mode 100644 index 0000000..7d10033 --- /dev/null +++ b/templates/Agent TRMM Install date_descending v1.3.json @@ -0,0 +1,15 @@ +{ + "base_template": { + "name": "TRMM_Base v1", + "html": "\n\n\n \n\n\n\n {% block content %}{% endblock %}\n\n\n" + }, + "template": { + "name": "Agent TRMM Install date_descending v1.3", + "template_css": "", + "template_md": "{% block content %}\r\n\r\n\r\n
\r\n
\r\n \"Amidaware\r\n
\r\n
\r\n

TRMM Agents Installation Report

\r\n

Client: All | Site: All

\r\n
\r\n
\r\n

Report Date:
{{ report_run_timestamp.strftime('%B %d, %Y') }}

\r\n
\r\n
\r\n\r\n{% set clients = [] %}\r\n{% set sites = [] %}\r\n{% for item in data_sources.agents %}\r\n {% if item.site__client__name not in clients %}\r\n {% set _ = clients.append(item.site__client__name) %}\r\n {% endif %}\r\n {% if item.site__name not in sites %}\r\n {% set _ = sites.append(item.site__name) %}\r\n {% endif %}\r\n{% endfor %}\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {% for item in data_sources.agents %}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {% endfor %}\r\n \r\n
\r\n Client\r\n \r\n \r\n Site\r\n \r\n AgentUserInstallation Date
{{ item.site__client__name }}{{ item.site__name }}{{ item.hostname }}{{ item.last_logged_in_user }}{% if item.created_time %}{{ item.created_time.strftime('%Y-%m-%d %H:%M') }}{% else %}N/A{% endif %}
\r\n
\r\n\r\n\r\n{% endblock %}", + "type": "html", + "depends_on": [], + "template_variables": "data_sources:\r\n agents:\r\n model: agent\r\n select_related:\r\n - site\r\n - site__client\r\n only:\r\n - hostname\r\n - last_logged_in_user\r\n - created_time\r\n - site__name\r\n - site__client__name\r\n order_by:\r\n - -created_time\r\nreport_run_timestamp: !now" + }, + "assets": [] +} \ No newline at end of file diff --git a/templates/Agent Uptime_By Client (html) v1.4.json b/templates/Agent Uptime_By Client (html) v1.4.json deleted file mode 100644 index 9ef4394..0000000 --- a/templates/Agent Uptime_By Client (html) v1.4.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "base_template": { - "name": "Bootstrap Base", - "html": "\n\n \n \n \n \n \n {% block content %}{% endblock %}\n \n" - }, - "template": { - "name": "Agent Uptime_By Client (html) v1.4", - "template_css": "", - "template_md": "{% block content %}\r\n\r\n\r\n
\r\n \r\n
\r\n

{{client.name}} - Agent Downtime Report

\r\n

Report Date: {{ report_run_timestamp.strftime('%Y-%m-%d') }}

\r\n
\r\n
\r\n\r\n{% set cutoff = timedelta_30_days %}\r\n{% set alert_events = [] %}\r\n\r\n
\r\n

Agent Downtime Timeline (Red = Offline)

\r\n
\r\n\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {% for item in data_sources.allFieldsAlerts %}\r\n {% if item.alert_type == \"availability\"\r\n and item.resolved\r\n and item.alert_time is defined\r\n and item.resolved_on is defined\r\n and item.agent__hostname is defined\r\n and item.alert_time >= cutoff %}\r\n {% set downtime = (item.resolved_on - item.alert_time).total_seconds() / 60 %}\r\n \r\n \r\n \r\n \r\n \r\n{% set dt_mins = downtime | round(0, 'floor') %}\r\n{% set dt_days = (dt_mins // 1440) %}\r\n{% set dt_hrs = ((dt_mins % 1440) // 60) %}\r\n{% set dt_min = (dt_mins % 60) %}\r\n\r\n\r\n\r\n \r\n {% set _ = alert_events.append({\r\n \"agent\": item.agent__hostname,\r\n \"start\": item.alert_time.isoformat(),\r\n \"end\": item.resolved_on.isoformat()\r\n }) %}\r\n {% endif %}\r\n {% endfor %}\r\n \r\n
Agent IDMessageTime OffTime OnDowntime (minutes)
{{ item.agent__hostname }}{{ item.message }}{{ item.alert_time.strftime('%Y-%m-%d %H:%M') }}{{ item.resolved_on.strftime('%Y-%m-%d %H:%M') }}\r\n {% if dt_days > 0 %}{{ dt_days }}d {% endif %}\r\n {% if dt_hrs > 0 %}{{ dt_hrs }}h {% endif %}\r\n {% if dt_min > 0 or (dt_days == 0 and dt_hrs == 0) %}{{ dt_min }}m{% endif %}\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n{% endblock %}", - "type": "html", - "depends_on": [ - "client" - ], - "template_variables": "report_run_timestamp: !now\ntimedelta_30_days: !now days=-30\ndata_sources:\n allFieldsAlerts:\n model: alert\n only:\n - agent__hostname\n - message\n - alert_time\n - resolved_on\n - alert_type\n - agent_id\n - resolved\n filter:\n agent__site__client_id: '{{client.id}}'" - }, - "assets": [] -} \ No newline at end of file diff --git a/templates/Agent Uptime_By Client (html) v1.5.json b/templates/Agent Uptime_By Client (html) v1.5.json new file mode 100644 index 0000000..d54bdd7 --- /dev/null +++ b/templates/Agent Uptime_By Client (html) v1.5.json @@ -0,0 +1,17 @@ +{ + "base_template": { + "name": "TRMM_Base v1", + "html": "\n\n\n \n\n\n\n {% block content %}{% endblock %}\n\n\n" + }, + "template": { + "name": "Agent Uptime_By Client (html) v1.5", + "template_css": "", + "template_md": "{% block content %}\r\n\r\n\r\n
\r\n \r\n
\r\n

{{ client.name }} - Agent Uptime Report

\r\n

Report Date: {{ report_run_timestamp.strftime('%Y-%m-%d') }}

\r\n
\r\n
\r\n\r\n{% set cutoff = timedelta_30_days %}\r\n{% set alert_events = [] %}\r\n\r\n
\r\n

Agent Timeline (Green = Online, Red = Offline)

\r\n
\r\n\r\n

Downtime List

\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {% for item in data_sources.allFieldsAlerts %}\r\n {% if item.alert_type == \"availability\"\r\n and item.resolved\r\n and item.alert_time is defined\r\n and item.resolved_on is defined\r\n and item.agent__hostname is defined\r\n and item.alert_time >= cutoff %}\r\n {% set downtime = (item.resolved_on - item.alert_time).total_seconds() / 60 %}\r\n \r\n \r\n \r\n \r\n \r\n {% set dt_mins = downtime | round(0, 'floor') %}\r\n {% set dt_days = dt_mins // 1440 %}\r\n {% set dt_hrs = (dt_mins % 1440) // 60 %}\r\n {% set dt_min = dt_mins % 60 %}\r\n \r\n \r\n {% set _ = alert_events.append({\r\n \"agent\": item.agent__hostname,\r\n \"start\": item.alert_time.isoformat(),\r\n \"end\": item.resolved_on.isoformat()\r\n }) %}\r\n {% endif %}\r\n {% endfor %}\r\n \r\n
Agent IDMessageTime OffTime OnDowntime
{{ item.agent__hostname }}{{ item.message }}{{ item.alert_time.strftime('%Y-%m-%d %H:%M') }}{{ item.resolved_on.strftime('%Y-%m-%d %H:%M') }}\r\n {% if dt_days > 0 %}{{ dt_days }}d {% endif %}\r\n {% if dt_hrs > 0 %}{{ dt_hrs }}h {% endif %}\r\n {% if dt_min > 0 or (dt_days == 0 and dt_hrs == 0) %}{{ dt_min }}m{% endif %}\r\n
\r\n\r\n\r\n{% endblock %}", + "type": "html", + "depends_on": [ + "client" + ], + "template_variables": "report_run_timestamp: !now\ntimedelta_30_days: !now days=-30\ndata_sources:\n allFieldsAlerts:\n model: alert\n only:\n - agent__hostname\n - message\n - alert_time\n - resolved_on\n - alert_type\n - agent_id\n - resolved\n filter:\n agent__site__client_id: '{{client.id}}'" + }, + "assets": [] +} \ No newline at end of file diff --git a/templates/Antivirus Report (csv).json b/templates/Antivirus Report (csv).json deleted file mode 100644 index 0a5965f..0000000 --- a/templates/Antivirus Report (csv).json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "base_template": null, - "template": { - "name": "Antivirus Report (csv)", - "template_css": "", - "template_md": "** Note This requires a custom field \"Antivirus\" and \"Antivirus - Verify Status\" ran with -customfield param **\r\nDevice Name, User, Device OS, Antivirus\r\n{% for item in data_sources.agentsList %}{{item.hostname if item.hostname else 'N/A'}},{{item.last_logged_in_user if item.last_logged_in_user else 'N/A'}},{{item.operating_system|replace(\",\", \"\") if item.operating_system else 'N/A'}},{{item.custom_fields.Antivirus if item.custom_fields.Antivirus else 'N/A'}},\r\n{% endfor %}", - "type": "plaintext", - "depends_on": [ - "client" - ], - "template_variables": "data_sources:\r\n agentsList:\r\n filter:\r\n site__client_id: \"{{client.id}}\"\r\n custom_fields:\r\n - Antivirus\r\n model: agent\r\n only:\r\n - hostname\r\n - operating_system\r\n - site__name\r\n - last_logged_in_user" - }, - "assets": [] -} \ No newline at end of file diff --git a/templates/Antivirus Report v1.1.json b/templates/Antivirus Report v1.1.json new file mode 100644 index 0000000..37c79be --- /dev/null +++ b/templates/Antivirus Report v1.1.json @@ -0,0 +1,17 @@ +{ + "base_template": { + "name": "TRMM_Base v1", + "html": "\n\n\n \n\n\n\n {% block content %}{% endblock %}\n\n\n" + }, + "template": { + "name": "Antivirus Report v1.1", + "template_css": "", + "template_md": "{% block content %}\r\n\r\n
\r\n
\r\n \"Amidaware\r\n
\r\n
\r\n

Audit Log

\r\n

Client: {{ client.name }}

\r\n
\r\n
\r\n

Report Date:
{{ report_run_timestamp.strftime('%B %d, %Y') }}

\r\n
\r\n
\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {% for item in data_sources.agentsList %}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {% endfor %}\r\n \r\n
ClientSiteDevice NameUserDevice OSAntivirus
{{ item.site__client__name }}{{ item.site__name }}\r\n {{ item.hostname }}
\r\n {% if item.last_seen %}\r\n 30 %} class=\"text-danger\" {% endif %}>\r\n Last Seen: {{ item.last_seen.astimezone(ZoneInfo('America/New_York')).strftime('%Y-%m-%d %H:%M:%S') }}\r\n \r\n {% else %}\r\n \r\n {% endif %}\r\n
{{ item.last_logged_in_user }}{{ item.operating_system }}\r\n {% if item.custom_fields and 'Antivirus' in item.custom_fields %}\r\n {{ item.custom_fields.Antivirus }}\r\n {% endif %}\r\n
\r\n
\r\n{% endblock %}", + "type": "html", + "depends_on": [ + "client" + ], + "template_variables": "data_sources:\n agentsList:\n filter:\n site__client_id: \"{{client.id}}\"\n custom_fields:\n - Antivirus\n model: agent\n only:\n - hostname\n - site__client__name\n - site__name\n - operating_system\n - site__name\n - last_seen\n - last_logged_in_user\nreport_run_timestamp: !now" + }, + "assets": [] +} \ No newline at end of file