diff --git a/zabbix-agent-scripts/get_apache2_user_agent_metrics.py b/zabbix-agent-scripts/get_apache2_user_agent_metrics.py new file mode 100644 index 0000000..aa4605b --- /dev/null +++ b/zabbix-agent-scripts/get_apache2_user_agent_metrics.py @@ -0,0 +1,67 @@ +import pandas as pd + +from datetime import datetime, timedelta + +import sys + +import json + +dt=datetime.now().strftime("%Y%m%d") + +df=pd.read_csv("/var/log/apache2/archive/nextcloud-access-csv.log-%s" % dt, + header=None, + names=["timestamp","user_agent"], + parse_dates=["timestamp"]) + +## EDGE +# Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36 Edg/110.0.1587.57 +## Chrome +# Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36 +## Firefox +# Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:110.0) Gecko/20100101 Firefox/110.0 +## Safari +# Mozilla/5.0 (Macintosh; Intel Mac OS X 13_2_1) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Safari/605.1.15 + +def get_norm_user_agent(s): + s = s.lower() + ## Nextcloud Talk App + if "nextcloud-talk" in s: + if "android" in s: + return "Nextcloud_Talk_Android" + elif "ios" in s: + return "Nextcloud_Talk_iOS" + else: + return "Nextcloud_Talk_unknown" + ## Nextcloud Files App + if "nextcloud-android" in s: + return "Nextcloud_Android" + ## Browser + if "chrome" in s: + if "edg" in s: + return "Edge_browser" + else: + return "Chrome_browser" + if "firefox" in s: + return "Firefox_browser" + if "macintosh" in s and "applewebkit" in s: + return "Safari_browser" + ## Desktop Client + if "mirall" in s: + if "linux" in s: + return "Desktop_Client_Linux" + elif "macintosh" in s: + return "Desktop_Client_Mac" + elif "windows" in s: + return "Desktop_Client_Windows" + else: + return "Desktop_Client_Unknown" + + +df_24h = df[df.timestamp>datetime.now() - timedelta(hours=24)] + +df_24h["norm_user_agent"] = df_24h.user_agent.apply(get_norm_user_agent) + +df_24h_agg = df_24h.value_counts("norm_user_agent") + +json.dump(df_24h_agg.to_dict(), + open("/var/lib/zabbix/output/apache2_user_agent_metrics.json","w")) diff --git a/zabbix-agent-scripts/get_db_metrics.py b/zabbix-agent-scripts/get_db_metrics.py new file mode 100644 index 0000000..5b9c031 --- /dev/null +++ b/zabbix-agent-scripts/get_db_metrics.py @@ -0,0 +1,28 @@ +import pandas as pd + +import mariadb as mdb + +conn = mdb.connect(user="ncmonitor_usr", + password="oosi975nrlemtdn9395krwfd", + host="localhost", + port=3306, + database="nextcloud_db") + +cur=conn.cursor() + +cur.execute( + """ + SELECT TABLE_NAME AS `Table`, + TABLE_ROWS AS `Rows`, + ROUND((DATA_LENGTH + INDEX_LENGTH) / 1024 ) AS `Size (kB)` + FROM information_schema.TABLES + WHERE TABLE_SCHEMA='nextcloud_db' + ORDER BY (DATA_LENGTH + INDEX_LENGTH) DESC; + """ +) + +df = pd.DataFrame(cur.fetchall(), columns=["table","nr_rows","size_kb"]) + +tables_to_monitor = "'oc_filecache','oc_comments','oc_authtoken','oc_circles_event','oc_share'" + +df.query("table in (%s)" % tables_to_monitor).to_json("/var/lib/zabbix/output/db_metrics.json",orient='columns') diff --git a/zabbix-agent-scripts/get_nc_metrics.py b/zabbix-agent-scripts/get_nc_metrics.py new file mode 100644 index 0000000..28c3765 --- /dev/null +++ b/zabbix-agent-scripts/get_nc_metrics.py @@ -0,0 +1,13 @@ +import json + +import requests + +nextcloud_token = "7iz11gm77ivdf24hnfulycpa" + +metric_values = json.loads(requests.get("http://localhost/ocs/v2.php/apps/serverinfo/api/v1/info?format=json", + verify=False, + headers={"NC-Token": "%s" % nextcloud_token}).content + ) + +with open("/var/lib/zabbix/output/nc_metrics.json","w") as fl: + json.dump(metric_values, fl) diff --git a/zabbix-agent-scripts/get_storage_metrics.py b/zabbix-agent-scripts/get_storage_metrics.py new file mode 100644 index 0000000..6882064 --- /dev/null +++ b/zabbix-agent-scripts/get_storage_metrics.py @@ -0,0 +1,27 @@ +import subprocess + +import json + +datadir = subprocess.check_output(["occ", "config:system:get", "datadirectory"]).strip(b"\n").decode() + +total_size = subprocess.check_output(["du","-d0", datadir]).split(b"\t")[0].decode() + +total_size_gb = int(total_size)/1024./1024. + +total_size_gb = "{:,.2f} Gb".format(total_size_gb) + +total_size_dict = { "total_size": total_size, + "total_size_gb": total_size_gb} + +with open("/var/lib/zabbix/output/storage_metrics.json","w") as fl: + + json.dump(total_size_dict,fl) + + + + + + + + + diff --git a/zabbix-agent-scripts/read_apache2_user_agent_metrics.py b/zabbix-agent-scripts/read_apache2_user_agent_metrics.py new file mode 100644 index 0000000..c276baf --- /dev/null +++ b/zabbix-agent-scripts/read_apache2_user_agent_metrics.py @@ -0,0 +1,14 @@ +import json + +import sys + +user_agent = sys.argv[1] + + +user_agent_values = json.load(open("/var/lib/zabbix/output/apache2_user_agent_metrics.json","r")) + +if user_agent in user_agent_values.keys(): + print(user_agent_values[user_agent]) +else: + print(0) + diff --git a/zabbix-agent-scripts/read_db_metrics.py b/zabbix-agent-scripts/read_db_metrics.py new file mode 100644 index 0000000..b930d19 --- /dev/null +++ b/zabbix-agent-scripts/read_db_metrics.py @@ -0,0 +1,16 @@ +import pandas as pd + +import sys + +table = sys.argv[1] + +metric = sys.argv[2] + +df = pd.read_json("/var/lib/zabbix/output/db_metrics.json").query("table=='%s'" % table) + +idx = df.index.values[0] + +value = df.to_dict()[metric][idx] + +print(value) + diff --git a/zabbix-agent-scripts/read_nc_metrics.py b/zabbix-agent-scripts/read_nc_metrics.py new file mode 100644 index 0000000..1f0a266 --- /dev/null +++ b/zabbix-agent-scripts/read_nc_metrics.py @@ -0,0 +1,38 @@ +## warnings are disabled as they confuse Zabbix +import warnings + +warnings.filterwarnings("ignore") + +import json + +import sys + +# The metric is passed as a single parameter. +# Example: ocs.data.nextcloud.shares.num_shares +# Check the XML or JSON file exported by serverinfo to know the exact +# metric path +metric = sys.argv[1] + +metric_path = metric.split('.') + +fl = open("/var/lib/zabbix/output/nc_metrics.json","r") + +metric_values = json.load(fl) + +# This part should absolutely be polished, +# but it's working as is at the moment +metric_val = metric_values[metric_path[0]][metric_path[1]][metric_path[2]][metric_path[3]] + +if len(metric_path)==4: + + print(metric_val) + +elif len(metric_path)==5: + + print(metric_val[metric_path[4]]) + +elif len(metric_path)==6: + + print(metric_val[metric_path[4]][metric_path[5]]) + + diff --git a/zabbix-agent-scripts/read_storage_metrics.py b/zabbix-agent-scripts/read_storage_metrics.py new file mode 100644 index 0000000..0fd0ed5 --- /dev/null +++ b/zabbix-agent-scripts/read_storage_metrics.py @@ -0,0 +1,17 @@ +## warnings are disabled as they confuse Zabbix +import warnings + +warnings.filterwarnings("ignore") + +import json + +import sys + +# The metric is passed as a single parameter. +metric = sys.argv[1] + +fl = open("/var/lib/zabbix/output/storage_metrics.json","r") + +metric_values = json.load(fl) + +print(metric_values[metric]) diff --git a/zabbix-templates/apache-by-http.json b/zabbix-templates/apache-by-http.json new file mode 100644 index 0000000..fd39689 --- /dev/null +++ b/zabbix-templates/apache-by-http.json @@ -0,0 +1,1303 @@ +{ + "zabbix_export": { + "version": "6.4", + "template_groups": [ + { + "uuid": "cf12023e2c3542409d7152bdbb8dcd2a", + "name": "Nextcloud Installation" + }, + { + "uuid": "a571c0d144b14fd4a87a9d9b2aa9fcd6", + "name": "Templates/Applications" + } + ], + "templates": [ + { + "uuid": "86702e8bc514434e8c914d50c206cb94", + "template": "Apache by HTTP", + "name": "Apache by HTTP", + "description": "Get metrics from mod_status module using HTTP agent.\nhttps://httpd.apache.org/docs/current/mod/mod_status.html\n\nYou can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/384764-discussion-thread-for-official-zabbix-template-apache\n\nTemplate tooling version used: 0.42", + "groups": [ + { + "name": "Nextcloud Installation" + }, + { + "name": "Templates/Applications" + } + ], + "items": [ + { + "uuid": "b9fe6f0bbe174e9f81af84a3bc0b0e7c", + "name": "Apache: Total bytes", + "type": "DEPENDENT", + "key": "apache.bytes", + "delay": "0", + "history": "7d", + "value_type": "FLOAT", + "units": "B", + "description": "Total bytes served", + "preprocessing": [ + { + "type": "JSONPATH", + "parameters": [ + "$[\"Total kBytes\"]" + ] + }, + { + "type": "MULTIPLIER", + "parameters": [ + "1024" + ] + } + ], + "master_item": { + "key": "apache.get_status" + }, + "tags": [ + { + "tag": "component", + "value": "network" + } + ] + }, + { + "uuid": "b36010be10874cf188eeacc81f2c366f", + "name": "Apache: Bytes per second", + "type": "DEPENDENT", + "key": "apache.bytes.rate", + "delay": "0", + "history": "7d", + "value_type": "FLOAT", + "units": "Bps", + "description": "Calculated as change rate for 'Total bytes' stat.\nBytesPerSec is not used, as it counts average since last Apache server start.", + "preprocessing": [ + { + "type": "JSONPATH", + "parameters": [ + "$[\"Total kBytes\"]" + ] + }, + { + "type": "MULTIPLIER", + "parameters": [ + "1024" + ] + }, + { + "type": "CHANGE_PER_SECOND", + "parameters": [ + "" + ] + } + ], + "master_item": { + "key": "apache.get_status" + }, + "tags": [ + { + "tag": "component", + "value": "network" + } + ] + }, + { + "uuid": "e61be8ad92004100aca55fcedd2a3807", + "name": "Apache: Get status", + "type": "HTTP_AGENT", + "key": "apache.get_status", + "history": "1h", + "trends": "0", + "value_type": "TEXT", + "description": "Getting data from a machine-readable version of the Apache status page.\nhttps://httpd.apache.org/docs/current/mod/mod_status.html", + "preprocessing": [ + { + "type": "JAVASCRIPT", + "parameters": [ + "// Convert Apache status to JSON\nvar lines = value.split('\\n');\nvar output = {},\n workers = {\n '_': 0, 'S': 0, 'R': 0, 'W': 0,\n 'K': 0, 'D': 0, 'C': 0, 'L': 0,\n 'G': 0, 'I': 0, '.': 0\n };\n\n// Get all \"Key: Value\" pairs as an object\nfor (var i = 0; i < lines.length; i++) {\n var line = lines[i].match(/([A-z0-9 ]+): (.*)/);\n\n if (line !== null) {\n output[line[1]] = isNaN(line[2]) ? line[2] : Number(line[2]);\n }\n}\n\n// Multiversion metrics\noutput.ServerUptimeSeconds = output.ServerUptimeSeconds || output.Uptime;\noutput.ServerVersion = output.ServerVersion || output.Server;\n\n// Parse \"Scoreboard\" to get worker count.\nif (typeof output.Scoreboard === 'string') {\n for (var i = 0; i < output.Scoreboard.length; i++) {\n var char = output.Scoreboard[i];\n\n workers[char]++;\n }\n}\n\n// Add worker data to the output\noutput.Workers = {\n waiting: workers['_'], starting: workers['S'], reading: workers['R'],\n sending: workers['W'], keepalive: workers['K'], dnslookup: workers['D'],\n closing: workers['C'], logging: workers['L'], finishing: workers['G'],\n cleanup: workers['I'], slot: workers['.']\n};\n\n// Return JSON string\nreturn JSON.stringify(output);" + ] + } + ], + "url": "{$APACHE.STATUS.SCHEME}://{HOST.CONN}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}", + "retrieve_mode": "BOTH", + "tags": [ + { + "tag": "component", + "value": "raw" + } + ], + "triggers": [ + { + "uuid": "db396445cc5042f89f31dc12cb99c32e", + "expression": "nodata(/Apache by HTTP/apache.get_status,30m)=1", + "name": "Apache: Failed to fetch status page", + "event_name": "Apache: Failed to fetch status page (or no data for 30m)", + "priority": "WARNING", + "description": "Zabbix has not received data for items for the last 30 minutes.", + "manual_close": "YES", + "dependencies": [ + { + "name": "Apache: Service is down", + "expression": "last(/Apache by HTTP/net.tcp.service[http,\"{HOST.CONN}\",\"{$APACHE.STATUS.PORT}\"])=0" + } + ], + "tags": [ + { + "tag": "scope", + "value": "availability" + } + ] + } + ] + }, + { + "uuid": "5fb5101de70a43fab50d55f418462255", + "name": "Apache: Total requests", + "type": "DEPENDENT", + "key": "apache.requests", + "delay": "0", + "history": "7d", + "description": "A total number of accesses", + "preprocessing": [ + { + "type": "JSONPATH", + "parameters": [ + "$[\"Total Accesses\"]" + ] + } + ], + "master_item": { + "key": "apache.get_status" + }, + "tags": [ + { + "tag": "component", + "value": "network" + } + ] + }, + { + "uuid": "ee15f4958040459da53251cc3561ed39", + "name": "Apache: Requests per second", + "type": "DEPENDENT", + "key": "apache.requests.rate", + "delay": "0", + "history": "7d", + "value_type": "FLOAT", + "description": "Calculated as change rate for 'Total requests' stat.\nReqPerSec is not used, as it counts average since last Apache server start.", + "preprocessing": [ + { + "type": "JSONPATH", + "parameters": [ + "$[\"Total Accesses\"]" + ] + }, + { + "type": "CHANGE_PER_SECOND", + "parameters": [ + "" + ] + } + ], + "master_item": { + "key": "apache.get_status" + }, + "tags": [ + { + "tag": "component", + "value": "network" + } + ] + }, + { + "uuid": "3dd8ba505d584b028c7ac08d8b959eb3", + "name": "Apache: Uptime", + "type": "DEPENDENT", + "key": "apache.uptime", + "delay": "0", + "history": "7d", + "units": "uptime", + "description": "Service uptime in seconds", + "preprocessing": [ + { + "type": "JSONPATH", + "parameters": [ + "$.ServerUptimeSeconds" + ] + } + ], + "master_item": { + "key": "apache.get_status" + }, + "tags": [ + { + "tag": "component", + "value": "system" + } + ], + "triggers": [ + { + "uuid": "76cfa6ebf39f4c8fbd8fde9e0f36d3ed", + "expression": "last(/Apache by HTTP/apache.uptime)<10m", + "name": "Apache: has been restarted", + "event_name": "Apache: has been restarted (uptime < 10m)", + "priority": "INFO", + "description": "Uptime is less than 10 minutes.", + "manual_close": "YES", + "tags": [ + { + "tag": "scope", + "value": "notice" + } + ] + } + ] + }, + { + "uuid": "fe0de2eb1478482f99b38c13bd20564c", + "name": "Apache: Version", + "type": "DEPENDENT", + "key": "apache.version", + "delay": "0", + "history": "7d", + "trends": "0", + "value_type": "CHAR", + "description": "Service version", + "preprocessing": [ + { + "type": "JSONPATH", + "parameters": [ + "$.ServerVersion" + ] + }, + { + "type": "DISCARD_UNCHANGED_HEARTBEAT", + "parameters": [ + "1d" + ] + } + ], + "master_item": { + "key": "apache.get_status" + }, + "tags": [ + { + "tag": "component", + "value": "system" + } + ], + "triggers": [ + { + "uuid": "5296d69af0704d0e8a07398f0b4c9685", + "expression": "last(/Apache by HTTP/apache.version,#1)<>last(/Apache by HTTP/apache.version,#2) and length(last(/Apache by HTTP/apache.version))>0", + "name": "Apache: Version has changed", + "event_name": "Apache: Version has changed (new version: {ITEM.VALUE})", + "priority": "INFO", + "description": "Apache version has changed. Ack to close.", + "manual_close": "YES", + "tags": [ + { + "tag": "scope", + "value": "notice" + } + ] + } + ] + }, + { + "uuid": "f74ffb92e30e48958b5b82f7dfbe5147", + "name": "Apache: Workers idle cleanup", + "type": "DEPENDENT", + "key": "apache.workers.cleanup", + "delay": "0", + "history": "7d", + "description": "Number of workers in cleanup state", + "preprocessing": [ + { + "type": "JSONPATH", + "parameters": [ + "$.Workers.cleanup" + ] + } + ], + "master_item": { + "key": "apache.get_status" + }, + "tags": [ + { + "tag": "component", + "value": "system" + } + ] + }, + { + "uuid": "d664bee9a330480bbaee7273b871a8d3", + "name": "Apache: Workers closing connection", + "type": "DEPENDENT", + "key": "apache.workers.closing", + "delay": "0", + "history": "7d", + "description": "Number of workers in closing state", + "preprocessing": [ + { + "type": "JSONPATH", + "parameters": [ + "$.Workers.closing" + ] + } + ], + "master_item": { + "key": "apache.get_status" + }, + "tags": [ + { + "tag": "component", + "value": "system" + } + ] + }, + { + "uuid": "a6fb3444585749be998ec840cd8e4511", + "name": "Apache: Workers DNS lookup", + "type": "DEPENDENT", + "key": "apache.workers.dnslookup", + "delay": "0", + "history": "7d", + "description": "Number of workers in dnslookup state", + "preprocessing": [ + { + "type": "JSONPATH", + "parameters": [ + "$.Workers.dnslookup" + ] + } + ], + "master_item": { + "key": "apache.get_status" + }, + "tags": [ + { + "tag": "component", + "value": "system" + } + ] + }, + { + "uuid": "fcf771f2a9b64a81a37db679f0494ed3", + "name": "Apache: Workers finishing", + "type": "DEPENDENT", + "key": "apache.workers.finishing", + "delay": "0", + "history": "7d", + "description": "Number of workers in finishing state", + "preprocessing": [ + { + "type": "JSONPATH", + "parameters": [ + "$.Workers.finishing" + ] + } + ], + "master_item": { + "key": "apache.get_status" + }, + "tags": [ + { + "tag": "component", + "value": "system" + } + ] + }, + { + "uuid": "cb81a6a77395444283bc5e065fcbfc2e", + "name": "Apache: Workers keepalive (read)", + "type": "DEPENDENT", + "key": "apache.workers.keepalive", + "delay": "0", + "history": "7d", + "description": "Number of workers in keepalive state", + "preprocessing": [ + { + "type": "JSONPATH", + "parameters": [ + "$.Workers.keepalive" + ] + } + ], + "master_item": { + "key": "apache.get_status" + }, + "tags": [ + { + "tag": "component", + "value": "system" + } + ] + }, + { + "uuid": "7fc0002a279b4541af569a03c1aca2ac", + "name": "Apache: Workers logging", + "type": "DEPENDENT", + "key": "apache.workers.logging", + "delay": "0", + "history": "7d", + "description": "Number of workers in logging state", + "preprocessing": [ + { + "type": "JSONPATH", + "parameters": [ + "$.Workers.logging" + ] + } + ], + "master_item": { + "key": "apache.get_status" + }, + "tags": [ + { + "tag": "component", + "value": "system" + } + ] + }, + { + "uuid": "78b0bd7d8bec49549fc003d460af9177", + "name": "Apache: Workers reading request", + "type": "DEPENDENT", + "key": "apache.workers.reading", + "delay": "0", + "history": "7d", + "description": "Number of workers in reading state", + "preprocessing": [ + { + "type": "JSONPATH", + "parameters": [ + "$.Workers.reading" + ] + } + ], + "master_item": { + "key": "apache.get_status" + }, + "tags": [ + { + "tag": "component", + "value": "system" + } + ] + }, + { + "uuid": "379ac66397b94463ad17b24fbd20c615", + "name": "Apache: Workers sending reply", + "type": "DEPENDENT", + "key": "apache.workers.sending", + "delay": "0", + "history": "7d", + "description": "Number of workers in sending state", + "preprocessing": [ + { + "type": "JSONPATH", + "parameters": [ + "$.Workers.sending" + ] + } + ], + "master_item": { + "key": "apache.get_status" + }, + "tags": [ + { + "tag": "component", + "value": "system" + } + ] + }, + { + "uuid": "1c90055e02a244fc8d18e73b23daa0f1", + "name": "Apache: Workers slot with no current process", + "type": "DEPENDENT", + "key": "apache.workers.slot", + "delay": "0", + "history": "7d", + "description": "Number of slots with no current process", + "preprocessing": [ + { + "type": "JSONPATH", + "parameters": [ + "$.Workers.slot" + ] + } + ], + "master_item": { + "key": "apache.get_status" + }, + "tags": [ + { + "tag": "component", + "value": "system" + } + ] + }, + { + "uuid": "ae21ea113e8840349aff81ab582d92b4", + "name": "Apache: Workers starting up", + "type": "DEPENDENT", + "key": "apache.workers.starting", + "delay": "0", + "history": "7d", + "description": "Number of workers in starting state", + "preprocessing": [ + { + "type": "JSONPATH", + "parameters": [ + "$.Workers.starting" + ] + } + ], + "master_item": { + "key": "apache.get_status" + }, + "tags": [ + { + "tag": "component", + "value": "system" + } + ] + }, + { + "uuid": "be1a05a6eab84b64ac4d51c966ea91e8", + "name": "Apache: Workers waiting for connection", + "type": "DEPENDENT", + "key": "apache.workers.waiting", + "delay": "0", + "history": "7d", + "description": "Number of workers in waiting state", + "preprocessing": [ + { + "type": "JSONPATH", + "parameters": [ + "$.Workers.waiting" + ] + } + ], + "master_item": { + "key": "apache.get_status" + }, + "tags": [ + { + "tag": "component", + "value": "system" + } + ] + }, + { + "uuid": "1752b9bcf7b34abbaf105f5261638271", + "name": "Apache: Total workers busy", + "type": "DEPENDENT", + "key": "apache.workers_total.busy", + "delay": "0", + "history": "7d", + "description": "Total number of busy worker threads/processes", + "preprocessing": [ + { + "type": "JSONPATH", + "parameters": [ + "$.BusyWorkers" + ] + } + ], + "master_item": { + "key": "apache.get_status" + }, + "tags": [ + { + "tag": "component", + "value": "system" + } + ] + }, + { + "uuid": "b1b1c86a12964ae2813c63481e464ec7", + "name": "Apache: Total workers idle", + "type": "DEPENDENT", + "key": "apache.workers_total.idle", + "delay": "0", + "history": "7d", + "description": "Total number of idle worker threads/processes", + "preprocessing": [ + { + "type": "JSONPATH", + "parameters": [ + "$.IdleWorkers" + ] + } + ], + "master_item": { + "key": "apache.get_status" + }, + "tags": [ + { + "tag": "component", + "value": "system" + } + ] + }, + { + "uuid": "5039d11bc3964d6e9928a0a46dd0b402", + "name": "Apache: Service response time", + "type": "SIMPLE", + "key": "net.tcp.service.perf[http,\"{HOST.CONN}\",\"{$APACHE.STATUS.PORT}\"]", + "history": "7d", + "value_type": "FLOAT", + "units": "s", + "tags": [ + { + "tag": "component", + "value": "application" + }, + { + "tag": "component", + "value": "health" + } + ], + "triggers": [ + { + "uuid": "ffbb564032c7462eb0bb9b4c2f700559", + "expression": "min(/Apache by HTTP/net.tcp.service.perf[http,\"{HOST.CONN}\",\"{$APACHE.STATUS.PORT}\"],5m)>{$APACHE.RESPONSE_TIME.MAX.WARN}", + "name": "Apache: Service response time is too high", + "event_name": "Apache: Service response time is too high (over {$APACHE.RESPONSE_TIME.MAX.WARN}s for 5m)", + "priority": "WARNING", + "manual_close": "YES", + "dependencies": [ + { + "name": "Apache: Service is down", + "expression": "last(/Apache by HTTP/net.tcp.service[http,\"{HOST.CONN}\",\"{$APACHE.STATUS.PORT}\"])=0" + } + ], + "tags": [ + { + "tag": "scope", + "value": "performance" + } + ] + } + ] + }, + { + "uuid": "fb65918695094026838e2b9e4ca00402", + "name": "Apache: Service ping", + "type": "SIMPLE", + "key": "net.tcp.service[http,\"{HOST.CONN}\",\"{$APACHE.STATUS.PORT}\"]", + "history": "7d", + "valuemap": { + "name": "Service state" + }, + "preprocessing": [ + { + "type": "DISCARD_UNCHANGED_HEARTBEAT", + "parameters": [ + "10m" + ] + } + ], + "tags": [ + { + "tag": "component", + "value": "application" + }, + { + "tag": "component", + "value": "health" + } + ], + "triggers": [ + { + "uuid": "afe2fde35d054333adc8369a0f9af778", + "expression": "last(/Apache by HTTP/net.tcp.service[http,\"{HOST.CONN}\",\"{$APACHE.STATUS.PORT}\"])=0", + "name": "Apache: Service is down", + "priority": "AVERAGE", + "manual_close": "YES", + "tags": [ + { + "tag": "scope", + "value": "availability" + } + ] + } + ] + } + ], + "discovery_rules": [ + { + "uuid": "eee8abd3174d426092e8bca9b3ba982e", + "name": "Event MPM discovery", + "type": "DEPENDENT", + "key": "apache.mpm.event.discovery", + "delay": "0", + "description": "Additional metrics if event MPM is used\nhttps://httpd.apache.org/docs/current/mod/event.html", + "item_prototypes": [ + { + "uuid": "f52700379f9a4ee8b378a2eb9caea070", + "name": "Apache: Bytes per request", + "type": "DEPENDENT", + "key": "apache.bytes[per_request{#SINGLETON}]", + "delay": "0", + "history": "7d", + "value_type": "FLOAT", + "units": "B", + "description": "Average number of client requests per second", + "preprocessing": [ + { + "type": "JSONPATH", + "parameters": [ + "$.BytesPerReq" + ] + } + ], + "master_item": { + "key": "apache.get_status" + }, + "tags": [ + { + "tag": "component", + "value": "connection" + } + ] + }, + { + "uuid": "062d7c941f0c468d8b63fa76ae0610f6", + "name": "Apache: Connections async closing", + "type": "DEPENDENT", + "key": "apache.connections[async_closing{#SINGLETON}]", + "delay": "0", + "history": "7d", + "description": "Number of async connections in closing state (only applicable to event MPM)", + "preprocessing": [ + { + "type": "JSONPATH", + "parameters": [ + "$.ConnsAsyncClosing" + ] + } + ], + "master_item": { + "key": "apache.get_status" + }, + "tags": [ + { + "tag": "component", + "value": "connection" + } + ] + }, + { + "uuid": "6cb8b255ad8343a48e622912bc298366", + "name": "Apache: Connections async keep alive", + "type": "DEPENDENT", + "key": "apache.connections[async_keep_alive{#SINGLETON}]", + "delay": "0", + "history": "7d", + "description": "Number of async connections in keep-alive state (only applicable to event MPM)", + "preprocessing": [ + { + "type": "JSONPATH", + "parameters": [ + "$.ConnsAsyncKeepAlive" + ] + } + ], + "master_item": { + "key": "apache.get_status" + }, + "tags": [ + { + "tag": "component", + "value": "connection" + } + ] + }, + { + "uuid": "997b3452aac24ad6afbad775d649c727", + "name": "Apache: Connections async writing", + "type": "DEPENDENT", + "key": "apache.connections[async_writing{#SINGLETON}]", + "delay": "0", + "history": "7d", + "description": "Number of async connections in writing state (only applicable to event MPM)", + "preprocessing": [ + { + "type": "JSONPATH", + "parameters": [ + "$.ConnsAsyncWriting" + ] + } + ], + "master_item": { + "key": "apache.get_status" + }, + "tags": [ + { + "tag": "component", + "value": "connection" + } + ] + }, + { + "uuid": "31cb044eed904ca19150921fe36f3285", + "name": "Apache: Connections total", + "type": "DEPENDENT", + "key": "apache.connections[total{#SINGLETON}]", + "delay": "0", + "history": "7d", + "description": "Number of total connections", + "preprocessing": [ + { + "type": "JSONPATH", + "parameters": [ + "$.ConnsTotal" + ] + } + ], + "master_item": { + "key": "apache.get_status" + }, + "tags": [ + { + "tag": "component", + "value": "connection" + } + ] + }, + { + "uuid": "34555340f3ad4b878504df188f54a9c9", + "name": "Apache: Number of async processes", + "type": "DEPENDENT", + "key": "apache.process[num{#SINGLETON}]", + "delay": "0", + "history": "7d", + "description": "Number of async processes", + "preprocessing": [ + { + "type": "JSONPATH", + "parameters": [ + "$.Processes" + ] + } + ], + "master_item": { + "key": "apache.get_status" + }, + "tags": [ + { + "tag": "component", + "value": "system" + } + ] + } + ], + "graph_prototypes": [ + { + "uuid": "066b53ed2244414ca3090498eb035c27", + "name": "Apache: Current async connections{#SINGLETON}", + "graph_items": [ + { + "color": "1A7C11", + "item": { + "host": "Apache by HTTP", + "key": "apache.connections[async_closing{#SINGLETON}]" + } + }, + { + "sortorder": "1", + "color": "2774A4", + "item": { + "host": "Apache by HTTP", + "key": "apache.connections[async_keep_alive{#SINGLETON}]" + } + }, + { + "sortorder": "2", + "color": "F63100", + "item": { + "host": "Apache by HTTP", + "key": "apache.connections[async_writing{#SINGLETON}]" + } + }, + { + "sortorder": "3", + "drawtype": "BOLD_LINE", + "color": "A54F10", + "item": { + "host": "Apache by HTTP", + "key": "apache.connections[total{#SINGLETON}]" + } + } + ] + }, + { + "uuid": "dbaa0c2468cc40fca977fb382d19cb78", + "name": "Apache: Current async processes{#SINGLETON}", + "graph_items": [ + { + "drawtype": "GRADIENT_LINE", + "color": "1A7C11", + "item": { + "host": "Apache by HTTP", + "key": "apache.process[num{#SINGLETON}]" + } + } + ] + } + ], + "master_item": { + "key": "apache.get_status" + }, + "preprocessing": [ + { + "type": "JAVASCRIPT", + "parameters": [ + "return JSON.stringify(JSON.parse(value).ServerMPM === 'event'\n ? [{'{#SINGLETON}': ''}] : []);" + ] + }, + { + "type": "DISCARD_UNCHANGED_HEARTBEAT", + "parameters": [ + "3h" + ] + } + ] + } + ], + "tags": [ + { + "tag": "class", + "value": "software" + }, + { + "tag": "target", + "value": "apache" + } + ], + "macros": [ + { + "macro": "{$APACHE.RESPONSE_TIME.MAX.WARN}", + "value": "10", + "description": "Maximum Apache response time in seconds for trigger expression" + }, + { + "macro": "{$APACHE.STATUS.PATH}", + "value": "server-status?auto", + "description": "The URL path" + }, + { + "macro": "{$APACHE.STATUS.PORT}", + "value": "81", + "description": "The port of Apache status page" + }, + { + "macro": "{$APACHE.STATUS.SCHEME}", + "value": "http", + "description": "Request scheme which may be http or https" + } + ], + "dashboards": [ + { + "uuid": "a328c9e713424465a8e1adec7322b0dc", + "name": "Apache performance", + "pages": [ + { + "widgets": [ + { + "type": "graph", + "width": "12", + "height": "5", + "fields": [ + { + "type": "GRAPH", + "name": "graphid", + "value": { + "host": "Apache by HTTP", + "name": "Apache: Requests per second" + } + } + ] + }, + { + "type": "graph", + "y": "5", + "width": "12", + "height": "5", + "fields": [ + { + "type": "GRAPH", + "name": "graphid", + "value": { + "host": "Apache by HTTP", + "name": "Apache: Bytes per second" + } + } + ] + }, + { + "type": "graph", + "y": "10", + "width": "12", + "height": "5", + "fields": [ + { + "type": "GRAPH", + "name": "graphid", + "value": { + "host": "Apache by HTTP", + "name": "Apache: Service response time" + } + } + ] + }, + { + "type": "graph", + "x": "12", + "width": "12", + "height": "5", + "fields": [ + { + "type": "GRAPH", + "name": "graphid", + "value": { + "host": "Apache by HTTP", + "name": "Apache: Workers total" + } + } + ] + }, + { + "type": "graph", + "x": "12", + "y": "5", + "width": "12", + "height": "5", + "fields": [ + { + "type": "GRAPH", + "name": "graphid", + "value": { + "host": "Apache by HTTP", + "name": "Apache: Worker states" + } + } + ] + }, + { + "type": "graph", + "x": "12", + "y": "10", + "width": "12", + "height": "5", + "fields": [ + { + "type": "GRAPH", + "name": "graphid", + "value": { + "host": "Apache by HTTP", + "name": "Apache: Service ping" + } + } + ] + } + ] + } + ] + } + ], + "valuemaps": [ + { + "uuid": "a5d1f911fb264bd4bc087ea582626d7f", + "name": "Service state", + "mappings": [ + { + "value": "0", + "newvalue": "Down" + }, + { + "value": "1", + "newvalue": "Up" + } + ] + } + ] + } + ], + "graphs": [ + { + "uuid": "be2cc04cb0044b7bb4b57295477a0d59", + "name": "Apache: Bytes per second", + "graph_items": [ + { + "color": "1A7C11", + "calc_fnc": "ALL", + "item": { + "host": "Apache by HTTP", + "key": "apache.bytes.rate" + } + } + ] + }, + { + "uuid": "a3998992f7504a12826e3c4d592836b5", + "name": "Apache: Requests per second", + "graph_items": [ + { + "drawtype": "GRADIENT_LINE", + "color": "1A7C11", + "item": { + "host": "Apache by HTTP", + "key": "apache.requests.rate" + } + } + ] + }, + { + "uuid": "ef7cd463999a4b33af49fa3261cd6bf3", + "name": "Apache: Service ping", + "graph_items": [ + { + "color": "1A7C11", + "calc_fnc": "ALL", + "item": { + "host": "Apache by HTTP", + "key": "net.tcp.service[http,\"{HOST.CONN}\",\"{$APACHE.STATUS.PORT}\"]" + } + } + ] + }, + { + "uuid": "b1ed1612dc72482f92ce41468499e6a8", + "name": "Apache: Service response time", + "graph_items": [ + { + "color": "1A7C11", + "calc_fnc": "ALL", + "item": { + "host": "Apache by HTTP", + "key": "net.tcp.service.perf[http,\"{HOST.CONN}\",\"{$APACHE.STATUS.PORT}\"]" + } + } + ] + }, + { + "uuid": "1629062b5cd74b67af9a60226a79f8f1", + "name": "Apache: Worker states", + "graph_items": [ + { + "color": "1A7C11", + "item": { + "host": "Apache by HTTP", + "key": "apache.workers.dnslookup" + } + }, + { + "sortorder": "1", + "color": "2774A4", + "item": { + "host": "Apache by HTTP", + "key": "apache.workers.cleanup" + } + }, + { + "sortorder": "2", + "color": "F63100", + "item": { + "host": "Apache by HTTP", + "key": "apache.workers.logging" + } + }, + { + "sortorder": "3", + "color": "A54F10", + "item": { + "host": "Apache by HTTP", + "key": "apache.workers.reading" + } + }, + { + "sortorder": "4", + "color": "FC6EA3", + "item": { + "host": "Apache by HTTP", + "key": "apache.workers.sending" + } + }, + { + "sortorder": "5", + "color": "6C59DC", + "item": { + "host": "Apache by HTTP", + "key": "apache.workers.starting" + } + }, + { + "sortorder": "6", + "color": "AC8C14", + "item": { + "host": "Apache by HTTP", + "key": "apache.workers.closing" + } + }, + { + "sortorder": "7", + "color": "611F27", + "item": { + "host": "Apache by HTTP", + "key": "apache.workers.finishing" + } + }, + { + "sortorder": "8", + "color": "F230E0", + "item": { + "host": "Apache by HTTP", + "key": "apache.workers.keepalive" + } + }, + { + "sortorder": "9", + "color": "FFAD40", + "item": { + "host": "Apache by HTTP", + "key": "apache.workers.slot" + } + }, + { + "sortorder": "10", + "color": "40CDFF", + "item": { + "host": "Apache by HTTP", + "key": "apache.workers.waiting" + } + } + ] + }, + { + "uuid": "78e59f1b5eb747019f92921ac5ef48b0", + "name": "Apache: Workers total", + "type": "STACKED", + "graph_items": [ + { + "color": "1A7C11", + "item": { + "host": "Apache by HTTP", + "key": "apache.workers_total.busy" + } + }, + { + "sortorder": "1", + "color": "2774A4", + "item": { + "host": "Apache by HTTP", + "key": "apache.workers_total.idle" + } + } + ] + } + ] + } +} \ No newline at end of file diff --git a/zabbix-templates/lxd-container.json b/zabbix-templates/lxd-container.json new file mode 100644 index 0000000..0929e9c --- /dev/null +++ b/zabbix-templates/lxd-container.json @@ -0,0 +1,1159 @@ +{ + "zabbix_export": { + "version": "6.4", + "template_groups": [ + { + "uuid": "cf12023e2c3542409d7152bdbb8dcd2a", + "name": "Nextcloud Installation" + }, + { + "uuid": "7df96b18c230490a9a0a9e2307226338", + "name": "Templates" + } + ], + "templates": [ + { + "uuid": "a307d5ee43b34e6c8cbd8ffa524111ba", + "template": "LXD Container", + "name": "LXD Container", + "description": "Template for LXD Container (based on https://github.com/kvaps/zabbix-linux-container-template)", + "groups": [ + { + "name": "Nextcloud Installation" + }, + { + "name": "Templates" + } + ], + "items": [ + { + "uuid": "76baaafbd3d94c779b021d2da2e9a2b3", + "name": "Processor load (1 min average per core)", + "key": "ct.cpu.load[percpu,avg1]", + "history": "1w", + "value_type": "FLOAT", + "description": "The processor load is calculated as system CPU load divided by number of CPU cores.", + "tags": [ + { + "tag": "Application", + "value": "CPU" + }, + { + "tag": "Application", + "value": "Performance" + } + ], + "triggers": [ + { + "uuid": "98fb6eac561748dcbaf458eb36924c4f", + "expression": "avg(/LXD Container/ct.cpu.load[percpu,avg1],5m)>20", + "name": "Processor load is too high on {HOST.NAME}", + "priority": "WARNING" + } + ] + }, + { + "uuid": "ff53668f0e0c430b9989f67feb399e55", + "name": "Processor load (5 min average per core)", + "key": "ct.cpu.load[percpu,avg5]", + "history": "1w", + "value_type": "FLOAT", + "description": "The processor load is calculated as system CPU load divided by number of CPU cores.", + "tags": [ + { + "tag": "Application", + "value": "CPU" + }, + { + "tag": "Application", + "value": "Performance" + } + ] + }, + { + "uuid": "ec833e0cab554d8e91f9916a0aee06b5", + "name": "Processor load (15 min average per core)", + "key": "ct.cpu.load[percpu,avg15]", + "history": "1w", + "value_type": "FLOAT", + "description": "The processor load is calculated as system CPU load divided by number of CPU cores.", + "tags": [ + { + "tag": "Application", + "value": "CPU" + }, + { + "tag": "Application", + "value": "Performance" + } + ] + }, + { + "uuid": "654c7defbabc4e21840d2798cb73b19b", + "name": "Available memory", + "key": "ct.memory.size[available]", + "history": "1w", + "units": "B", + "description": "Available memory is defined as free+cached+buffers memory.", + "tags": [ + { + "tag": "Application", + "value": "Memory" + } + ], + "triggers": [ + { + "uuid": "efc3d68fe84f455280b6b7e7406a900c", + "expression": "last(/LXD Container/ct.memory.size[available])<20M", + "name": "Lack of available memory on server {HOST.NAME}", + "priority": "AVERAGE" + } + ] + }, + { + "uuid": "71741f5a1503404bb2430e5a354f8792", + "name": "Total memory", + "key": "ct.memory.size[total]", + "delay": "1h", + "history": "1w", + "units": "B", + "tags": [ + { + "tag": "Application", + "value": "Memory" + } + ] + }, + { + "uuid": "3c2e67649b284457bd2a39ff74b1545a", + "name": "Used memory", + "key": "ct.memory.size[used]", + "history": "1w", + "units": "B", + "description": "Used memory", + "tags": [ + { + "tag": "Application", + "value": "Memory" + } + ] + }, + { + "uuid": "bd2907630095462d8e7e8aa9d08fb1e1", + "name": "Used swap space in %", + "key": "ct.swap.size[pused]", + "history": "1w", + "value_type": "FLOAT", + "units": "%", + "tags": [ + { + "tag": "Application", + "value": "Memory" + } + ], + "triggers": [ + { + "uuid": "6570b8608751425f9503716453d1485a", + "expression": "last(/LXD Container/ct.swap.size[pused])>50", + "name": "Lack of free swap space on {HOST.NAME}", + "status": "DISABLED", + "priority": "WARNING", + "description": "It probably means that the systems requires more physical memory." + } + ] + }, + { + "uuid": "600958a99fe741ae922f7cbf51d97ecf", + "name": "Total swap space", + "key": "ct.swap.size[total]", + "delay": "1h", + "history": "1w", + "units": "B", + "tags": [ + { + "tag": "Application", + "value": "Memory" + } + ] + }, + { + "uuid": "d916175598d5455fa4f0d31047a7afa7", + "name": "Used swap space", + "key": "ct.swap.size[used]", + "history": "1w", + "units": "B", + "tags": [ + { + "tag": "Application", + "value": "Memory" + } + ] + }, + { + "uuid": "ad0a846efffb44bbb548f6363d361ea0", + "name": "Maximum number of opened files", + "key": "kernel.maxfiles", + "delay": "1h", + "history": "1w", + "description": "It could be increased by using sysctrl utility or modifying file /etc/sysctl.conf.", + "tags": [ + { + "tag": "Application", + "value": "OS" + } + ], + "triggers": [ + { + "uuid": "d6d4371e903544ad847256479b10e8ad", + "expression": "last(/LXD Container/kernel.maxfiles)<1024", + "name": "Configured max number of opened files is too low on {HOST.NAME}", + "priority": "INFO" + } + ] + }, + { + "uuid": "a9f63e2e69fa4bfcbcb81b4d07d1f398", + "name": "Maximum number of processes", + "key": "kernel.maxproc", + "delay": "1h", + "history": "1w", + "description": "It could be increased by using sysctrl utility or modifying file /etc/sysctl.conf.", + "tags": [ + { + "tag": "Application", + "value": "OS" + } + ], + "triggers": [ + { + "uuid": "3c679ac3f7684f32ae4d331a74d73160", + "expression": "last(/LXD Container/kernel.maxproc)<256", + "name": "Configured max number of processes is too low on {HOST.NAME}", + "priority": "INFO" + } + ] + }, + { + "uuid": "f4c6feca4bbc4cf5a789dd8557244187", + "name": "Incoming Network Traffic (eth0)", + "key": "net.if.in[eth0]", + "units": "bps", + "description": "Incoming Network Traffic (eth0)", + "preprocessing": [ + { + "type": "CHANGE_PER_SECOND", + "parameters": [ + "" + ] + }, + { + "type": "MULTIPLIER", + "parameters": [ + "8" + ] + } + ] + }, + { + "uuid": "a81a77c843dd44189133d57731a6d842", + "name": "Outgoing Network Traffic (eth0)", + "key": "net.if.out[eth0]", + "units": "bps", + "description": "Outgoing Network Traffic (eth0)", + "preprocessing": [ + { + "type": "CHANGE_PER_SECOND", + "parameters": [ + "" + ] + }, + { + "type": "MULTIPLIER", + "parameters": [ + "8" + ] + } + ] + }, + { + "uuid": "701f34b74258440f9723b60d60c7bbdb", + "name": "Number of running processes", + "key": "proc.num[,,run]", + "history": "1w", + "description": "Number of processes in running state.", + "tags": [ + { + "tag": "Application", + "value": "Processes" + } + ], + "triggers": [ + { + "uuid": "24cfcdc3fbf64262bf45d313f19bb4bf", + "expression": "avg(/LXD Container/proc.num[,,run],5m)>100", + "name": "Too many processes running on {HOST.NAME}", + "priority": "WARNING" + } + ] + }, + { + "uuid": "8aa04f54abd5433c8f7229e42eb002a3", + "name": "Number of processes", + "key": "proc.num[]", + "history": "1w", + "description": "Total number of processes in any state.", + "tags": [ + { + "tag": "Application", + "value": "Processes" + } + ], + "triggers": [ + { + "uuid": "d6225d243b6f4b1680c2990bcf011038", + "expression": "avg(/LXD Container/proc.num[],5m)>1000", + "name": "Too many processes on {HOST.NAME}", + "priority": "WARNING" + } + ] + }, + { + "uuid": "abca07defec94aab8f95e82a00b6b6e8", + "name": "Host boot time", + "key": "system.boottime", + "delay": "10m", + "history": "1w", + "units": "unixtime", + "tags": [ + { + "tag": "Application", + "value": "General" + }, + { + "tag": "Application", + "value": "OS" + } + ] + }, + { + "uuid": "775a23e16c974969bbdbf61c16a0dfbf", + "name": "Interrupts per second", + "key": "system.cpu.intr", + "history": "1w", + "units": "ips", + "preprocessing": [ + { + "type": "CHANGE_PER_SECOND", + "parameters": [ + "" + ] + } + ], + "tags": [ + { + "tag": "Application", + "value": "CPU" + }, + { + "tag": "Application", + "value": "Performance" + } + ] + }, + { + "uuid": "1a4dc8b51aac4c2db44ba9d37ebc3d5b", + "name": "Context switches per second", + "key": "system.cpu.switches", + "history": "1w", + "units": "sps", + "preprocessing": [ + { + "type": "CHANGE_PER_SECOND", + "parameters": [ + "" + ] + } + ], + "tags": [ + { + "tag": "Application", + "value": "CPU" + }, + { + "tag": "Application", + "value": "Performance" + } + ] + }, + { + "uuid": "48faf27f96ae4c96b80a5325e3f13b15", + "name": "CPU idle time", + "key": "system.cpu.util[,idle]", + "history": "1w", + "value_type": "FLOAT", + "units": "%", + "description": "The time the CPU has spent doing nothing.", + "tags": [ + { + "tag": "Application", + "value": "CPU" + }, + { + "tag": "Application", + "value": "Performance" + } + ] + }, + { + "uuid": "a5916aa5502444e8a98b0d90fd4b0608", + "name": "CPU interrupt time", + "key": "system.cpu.util[,interrupt]", + "history": "1w", + "value_type": "FLOAT", + "units": "%", + "description": "The amount of time the CPU has been servicing hardware interrupts.", + "tags": [ + { + "tag": "Application", + "value": "CPU" + }, + { + "tag": "Application", + "value": "Performance" + } + ] + }, + { + "uuid": "3be9cabb1be54424943bc22ca9269036", + "name": "CPU iowait time", + "key": "system.cpu.util[,iowait]", + "history": "1w", + "value_type": "FLOAT", + "units": "%", + "description": "Amount of time the CPU has been waiting for I/O to complete.", + "tags": [ + { + "tag": "Application", + "value": "CPU" + }, + { + "tag": "Application", + "value": "Performance" + } + ], + "triggers": [ + { + "uuid": "b8bddac9ed8f43d3ab4a4ba505f425d8", + "expression": "avg(/LXD Container/system.cpu.util[,iowait],5m)>75", + "name": "Disk I/O is overloaded on {HOST.NAME}", + "priority": "WARNING", + "description": "OS spends significant time waiting for I/O (input/output) operations. It could be indicator of performance issues with storage system." + } + ] + }, + { + "uuid": "d79f1d5acf764d279d40b8e61c4ef2fb", + "name": "CPU nice time", + "key": "system.cpu.util[,nice]", + "history": "1w", + "value_type": "FLOAT", + "units": "%", + "description": "The time the CPU has spent running users' processes that have been niced.", + "tags": [ + { + "tag": "Application", + "value": "CPU" + }, + { + "tag": "Application", + "value": "Performance" + } + ] + }, + { + "uuid": "a38e65c954c14514a0dd7a1ab6f093cf", + "name": "CPU softirq time", + "key": "system.cpu.util[,softirq]", + "history": "1w", + "value_type": "FLOAT", + "units": "%", + "description": "The amount of time the CPU has been servicing software interrupts.", + "tags": [ + { + "tag": "Application", + "value": "CPU" + }, + { + "tag": "Application", + "value": "Performance" + } + ] + }, + { + "uuid": "87a1281ba4cf42f0a4065dfd339c6e6f", + "name": "CPU steal time", + "key": "system.cpu.util[,steal]", + "history": "1w", + "value_type": "FLOAT", + "units": "%", + "description": "The amount of CPU 'stolen' from this virtual machine by the hypervisor for other tasks (such as running another virtual machine).", + "tags": [ + { + "tag": "Application", + "value": "CPU" + }, + { + "tag": "Application", + "value": "Performance" + } + ] + }, + { + "uuid": "d0702aae2dc840da82fdfbb30d4bac32", + "name": "CPU system time", + "key": "system.cpu.util[,system]", + "history": "1w", + "value_type": "FLOAT", + "units": "%", + "description": "The time the CPU has spent running the kernel and its processes.", + "tags": [ + { + "tag": "Application", + "value": "CPU" + }, + { + "tag": "Application", + "value": "Performance" + } + ] + }, + { + "uuid": "32fd85dc65184625b158410259088fab", + "name": "CPU user time", + "key": "system.cpu.util[,user]", + "history": "1w", + "value_type": "FLOAT", + "units": "%", + "description": "The time the CPU has spent running users' processes that are not niced.", + "tags": [ + { + "tag": "Application", + "value": "CPU" + }, + { + "tag": "Application", + "value": "Performance" + } + ] + }, + { + "uuid": "29f8c3c5fa3b4399b0b9089decb195ae", + "name": "Host name", + "key": "system.hostname", + "delay": "1h", + "history": "1w", + "trends": "0", + "value_type": "CHAR", + "description": "System host name.", + "inventory_link": "NAME", + "tags": [ + { + "tag": "Application", + "value": "General" + }, + { + "tag": "Application", + "value": "OS" + } + ], + "triggers": [ + { + "uuid": "1d07cea03d8a47cab36c916c3e0bb691", + "expression": "(last(/LXD Container/system.hostname,#1)<>last(/LXD Container/system.hostname,#2))>0", + "name": "Hostname was changed on {HOST.NAME}", + "priority": "INFO" + } + ] + }, + { + "uuid": "ad5fef4efa84440b905ef42a8709195e", + "name": "Host local time", + "key": "system.localtime", + "history": "1w", + "units": "unixtime", + "tags": [ + { + "tag": "Application", + "value": "General" + }, + { + "tag": "Application", + "value": "OS" + } + ] + }, + { + "uuid": "771e72f5dbf24aaa946ca64f2fb15469", + "name": "System information", + "key": "system.uname", + "delay": "1h", + "history": "1w", + "trends": "0", + "value_type": "CHAR", + "description": "The information as normally returned by 'uname -a'.", + "inventory_link": "OS", + "tags": [ + { + "tag": "Application", + "value": "General" + }, + { + "tag": "Application", + "value": "OS" + } + ], + "triggers": [ + { + "uuid": "5412801190da459fa9e89b76f8b50b16", + "expression": "(last(/LXD Container/system.uname,#1)<>last(/LXD Container/system.uname,#2))>0", + "name": "Host information was changed on {HOST.NAME}", + "priority": "INFO" + } + ] + }, + { + "uuid": "fdec15f47fb1436ca88b1d2d664dcbd7", + "name": "System uptime", + "key": "system.uptime", + "delay": "10m", + "history": "1w", + "units": "uptime", + "tags": [ + { + "tag": "Application", + "value": "General" + }, + { + "tag": "Application", + "value": "OS" + } + ], + "triggers": [ + { + "uuid": "db39143ac1094ce89845752bd759751d", + "expression": "change(/LXD Container/system.uptime)<0", + "name": "{HOST.NAME} has just been restarted", + "priority": "INFO" + } + ] + }, + { + "uuid": "451c61db9e8241d5bee33666646dd69a", + "name": "Number of logged in users", + "key": "system.users.num", + "history": "1w", + "description": "Number of users who are currently logged in.", + "tags": [ + { + "tag": "Application", + "value": "OS" + }, + { + "tag": "Application", + "value": "Security" + } + ] + }, + { + "uuid": "7ba9f4699a35481b887c60ec95f4ccb5", + "name": "Checksum of $1", + "key": "vfs.file.cksum[/etc/passwd]", + "delay": "1h", + "history": "1w", + "tags": [ + { + "tag": "Application", + "value": "Security" + } + ], + "triggers": [ + { + "uuid": "1384cbb14e4643308c7a5cb7c7b44f39", + "expression": "(last(/LXD Container/vfs.file.cksum[/etc/passwd],#1)<>last(/LXD Container/vfs.file.cksum[/etc/passwd],#2))>0", + "name": "/etc/passwd has been changed on {HOST.NAME}", + "priority": "WARNING" + } + ] + } + ], + "discovery_rules": [ + { + "uuid": "2daa2ffa5a8e4aa6aaf36ebabc60282e", + "name": "Mounted Filesystems Discovery", + "key": "vfs.fs.discovery", + "delay": "1h", + "filter": { + "evaltype": "AND", + "conditions": [ + { + "macro": "{#FSNAME}", + "value": "{$VFS.FS.FSNAME.MATCHES}", + "formulaid": "A" + }, + { + "macro": "{#FSNAME}", + "value": "{$VFS.FS.FSNAME.NOT_MATCHES}", + "operator": "NOT_MATCHES_REGEX", + "formulaid": "B" + }, + { + "macro": "{#FSTYPE}", + "value": "{$VFS.FS.FSTYPE.MATCHES}", + "formulaid": "C" + }, + { + "macro": "{#FSTYPE}", + "value": "{$VFS.FS.FSTYPE.NOT_MATCHES}", + "operator": "NOT_MATCHES_REGEX", + "formulaid": "D" + } + ] + }, + "lifetime": "1h", + "description": "Mounted Filesystems Discovery", + "item_prototypes": [ + { + "uuid": "cf4a09bd77de40c1b69cd67e3e99bd9b", + "name": "{#FSNAME}: Free inodes in %", + "key": "vfs.fs.inode[{#FSNAME},pfree]", + "delay": "1h", + "value_type": "FLOAT", + "units": "%", + "tags": [ + { + "tag": "component", + "value": "storage" + }, + { + "tag": "filesystem", + "value": "{#FSNAME}" + } + ] + }, + { + "uuid": "6b5e8d1f568a4b41855be117f6e925c7", + "name": "{#FSNAME}: Space Utilization", + "key": "vfs.fs.size[{#FSNAME},pused]", + "delay": "1h", + "value_type": "FLOAT", + "units": "%", + "description": "The space utilization expressed in % for {#FSNAME}.", + "tags": [ + { + "tag": "component", + "value": "storage" + }, + { + "tag": "filesystem", + "value": "{#FSNAME}" + } + ] + }, + { + "uuid": "e30a48901e3b4982919f776d730b2dec", + "name": "{#FSNAME}: Total space", + "key": "vfs.fs.size[{#FSNAME},total]", + "delay": "1h", + "description": "Total storage expressed in Bytes", + "tags": [ + { + "tag": "component", + "value": "storage" + }, + { + "tag": "filesystem", + "value": "{#FSNAME}" + } + ] + }, + { + "uuid": "1a12ae3d4f134cc892be92e6bdba24d7", + "name": "{#FSNAME}: Used space", + "key": "vfs.fs.size[{#FSNAME},used]", + "delay": "1h", + "description": "Used storage expressed in Bytes" + } + ] + } + ], + "macros": [ + { + "macro": "{$VFS.FS.FSNAME.MATCHES}", + "value": ".+", + "description": "This macro is used for discovery of the filesystems. It can be overridden on host level or its linked template level (copied from template \"Linux by Zabbix Agent\")." + }, + { + "macro": "{$VFS.FS.FSNAME.NOT_MATCHES}", + "value": "^(/dev|/sys|/run|/proc|.+/shm$)", + "description": "This macro is used for discovery of the filesystems. It can be overridden on host level or its linked template level (copied from template \"Linux by Zabbix Agent\")." + }, + { + "macro": "{$VFS.FS.FSTYPE.MATCHES}", + "value": "^(btrfs|ext2|ext3|ext4|reiser|xfs|ffs|ufs|jfs|jfs2|vxfs|hfs|apfs|refs|ntfs|fat32|zfs)$", + "description": "This macro is used for discovery of the filesystems. It can be overridden on host level or its linked template level (copied from template \"Linux by Zabbix Agent\")." + }, + { + "macro": "{$VFS.FS.FSTYPE.NOT_MATCHES}", + "value": "^\\s$", + "description": "This macro is used for discovery of the filesystems. It can be overridden on host level or its linked template level (copied from template \"Linux by Zabbix Agent\")." + } + ], + "dashboards": [ + { + "uuid": "df90d1983d9f4d4aa9517639657a2337", + "name": "System performance", + "pages": [ + { + "widgets": [ + { + "type": "graph", + "width": "12", + "height": "5", + "fields": [ + { + "type": "GRAPH", + "name": "graphid", + "value": { + "host": "LXD Container", + "name": "CPU load" + } + } + ] + }, + { + "type": "graph", + "y": "5", + "width": "12", + "height": "5", + "fields": [ + { + "type": "GRAPH", + "name": "graphid", + "value": { + "host": "LXD Container", + "name": "Memory usage" + } + } + ] + }, + { + "type": "graph", + "y": "10", + "width": "12", + "height": "5", + "fields": [ + { + "type": "ITEM", + "name": "itemid", + "value": { + "host": "LXD Container", + "key": "proc.num[]" + } + }, + { + "type": "INTEGER", + "name": "source_type", + "value": "1" + } + ] + }, + { + "type": "graph", + "y": "15", + "width": "12", + "height": "5", + "fields": [ + { + "type": "GRAPH", + "name": "graphid", + "value": { + "host": "LXD Container", + "name": "Incoming Network Traffic (eth0)" + } + } + ] + }, + { + "type": "graph", + "x": "12", + "width": "12", + "height": "5", + "fields": [ + { + "type": "GRAPH", + "name": "graphid", + "value": { + "host": "LXD Container", + "name": "CPU usage" + } + } + ] + }, + { + "type": "graph", + "x": "12", + "y": "5", + "width": "12", + "height": "5", + "fields": [ + { + "type": "ITEM", + "name": "itemid", + "value": { + "host": "LXD Container", + "key": "proc.num[,,run]" + } + }, + { + "type": "INTEGER", + "name": "source_type", + "value": "1" + } + ] + }, + { + "type": "graph", + "x": "12", + "y": "15", + "width": "12", + "height": "5", + "fields": [ + { + "type": "GRAPH", + "name": "graphid", + "value": { + "host": "LXD Container", + "name": "Outgoing Network Traffic (eth0)" + } + } + ] + } + ] + } + ] + } + ] + } + ], + "graphs": [ + { + "uuid": "c3c8401d0b614ba3893c66015eafd115", + "name": "CPU jumps", + "graph_items": [ + { + "color": "009900", + "item": { + "host": "LXD Container", + "key": "system.cpu.switches" + } + }, + { + "sortorder": "1", + "color": "000099", + "item": { + "host": "LXD Container", + "key": "system.cpu.intr" + } + } + ] + }, + { + "uuid": "65cfe6acfb1149688d56b6ea4327bfb0", + "name": "CPU load", + "ymin_type_1": "FIXED", + "graph_items": [ + { + "color": "009900", + "item": { + "host": "LXD Container", + "key": "ct.cpu.load[percpu,avg1]" + } + }, + { + "sortorder": "1", + "color": "000099", + "item": { + "host": "LXD Container", + "key": "ct.cpu.load[percpu,avg5]" + } + }, + { + "sortorder": "2", + "color": "990000", + "item": { + "host": "LXD Container", + "key": "ct.cpu.load[percpu,avg15]" + } + } + ] + }, + { + "uuid": "eb6a225c064d45b8a753583dcd196c1f", + "name": "CPU usage", + "show_triggers": "NO", + "ymin_type_1": "FIXED", + "ymax_type_1": "FIXED", + "graph_items": [ + { + "color": "FF5555", + "item": { + "host": "LXD Container", + "key": "system.cpu.util[,steal]" + } + }, + { + "sortorder": "1", + "color": "55FF55", + "item": { + "host": "LXD Container", + "key": "system.cpu.util[,softirq]" + } + }, + { + "sortorder": "2", + "color": "009999", + "item": { + "host": "LXD Container", + "key": "system.cpu.util[,interrupt]" + } + }, + { + "sortorder": "3", + "color": "990099", + "item": { + "host": "LXD Container", + "key": "system.cpu.util[,nice]" + } + }, + { + "sortorder": "4", + "color": "999900", + "item": { + "host": "LXD Container", + "key": "system.cpu.util[,iowait]" + } + }, + { + "sortorder": "5", + "color": "990000", + "item": { + "host": "LXD Container", + "key": "system.cpu.util[,system]" + } + }, + { + "sortorder": "6", + "color": "000099", + "item": { + "host": "LXD Container", + "key": "system.cpu.util[,user]" + } + }, + { + "sortorder": "7", + "color": "009900", + "item": { + "host": "LXD Container", + "key": "system.cpu.util[,idle]" + } + } + ] + }, + { + "uuid": "1c6d41d77c9d41a9b08cd56a07b71d47", + "name": "Incoming Network Traffic (eth0)", + "graph_items": [ + { + "color": "1A7C11", + "calc_fnc": "ALL", + "item": { + "host": "LXD Container", + "key": "net.if.in[eth0]" + } + } + ] + }, + { + "uuid": "d6ec3ecfc878469b8b7c54906a57b329", + "name": "Memory usage", + "ymin_type_1": "FIXED", + "ymax_type_1": "ITEM", + "ymax_item_1": { + "host": "LXD Container", + "key": "ct.memory.size[total]" + }, + "graph_items": [ + { + "color": "BB0000", + "item": { + "host": "LXD Container", + "key": "ct.memory.size[total]" + } + }, + { + "sortorder": "1", + "drawtype": "GRADIENT_LINE", + "color": "274482", + "calc_fnc": "ALL", + "item": { + "host": "LXD Container", + "key": "ct.memory.size[used]" + } + } + ] + }, + { + "uuid": "51a288c110144346a8b49938efcae683", + "name": "Outgoing Network Traffic (eth0)", + "graph_items": [ + { + "color": "274482", + "calc_fnc": "ALL", + "item": { + "host": "LXD Container", + "key": "net.if.out[eth0]" + } + } + ] + }, + { + "uuid": "e3cf24c2b786420ab4d441a908cc8167", + "name": "Swap usage", + "width": "600", + "height": "340", + "yaxismax": "0", + "show_work_period": "NO", + "show_triggers": "NO", + "type": "PIE", + "graph_items": [ + { + "color": "AA0000", + "item": { + "host": "LXD Container", + "key": "ct.swap.size[used]" + } + }, + { + "sortorder": "1", + "color": "00AA00", + "type": "GRAPH_SUM", + "item": { + "host": "LXD Container", + "key": "ct.swap.size[total]" + } + } + ] + } + ] + } +} \ No newline at end of file diff --git a/zabbix-templates/mysql-by-zabbix-agent.json b/zabbix-templates/mysql-by-zabbix-agent.json new file mode 100644 index 0000000..02e4339 --- /dev/null +++ b/zabbix-templates/mysql-by-zabbix-agent.json @@ -0,0 +1,2650 @@ +{ + "zabbix_export": { + "version": "6.4", + "template_groups": [ + { + "uuid": "cf12023e2c3542409d7152bdbb8dcd2a", + "name": "Nextcloud Installation" + }, + { + "uuid": "748ad4d098d447d492bb935c907f652f", + "name": "Templates/Databases" + } + ], + "templates": [ + { + "uuid": "f255e3fc32124b55b2a17ef3c961e5f5", + "template": "MySQL by Zabbix agent", + "name": "MySQL by Zabbix agent", + "description": "Requirements for template operation:\n1.Install Zabbix agent and MySQL client.\n2.Copy template_db_mysql.conf into folder with Zabbix agent configuration (/etc/zabbix/zabbix_agentd.d/ by default). Don't forget to restart zabbix-agent.\n3.Create MySQL user for monitoring. For example:\nCREATE USER 'zbx_monitor'@'%' IDENTIFIED BY '';\nGRANT REPLICATION CLIENT,PROCESS,SHOW DATABASES,SHOW VIEW ON *.* TO 'zbx_monitor'@'%';\nFor more information read the MySQL documentation https://dev.mysql.com/doc/refman/8.0/en/grant.html , please. \n4.Create .my.cnf in home directory of Zabbix agent for Linux (/var/lib/zabbix by default) or my.cnf in c:\\ for Windows. For example:\n[client]\nuser='zbx_monitor'\npassword=''\n\n\nYou can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/384189-discussion-thread-for-official-zabbix-template-db-mysql\n\nTemplate tooling version used: 0.42", + "groups": [ + { + "name": "Nextcloud Installation" + }, + { + "name": "Templates/Databases" + } + ], + "items": [ + { + "uuid": "b463e01655bf4dec81d5208f7a75766b", + "name": "MySQL: Aborted clients per second", + "type": "DEPENDENT", + "key": "mysql.aborted_clients.rate", + "delay": "0", + "history": "7d", + "value_type": "FLOAT", + "description": "Number of connections that were aborted because the client died without closing the connection properly.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Aborted_clients']/field[@name='Value']/text()" + ] + }, + { + "type": "CHANGE_PER_SECOND", + "parameters": [ + "" + ] + } + ], + "master_item": { + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "connections" + } + ] + }, + { + "uuid": "d33a03e48f6d45dca04a505bab07a860", + "name": "MySQL: Aborted connections per second", + "type": "DEPENDENT", + "key": "mysql.aborted_connects.rate", + "delay": "0", + "history": "7d", + "value_type": "FLOAT", + "description": "Number of failed attempts to connect to the MySQL server.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Aborted_connects']/field[@name='Value']/text()" + ] + }, + { + "type": "CHANGE_PER_SECOND", + "parameters": [ + "" + ] + } + ], + "master_item": { + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "connections" + } + ], + "triggers": [ + { + "uuid": "e51c9ee3061c4e3889be1666afe6959d", + "expression": "min(/MySQL by Zabbix agent/mysql.aborted_connects.rate,5m)>{$MYSQL.ABORTED_CONN.MAX.WARN}", + "name": "MySQL: Server has aborted connections", + "event_name": "MySQL: Server has aborted connections (over {$MYSQL.ABORTED_CONN.MAX.WARN} for 5m)", + "priority": "AVERAGE", + "description": "The number of failed attempts to connect to the MySQL server is more than {$MYSQL.ABORTED_CONN.MAX.WARN} in the last 5 minutes.", + "dependencies": [ + { + "name": "MySQL: Refused connections", + "expression": "last(/MySQL by Zabbix agent/mysql.connection_errors_max_connections.rate)>0" + } + ], + "tags": [ + { + "tag": "scope", + "value": "availability" + } + ] + } + ] + }, + { + "uuid": "75b9c78d76334927a3fc2a4d1322ecc2", + "name": "MySQL: Binlog cache disk use", + "type": "DEPENDENT", + "key": "mysql.binlog_cache_disk_use", + "delay": "0", + "history": "7d", + "value_type": "FLOAT", + "description": "Number of transactions that used a temporary disk cache because they could not fit in the regular binary log cache, being larger than binlog_cache_size.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Binlog_cache_disk_use']/field[@name='Value']/text()" + ] + }, + { + "type": "DISCARD_UNCHANGED_HEARTBEAT", + "parameters": [ + "6h" + ] + } + ], + "master_item": { + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "cache" + } + ] + }, + { + "uuid": "9a447424aca84124abdfa389865126d4", + "name": "MySQL: Buffer pool efficiency", + "type": "CALCULATED", + "key": "mysql.buffer_pool_efficiency", + "history": "7d", + "value_type": "FLOAT", + "units": "%", + "params": "last(//mysql.innodb_buffer_pool_reads) / \n( last(//mysql.innodb_buffer_pool_read_requests) + \n( last(//mysql.innodb_buffer_pool_read_requests) = 0 ) ) * 100 * \n( last(//mysql.innodb_buffer_pool_read_requests) > 0 )", + "description": "The item shows how effectively the buffer pool is serving reads.", + "tags": [ + { + "tag": "component", + "value": "memory" + } + ] + }, + { + "uuid": "9aca02e86e744f43ab48e8ca9453cf77", + "name": "MySQL: Buffer pool utilization", + "type": "CALCULATED", + "key": "mysql.buffer_pool_utilization", + "history": "7d", + "value_type": "FLOAT", + "units": "%", + "params": "( last(//mysql.innodb_buffer_pool_pages_total) - \nlast(//mysql.innodb_buffer_pool_pages_free) ) / \n( last(//mysql.innodb_buffer_pool_pages_total) + \n( last(//mysql.innodb_buffer_pool_pages_total) = 0 ) ) * 100 * \n( last(//mysql.innodb_buffer_pool_pages_total) > 0 )", + "description": "Ratio of used to total pages in the buffer pool.", + "tags": [ + { + "tag": "component", + "value": "memory" + } + ], + "triggers": [ + { + "uuid": "0e8ea91d72a64507aaadf9ea5efa6412", + "expression": "max(/MySQL by Zabbix agent/mysql.buffer_pool_utilization,5m)<{$MYSQL.BUFF_UTIL.MIN.WARN}", + "name": "MySQL: Buffer pool utilization is too low", + "event_name": "MySQL: Buffer pool utilization is too low (less than {$MYSQL.BUFF_UTIL.MIN.WARN}% for 5m)", + "priority": "WARNING", + "description": "The buffer pool utilization is less than {$MYSQL.BUFF_UTIL.MIN.WARN}% in the last 5 minutes. This means that there is a lot of unused RAM allocated for the buffer pool, which you can easily reallocate at the moment.", + "tags": [ + { + "tag": "scope", + "value": "notice" + } + ] + } + ] + }, + { + "uuid": "56512a1e89d34826ad261ab27119e80d", + "name": "MySQL: Bytes received", + "type": "DEPENDENT", + "key": "mysql.bytes_received.rate", + "delay": "0", + "history": "7d", + "value_type": "FLOAT", + "units": "Bps", + "description": "Number of bytes received from all clients.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Bytes_received']/field[@name='Value']/text()" + ] + }, + { + "type": "CHANGE_PER_SECOND", + "parameters": [ + "" + ] + } + ], + "master_item": { + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "network" + } + ] + }, + { + "uuid": "c4cea16e3dbe4d328d9a50e113f3b904", + "name": "MySQL: Bytes sent", + "type": "DEPENDENT", + "key": "mysql.bytes_sent.rate", + "delay": "0", + "history": "7d", + "value_type": "FLOAT", + "units": "Bps", + "description": "Number of bytes sent to all clients.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Bytes_sent']/field[@name='Value']/text()" + ] + }, + { + "type": "CHANGE_PER_SECOND", + "parameters": [ + "" + ] + } + ], + "master_item": { + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "network" + } + ] + }, + { + "uuid": "24ab8f0bd32a45f591c676ef839876df", + "name": "MySQL: Command Delete per second", + "type": "DEPENDENT", + "key": "mysql.com_delete.rate", + "delay": "0", + "history": "7d", + "value_type": "FLOAT", + "description": "The Com_delete counter variable indicates the number of times the delete statement has been executed.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Com_delete']/field[@name='Value']/text()" + ] + }, + { + "type": "CHANGE_PER_SECOND", + "parameters": [ + "" + ] + } + ], + "master_item": { + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "operations" + } + ] + }, + { + "uuid": "e48c67c893e5494fb00ea31222bd2caf", + "name": "MySQL: Command Insert per second", + "type": "DEPENDENT", + "key": "mysql.com_insert.rate", + "delay": "0", + "history": "7d", + "value_type": "FLOAT", + "description": "The Com_insert counter variable indicates the number of times the insert statement has been executed.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Com_insert']/field[@name='Value']/text()" + ] + }, + { + "type": "CHANGE_PER_SECOND", + "parameters": [ + "" + ] + } + ], + "master_item": { + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "operations" + } + ] + }, + { + "uuid": "718c3af61f2645e8ab7d3496d6639c79", + "name": "MySQL: Command Select per second", + "type": "DEPENDENT", + "key": "mysql.com_select.rate", + "delay": "0", + "history": "7d", + "value_type": "FLOAT", + "description": "The Com_select counter variable indicates the number of times the select statement has been executed.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Com_select']/field[@name='Value']/text()" + ] + }, + { + "type": "CHANGE_PER_SECOND", + "parameters": [ + "" + ] + } + ], + "master_item": { + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "operations" + } + ] + }, + { + "uuid": "e2c3ea26dd34472c9e5f0e48a67da6dd", + "name": "MySQL: Command Update per second", + "type": "DEPENDENT", + "key": "mysql.com_update.rate", + "delay": "0", + "history": "7d", + "value_type": "FLOAT", + "description": "The Com_update counter variable indicates the number of times the update statement has been executed.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Com_update']/field[@name='Value']/text()" + ] + }, + { + "type": "CHANGE_PER_SECOND", + "parameters": [ + "" + ] + } + ], + "master_item": { + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "operations" + } + ] + }, + { + "uuid": "bcf8a21aacc54a79a958604b278f9617", + "name": "MySQL: Connections per second", + "type": "DEPENDENT", + "key": "mysql.connections.rate", + "delay": "0", + "history": "7d", + "value_type": "FLOAT", + "description": "Number of connection attempts (successful or not) to the MySQL server.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Connections']/field[@name='Value']/text()" + ] + }, + { + "type": "CHANGE_PER_SECOND", + "parameters": [ + "" + ] + } + ], + "master_item": { + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "connections" + } + ] + }, + { + "uuid": "dc963a1250ab453cb090af0154d745c3", + "name": "MySQL: Connection errors accept per second", + "type": "DEPENDENT", + "key": "mysql.connection_errors_accept.rate", + "delay": "0", + "history": "7d", + "value_type": "FLOAT", + "description": "Number of errors that occurred during calls to accept() on the listening port.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Connection_errors_accept']/field[@name='Value']/text()" + ] + }, + { + "type": "CHANGE_PER_SECOND", + "parameters": [ + "" + ] + } + ], + "master_item": { + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "connections" + } + ] + }, + { + "uuid": "4cff4caf382f4f00b534651212132bd2", + "name": "MySQL: Connection errors internal per second", + "type": "DEPENDENT", + "key": "mysql.connection_errors_internal.rate", + "delay": "0", + "history": "7d", + "value_type": "FLOAT", + "description": "Number of refused connections due to internal server errors, for example, out of memory errors, or failed thread starts.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Connection_errors_internal']/field[@name='Value']/text()" + ] + }, + { + "type": "CHANGE_PER_SECOND", + "parameters": [ + "" + ] + } + ], + "master_item": { + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "connections" + } + ] + }, + { + "uuid": "3cbc55fc7b764a61baceb11e98fd454c", + "name": "MySQL: Connection errors max connections per second", + "type": "DEPENDENT", + "key": "mysql.connection_errors_max_connections.rate", + "delay": "0", + "history": "7d", + "value_type": "FLOAT", + "description": "Number of refused connections due to the max_connections limit being reached.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Connection_errors_max_connections']/field[@name='Value']/text()" + ] + }, + { + "type": "CHANGE_PER_SECOND", + "parameters": [ + "" + ] + } + ], + "master_item": { + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "connections" + } + ], + "triggers": [ + { + "uuid": "2ff2d0f399df4cb08b7196d3a4690567", + "expression": "last(/MySQL by Zabbix agent/mysql.connection_errors_max_connections.rate)>0", + "name": "MySQL: Refused connections", + "event_name": "MySQL: Refused connections (max_connections limit reached)", + "priority": "AVERAGE", + "description": "Number of refused connections due to the max_connections limit being reached.", + "tags": [ + { + "tag": "scope", + "value": "availability" + } + ] + } + ] + }, + { + "uuid": "e577b4b6c553401bbb831b7278dbbcb7", + "name": "MySQL: Connection errors peer address per second", + "type": "DEPENDENT", + "key": "mysql.connection_errors_peer_address.rate", + "delay": "0", + "history": "7d", + "value_type": "FLOAT", + "description": "Number of errors while searching for the connecting client IP address.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Connection_errors_peer_address']/field[@name='Value']/text()" + ] + }, + { + "type": "CHANGE_PER_SECOND", + "parameters": [ + "" + ] + } + ], + "master_item": { + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "connections" + } + ] + }, + { + "uuid": "228aaf5333ce4958aa3a07e0898add63", + "name": "MySQL: Connection errors select per second", + "type": "DEPENDENT", + "key": "mysql.connection_errors_select.rate", + "delay": "0", + "history": "7d", + "value_type": "FLOAT", + "description": "Number of errors during calls to select() or poll() on the listening port. The client would not necessarily have been rejected in these cases.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Connection_errors_select']/field[@name='Value']/text()" + ] + }, + { + "type": "CHANGE_PER_SECOND", + "parameters": [ + "" + ] + } + ], + "master_item": { + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "connections" + } + ] + }, + { + "uuid": "a7632124b2b648bfa80a2e8a0381f4d2", + "name": "MySQL: Connection errors tcpwrap per second", + "type": "DEPENDENT", + "key": "mysql.connection_errors_tcpwrap.rate", + "delay": "0", + "history": "7d", + "value_type": "FLOAT", + "description": "Number of connections the libwrap library has refused.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Connection_errors_tcpwrap']/field[@name='Value']/text()" + ] + }, + { + "type": "CHANGE_PER_SECOND", + "parameters": [ + "" + ] + } + ], + "master_item": { + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "connections" + } + ] + }, + { + "uuid": "52335a039571454ebaccc9ab103200a3", + "name": "MySQL: Created tmp tables on disk per second", + "type": "DEPENDENT", + "key": "mysql.created_tmp_disk_tables.rate", + "delay": "0", + "history": "7d", + "value_type": "FLOAT", + "description": "Number of internal on-disk temporary tables created by the server while executing statements.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Created_tmp_disk_tables']/field[@name='Value']/text()" + ] + }, + { + "type": "CHANGE_PER_SECOND", + "parameters": [ + "" + ] + } + ], + "master_item": { + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "storage" + }, + { + "tag": "component", + "value": "tables" + } + ], + "triggers": [ + { + "uuid": "1b8761292e89476e91834f8e567a1dbe", + "expression": "min(/MySQL by Zabbix agent/mysql.created_tmp_disk_tables.rate,5m)>{$MYSQL.CREATED_TMP_DISK_TABLES.MAX.WARN}", + "name": "MySQL: Number of on-disk temporary tables created per second is high", + "event_name": "MySQL: Number of on-disk temporary tables created per second is high (over {$MYSQL.CREATED_TMP_DISK_TABLES.MAX.WARN} for 5m)", + "priority": "WARNING", + "description": "Possibly the application using the database is in need of query optimization.", + "tags": [ + { + "tag": "scope", + "value": "performance" + } + ] + } + ] + }, + { + "uuid": "d1dd183666d44010a5054f2e1cc328de", + "name": "MySQL: Created tmp files on disk per second", + "type": "DEPENDENT", + "key": "mysql.created_tmp_files.rate", + "delay": "0", + "history": "7d", + "value_type": "FLOAT", + "description": "How many temporary files mysqld has created.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Created_tmp_files']/field[@name='Value']/text()" + ] + }, + { + "type": "CHANGE_PER_SECOND", + "parameters": [ + "" + ] + } + ], + "master_item": { + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "storage" + } + ], + "triggers": [ + { + "uuid": "9845d8dc676f4702ae34b626f39d21ac", + "expression": "min(/MySQL by Zabbix agent/mysql.created_tmp_files.rate,5m)>{$MYSQL.CREATED_TMP_FILES.MAX.WARN}", + "name": "MySQL: Number of temporary files created per second is high", + "event_name": "MySQL: Number of temporary files created per second is high (over {$MYSQL.CREATED_TMP_FILES.MAX.WARN} for 5m)", + "priority": "WARNING", + "description": "Possibly the application using the database is in need of query optimization.", + "tags": [ + { + "tag": "scope", + "value": "performance" + } + ] + } + ] + }, + { + "uuid": "c9a94c3145a643ef8ceec33f63b85ae9", + "name": "MySQL: Created tmp tables on memory per second", + "type": "DEPENDENT", + "key": "mysql.created_tmp_tables.rate", + "delay": "0", + "history": "7d", + "value_type": "FLOAT", + "description": "Number of internal temporary tables created by the server while executing statements.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Created_tmp_tables']/field[@name='Value']/text()" + ] + }, + { + "type": "CHANGE_PER_SECOND", + "parameters": [ + "" + ] + } + ], + "master_item": { + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "memory" + }, + { + "tag": "component", + "value": "tables" + } + ], + "triggers": [ + { + "uuid": "c647a51864e04bc69a1f610b1dec56fe", + "expression": "min(/MySQL by Zabbix agent/mysql.created_tmp_tables.rate,5m)>{$MYSQL.CREATED_TMP_TABLES.MAX.WARN}", + "name": "MySQL: Number of internal temporary tables created per second is high", + "event_name": "MySQL: Number of internal temporary tables created per second is high (over {$MYSQL.CREATED_TMP_TABLES.MAX.WARN} for 5m)", + "priority": "WARNING", + "description": "Possibly the application using the database is in need of query optimization.", + "tags": [ + { + "tag": "scope", + "value": "performance" + } + ] + } + ] + }, + { + "uuid": "2ba81b425bde4ba5b3f7d00a6c922ed9", + "name": "MySQL: Get status variables", + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]", + "history": "0", + "trends": "0", + "value_type": "TEXT", + "description": "The item gets server global status information.", + "tags": [ + { + "tag": "component", + "value": "raw" + } + ] + }, + { + "uuid": "a9b965a07b504fa1b4e90acae0156221", + "name": "MySQL: InnoDB buffer pool pages free", + "type": "DEPENDENT", + "key": "mysql.innodb_buffer_pool_pages_free", + "delay": "0", + "history": "7d", + "description": "The total size of the InnoDB buffer pool, in pages.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Innodb_buffer_pool_pages_free']/field[@name='Value']/text()" + ] + } + ], + "master_item": { + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "innodb" + }, + { + "tag": "component", + "value": "memory" + } + ] + }, + { + "uuid": "efb2450fe30c4ec78b954a35595b7ac7", + "name": "MySQL: InnoDB buffer pool pages total", + "type": "DEPENDENT", + "key": "mysql.innodb_buffer_pool_pages_total", + "delay": "0", + "history": "7d", + "description": "The total size of the InnoDB buffer pool, in pages.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Innodb_buffer_pool_pages_total']/field[@name='Value']/text()" + ] + }, + { + "type": "DISCARD_UNCHANGED_HEARTBEAT", + "parameters": [ + "1h" + ] + } + ], + "master_item": { + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "innodb" + }, + { + "tag": "component", + "value": "memory" + } + ] + }, + { + "uuid": "7738a4480f69427a96d46a9ca5b38d77", + "name": "MySQL: InnoDB buffer pool reads", + "type": "DEPENDENT", + "key": "mysql.innodb_buffer_pool_reads", + "delay": "0", + "history": "7d", + "description": "Number of logical reads that InnoDB could not satisfy from the buffer pool, and had to read directly from the disk.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Innodb_buffer_pool_reads']/field[@name='Value']/text()" + ] + } + ], + "master_item": { + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "innodb" + }, + { + "tag": "component", + "value": "memory" + } + ] + }, + { + "uuid": "1704fe0bf8de4882a6a16ebd75c4c3bf", + "name": "MySQL: InnoDB buffer pool reads per second", + "type": "DEPENDENT", + "key": "mysql.innodb_buffer_pool_reads.rate", + "delay": "0", + "history": "7d", + "value_type": "FLOAT", + "description": "Number of logical reads per second that InnoDB could not satisfy from the buffer pool, and had to read directly from the disk.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Innodb_buffer_pool_reads']/field[@name='Value']/text()" + ] + }, + { + "type": "CHANGE_PER_SECOND", + "parameters": [ + "" + ] + } + ], + "master_item": { + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "innodb" + }, + { + "tag": "component", + "value": "memory" + } + ] + }, + { + "uuid": "598dcdb7eeec42c78484be70c814cd8a", + "name": "MySQL: InnoDB buffer pool read requests", + "type": "DEPENDENT", + "key": "mysql.innodb_buffer_pool_read_requests", + "delay": "0", + "history": "7d", + "description": "Number of logical read requests.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Innodb_buffer_pool_read_requests']/field[@name='Value']/text()" + ] + } + ], + "master_item": { + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "innodb" + }, + { + "tag": "component", + "value": "memory" + } + ] + }, + { + "uuid": "3ed432f4e0c949debaed9d60c5d13810", + "name": "MySQL: InnoDB buffer pool read requests per second", + "type": "DEPENDENT", + "key": "mysql.innodb_buffer_pool_read_requests.rate", + "delay": "0", + "history": "7d", + "value_type": "FLOAT", + "description": "Number of logical read requests per second.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Innodb_buffer_pool_read_requests']/field[@name='Value']/text()" + ] + }, + { + "type": "CHANGE_PER_SECOND", + "parameters": [ + "" + ] + } + ], + "master_item": { + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "innodb" + }, + { + "tag": "component", + "value": "memory" + } + ] + }, + { + "uuid": "61db0feae0b440c087177f4312eb6b7a", + "name": "MySQL: Innodb buffer pool wait free", + "type": "DEPENDENT", + "key": "mysql.innodb_buffer_pool_wait_free", + "delay": "0", + "history": "7d", + "value_type": "FLOAT", + "description": "Number of times InnoDB waited for a free page before reading or creating a page. Normally, writes to the InnoDB buffer pool happen in the background. When no clean pages are available, dirty pages are flushed first in order to free some up. This counts the numbers of wait for this operation to finish. If this value is not small, look at the increasing innodb_buffer_pool_size.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Innodb_buffer_pool_wait_free']/field[@name='Value']/text()" + ] + }, + { + "type": "DISCARD_UNCHANGED_HEARTBEAT", + "parameters": [ + "6h" + ] + } + ], + "master_item": { + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "innodb" + }, + { + "tag": "component", + "value": "memory" + } + ] + }, + { + "uuid": "e5413d85449e4baea683c6365808cc17", + "name": "MySQL: Calculated value of innodb_log_file_size", + "type": "CALCULATED", + "key": "mysql.innodb_log_file_size", + "history": "7d", + "value_type": "FLOAT", + "params": "(last(//mysql.innodb_os_log_written) - last(//mysql.innodb_os_log_written,#1:now-1h)) / {$MYSQL.INNODB_LOG_FILES}", + "description": "Calculated by (innodb_os_log_written-innodb_os_log_written(time shift -1h))/{$MYSQL.INNODB_LOG_FILES} value of the innodb_log_file_size. Innodb_log_file_size is the size in bytes of the each InnoDB redo log file in the log group. The combined size can be no more than 512GB. Larger values mean less disk I/O due to less flushing checkpoint activity, but also slower recovery from a crash.", + "preprocessing": [ + { + "type": "DISCARD_UNCHANGED_HEARTBEAT", + "parameters": [ + "6h" + ] + } + ], + "tags": [ + { + "tag": "component", + "value": "system" + } + ] + }, + { + "uuid": "2eacd8c07f7148acaaa9b8f8602720ae", + "name": "MySQL: Innodb number open files", + "type": "DEPENDENT", + "key": "mysql.innodb_num_open_files", + "delay": "0", + "history": "7d", + "value_type": "FLOAT", + "description": "Number of open files held by InnoDB. InnoDB only.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Innodb_num_open_files']/field[@name='Value']/text()" + ] + }, + { + "type": "DISCARD_UNCHANGED_HEARTBEAT", + "parameters": [ + "6h" + ] + } + ], + "master_item": { + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "innodb" + }, + { + "tag": "component", + "value": "system" + } + ] + }, + { + "uuid": "29d3513668ad4bdea28d947d2f983dd2", + "name": "MySQL: Innodb log written", + "type": "DEPENDENT", + "key": "mysql.innodb_os_log_written", + "delay": "0", + "history": "7d", + "value_type": "FLOAT", + "units": "B", + "description": "Number of bytes written to the InnoDB log.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Innodb_os_log_written']/field[@name='Value']/text()" + ] + } + ], + "master_item": { + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "system" + } + ] + }, + { + "uuid": "3811018fdfaf4d92a5b8ff5d631d0047", + "name": "MySQL: InnoDB row lock time", + "type": "DEPENDENT", + "key": "mysql.innodb_row_lock_time", + "delay": "0", + "history": "7d", + "value_type": "FLOAT", + "units": "s", + "description": "The total time spent in acquiring row locks for InnoDB tables, in milliseconds.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Innodb_row_lock_time']/field[@name='Value']/text()" + ] + }, + { + "type": "MULTIPLIER", + "parameters": [ + "0.001" + ] + }, + { + "type": "DISCARD_UNCHANGED_HEARTBEAT", + "parameters": [ + "1h" + ] + } + ], + "master_item": { + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "innodb" + }, + { + "tag": "component", + "value": "tables" + } + ] + }, + { + "uuid": "579c1ad7680349a3b6a25dd12322fc14", + "name": "MySQL: InnoDB row lock time max", + "type": "DEPENDENT", + "key": "mysql.innodb_row_lock_time_max", + "delay": "0", + "history": "7d", + "value_type": "FLOAT", + "units": "s", + "description": "The maximum time to acquire a row lock for InnoDB tables, in milliseconds.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Innodb_row_lock_time_max']/field[@name='Value']/text()" + ] + }, + { + "type": "MULTIPLIER", + "parameters": [ + "0.001" + ] + }, + { + "type": "DISCARD_UNCHANGED_HEARTBEAT", + "parameters": [ + "1h" + ] + } + ], + "master_item": { + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "innodb" + }, + { + "tag": "component", + "value": "tables" + } + ] + }, + { + "uuid": "a4618dd9ed1d4ff19f34bc82f41dbbbb", + "name": "MySQL: InnoDB row lock waits", + "type": "DEPENDENT", + "key": "mysql.innodb_row_lock_waits", + "delay": "0", + "history": "7d", + "description": "Number of times operations on InnoDB tables had to wait for a row lock.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Innodb_row_lock_waits']/field[@name='Value']/text()" + ] + } + ], + "master_item": { + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "innodb" + }, + { + "tag": "component", + "value": "tables" + } + ] + }, + { + "uuid": "e207dc3c0fe84928a36e643594d8cee5", + "name": "MySQL: Max used connections", + "type": "DEPENDENT", + "key": "mysql.max_used_connections", + "delay": "0", + "history": "7d", + "description": "The maximum number of connections that have been in use simultaneously since the server start.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Max_used_connections']/field[@name='Value']/text()" + ] + }, + { + "type": "DISCARD_UNCHANGED_HEARTBEAT", + "parameters": [ + "1h" + ] + } + ], + "master_item": { + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "connections" + } + ] + }, + { + "uuid": "3dd5ffb7c1cc45a487c5c7cabfa90ca6", + "name": "MySQL: Open tables", + "type": "DEPENDENT", + "key": "mysql.open_tables", + "delay": "0", + "history": "7d", + "value_type": "FLOAT", + "description": "Number of tables that are open.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Open_tables']/field[@name='Value']/text()" + ] + }, + { + "type": "DISCARD_UNCHANGED_HEARTBEAT", + "parameters": [ + "6h" + ] + } + ], + "master_item": { + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "tables" + } + ] + }, + { + "uuid": "fe572969a6754248b10a35a5c0afedf3", + "name": "MySQL: Open table definitions", + "type": "DEPENDENT", + "key": "mysql.open_table_definitions", + "delay": "0", + "history": "7d", + "value_type": "FLOAT", + "description": "Number of cached table definitions.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Open_table_definitions']/field[@name='Value']/text()" + ] + }, + { + "type": "DISCARD_UNCHANGED_HEARTBEAT", + "parameters": [ + "6h" + ] + } + ], + "master_item": { + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "tables" + } + ] + }, + { + "uuid": "41cd6c8c535948f3bde6324e0912f1a8", + "name": "MySQL: Status", + "key": "mysql.ping[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]", + "history": "7d", + "valuemap": { + "name": "Service state" + }, + "preprocessing": [ + { + "type": "JAVASCRIPT", + "parameters": [ + "return value.indexOf('is alive') !== -1 ? 1 : 0;" + ] + }, + { + "type": "DISCARD_UNCHANGED_HEARTBEAT", + "parameters": [ + "10m" + ] + } + ], + "tags": [ + { + "tag": "component", + "value": "application" + }, + { + "tag": "component", + "value": "health" + } + ], + "triggers": [ + { + "uuid": "e78f07e3e507461f8fe33a31b1bc4eb9", + "expression": "last(/MySQL by Zabbix agent/mysql.ping[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"])=0", + "name": "MySQL: Service is down", + "priority": "HIGH", + "tags": [ + { + "tag": "scope", + "value": "availability" + } + ] + } + ] + }, + { + "uuid": "c11b8c8ec3e843cea63f6cc1d8309ccd", + "name": "MySQL: Queries per second", + "type": "DEPENDENT", + "key": "mysql.queries.rate", + "delay": "0", + "history": "7d", + "value_type": "FLOAT", + "description": "Number of statements executed by the server. This variable includes statements executed within stored programs, unlike the Questions variable.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Queries']/field[@name='Value']/text()" + ] + }, + { + "type": "CHANGE_PER_SECOND", + "parameters": [ + "" + ] + } + ], + "master_item": { + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "queries" + } + ] + }, + { + "uuid": "cd7c5c4e262f4a73975d46d06ed903f9", + "name": "MySQL: Questions per second", + "type": "DEPENDENT", + "key": "mysql.questions.rate", + "delay": "0", + "history": "7d", + "value_type": "FLOAT", + "description": "Number of statements executed by the server. This includes only statements sent to the server by clients and not statements executed within stored programs, unlike the Queries variable.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Questions']/field[@name='Value']/text()" + ] + }, + { + "type": "CHANGE_PER_SECOND", + "parameters": [ + "" + ] + } + ], + "master_item": { + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "queries" + } + ] + }, + { + "uuid": "a1cfc616f23648e9946f408c7146df0a", + "name": "MySQL: Slow queries per second", + "type": "DEPENDENT", + "key": "mysql.slow_queries.rate", + "delay": "0", + "history": "7d", + "value_type": "FLOAT", + "description": "Number of queries that have taken more than long_query_time seconds.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Slow_queries']/field[@name='Value']/text()" + ] + }, + { + "type": "CHANGE_PER_SECOND", + "parameters": [ + "" + ] + } + ], + "master_item": { + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "queries" + } + ], + "triggers": [ + { + "uuid": "113509b7a7b54a108c1c63346a52bbf2", + "expression": "min(/MySQL by Zabbix agent/mysql.slow_queries.rate,5m)>{$MYSQL.SLOW_QUERIES.MAX.WARN}", + "name": "MySQL: Server has slow queries", + "event_name": "MySQL: Server has slow queries (over {$MYSQL.SLOW_QUERIES.MAX.WARN} for 5m)", + "priority": "WARNING", + "description": "The number of slow queries is more than {$MYSQL.SLOW_QUERIES.MAX.WARN} in the last 5 minutes.", + "tags": [ + { + "tag": "scope", + "value": "performance" + } + ] + } + ] + }, + { + "uuid": "a9ce1d75a97d4740876fad7b5d569211", + "name": "MySQL: Threads cached", + "type": "DEPENDENT", + "key": "mysql.threads_cached", + "delay": "0", + "history": "7d", + "description": "Number of threads in the thread cache.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Threads_cached']/field[@name='Value']/text()" + ] + } + ], + "master_item": { + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "threads" + } + ] + }, + { + "uuid": "a0079f5ffbdc40cc89b35a8b6170c32b", + "name": "MySQL: Threads connected", + "type": "DEPENDENT", + "key": "mysql.threads_connected", + "delay": "0", + "history": "7d", + "description": "Number of currently open connections.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Threads_connected']/field[@name='Value']/text()" + ] + } + ], + "master_item": { + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "threads" + } + ] + }, + { + "uuid": "06976fcb42ab4a33b0056a864ecd31e7", + "name": "MySQL: Threads created per second", + "type": "DEPENDENT", + "key": "mysql.threads_created.rate", + "delay": "0", + "history": "7d", + "value_type": "FLOAT", + "description": "Number of threads created to handle connections. If Threads_created is big, you may want to increase the thread_cache_size value. The cache miss rate can be calculated as Threads_created/Connections.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Threads_created']/field[@name='Value']/text()" + ] + }, + { + "type": "CHANGE_PER_SECOND", + "parameters": [ + "" + ] + } + ], + "master_item": { + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "threads" + } + ] + }, + { + "uuid": "255c00a984ba462e84ba46a7430f21c9", + "name": "MySQL: Threads running", + "type": "DEPENDENT", + "key": "mysql.threads_running", + "delay": "0", + "history": "7d", + "description": "Number of threads which are not sleeping.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Threads_running']/field[@name='Value']/text()" + ] + } + ], + "master_item": { + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "threads" + } + ] + }, + { + "uuid": "6ffa704603014f0f9f765590955fb01c", + "name": "MySQL: Uptime", + "type": "DEPENDENT", + "key": "mysql.uptime", + "delay": "0", + "history": "7d", + "units": "uptime", + "description": "The amount of seconds that the server has been up.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Uptime']/field[@name='Value']/text()" + ] + } + ], + "master_item": { + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "application" + } + ], + "triggers": [ + { + "uuid": "d3c80c770355464fb5a6be0357d0edca", + "expression": "nodata(/MySQL by Zabbix agent/mysql.uptime,30m)=1", + "name": "MySQL: Failed to fetch info data", + "event_name": "MySQL: Failed to fetch info data (or no data for 30m)", + "priority": "INFO", + "description": "Zabbix has not received data for items for the last 30 minutes.", + "dependencies": [ + { + "name": "MySQL: Service is down", + "expression": "last(/MySQL by Zabbix agent/mysql.ping[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"])=0" + } + ], + "tags": [ + { + "tag": "scope", + "value": "availability" + } + ] + }, + { + "uuid": "f02f51c764934cf394c5ad3f9c4e70d2", + "expression": "last(/MySQL by Zabbix agent/mysql.uptime)<10m", + "name": "MySQL: Service has been restarted", + "event_name": "MySQL: Service has been restarted (uptime < 10m)", + "priority": "INFO", + "description": "MySQL uptime is less than 10 minutes.", + "tags": [ + { + "tag": "scope", + "value": "notice" + } + ] + } + ] + }, + { + "uuid": "a5d0f152c3ef4e069c3d5a6a5a9470fe", + "name": "MySQL: Version", + "key": "mysql.version[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]", + "delay": "15m", + "history": "7d", + "trends": "0", + "value_type": "CHAR", + "preprocessing": [ + { + "type": "REGEX", + "parameters": [ + "(Server version)\\s+(.+)", + "\\2" + ] + }, + { + "type": "DISCARD_UNCHANGED_HEARTBEAT", + "parameters": [ + "1d" + ] + } + ], + "tags": [ + { + "tag": "component", + "value": "application" + } + ], + "triggers": [ + { + "uuid": "7eab3a7337904ad1b2061d209371543b", + "expression": "last(/MySQL by Zabbix agent/mysql.version[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"],#1)<>last(/MySQL by Zabbix agent/mysql.version[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"],#2) and length(last(/MySQL by Zabbix agent/mysql.version[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]))>0", + "name": "MySQL: Version has changed", + "event_name": "MySQL: Version has changed (new version value received: {ITEM.VALUE})", + "priority": "INFO", + "description": "MySQL version has changed. Ack to close.", + "manual_close": "YES", + "tags": [ + { + "tag": "scope", + "value": "notice" + } + ] + } + ] + } + ], + "discovery_rules": [ + { + "uuid": "8ceb226f000d48f099ee6e128ad551b5", + "name": "Database discovery", + "key": "mysql.db.discovery[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]", + "delay": "1h", + "filter": { + "conditions": [ + { + "macro": "{#DBNAME}", + "value": "information_schema", + "operator": "NOT_MATCHES_REGEX", + "formulaid": "A" + } + ] + }, + "description": "Scanning databases in DBMS.", + "item_prototypes": [ + { + "uuid": "dda45077011d4f8fa5c25b1f351179ca", + "name": "MySQL: Size of database {#DBNAME}", + "key": "mysql.dbsize[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\",\"{#DBNAME}\"]", + "delay": "5m", + "history": "7d", + "units": "B", + "preprocessing": [ + { + "type": "DISCARD_UNCHANGED_HEARTBEAT", + "parameters": [ + "1h" + ] + } + ], + "tags": [ + { + "tag": "component", + "value": "storage" + }, + { + "tag": "database", + "value": "{#DBNAME}" + } + ] + } + ], + "preprocessing": [ + { + "type": "JAVASCRIPT", + "parameters": [ + "return JSON.stringify(value.split(\"\\n\").map(function (name) {\n return ({\"{#DBNAME}\": name});\n}));" + ] + }, + { + "type": "DISCARD_UNCHANGED_HEARTBEAT", + "parameters": [ + "1d" + ] + } + ] + }, + { + "uuid": "bc28468760e14d069ef7b47858846a50", + "name": "MariaDB discovery", + "type": "DEPENDENT", + "key": "mysql.extra_metric.discovery", + "delay": "0", + "description": "Additional metrics if MariaDB is used.", + "item_prototypes": [ + { + "uuid": "7743cdbaf71c491189ac1a927409e998", + "name": "MySQL: Binlog commits", + "type": "DEPENDENT", + "key": "mysql.binlog_commits[{#SINGLETON}]", + "delay": "0", + "history": "7d", + "value_type": "FLOAT", + "description": "Total number of transactions committed to the binary log.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Binlog_commits']/field[@name='Value']/text()" + ] + } + ], + "master_item": { + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "transactions" + } + ] + }, + { + "uuid": "c897f8f0fb1c4e409dd95305fd221e01", + "name": "MySQL: Binlog group commits", + "type": "DEPENDENT", + "key": "mysql.binlog_group_commits[{#SINGLETON}]", + "delay": "0", + "history": "7d", + "value_type": "FLOAT", + "description": "Total number of group commits done to the binary log.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Binlog_group_commits']/field[@name='Value']/text()" + ] + } + ], + "master_item": { + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "transactions" + } + ] + }, + { + "uuid": "749e72ebd1014f7faee352e23ac3dfdd", + "name": "MySQL: Master GTID wait count", + "type": "DEPENDENT", + "key": "mysql.master_gtid_wait_count[{#SINGLETON}]", + "delay": "0", + "history": "7d", + "value_type": "FLOAT", + "description": "The number of times MASTER_GTID_WAIT called.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Master_gtid_wait_count']/field[@name='Value']/text()" + ] + }, + { + "type": "DISCARD_UNCHANGED_HEARTBEAT", + "parameters": [ + "6h" + ] + } + ], + "master_item": { + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "transactions" + } + ] + }, + { + "uuid": "4a4537b0db5b43119af910d0ba421035", + "name": "MySQL: Master GTID wait timeouts", + "type": "DEPENDENT", + "key": "mysql.master_gtid_wait_timeouts[{#SINGLETON}]", + "delay": "0", + "history": "7d", + "value_type": "FLOAT", + "description": "Number of timeouts occurring in MASTER_GTID_WAIT.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Master_gtid_wait_timeouts']/field[@name='Value']/text()" + ] + }, + { + "type": "DISCARD_UNCHANGED_HEARTBEAT", + "parameters": [ + "6h" + ] + } + ], + "master_item": { + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "transactions" + } + ] + }, + { + "uuid": "c1e95abc88cf486a9226bf760254f797", + "name": "MySQL: Master GTID wait time", + "type": "DEPENDENT", + "key": "mysql.master_gtid_wait_time[{#SINGLETON}]", + "delay": "0", + "history": "7d", + "value_type": "FLOAT", + "description": "Total number of time spent in MASTER_GTID_WAIT.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Master_gtid_wait_time']/field[@name='Value']/text()" + ] + }, + { + "type": "DISCARD_UNCHANGED_HEARTBEAT", + "parameters": [ + "6h" + ] + } + ], + "master_item": { + "key": "mysql.get_status_variables[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "transactions" + } + ] + } + ], + "master_item": { + "key": "mysql.version[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]" + }, + "preprocessing": [ + { + "type": "JAVASCRIPT", + "parameters": [ + "return JSON.stringify(value.search('MariaDB')>-1 ? [{'{#SINGLETON}': ''}] : []);" + ] + } + ] + }, + { + "uuid": "aed60b7ae3794d0ba25ad82da12b8966", + "name": "Replication discovery", + "key": "mysql.replication.discovery[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\"]", + "delay": "1h", + "description": "If \"show slave status\" returns Master_Host, \"Replication: *\" items are created.", + "item_prototypes": [ + { + "uuid": "48555d71074f4cd4a61dca6187c8b29a", + "name": "MySQL: Replication Seconds Behind Master {#MASTERHOST}", + "type": "DEPENDENT", + "key": "mysql.seconds_behind_master[\"{#MASTERHOST}\"]", + "delay": "0", + "history": "7d", + "units": "s", + "description": "The number of seconds that the slave SQL thread is behind processing the master binary log.\nA high number (or an increasing one) can indicate that the slave is unable to handle events\nfrom the master in a timely fashion.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row/field[@name='Seconds_Behind_Master']/text()" + ] + }, + { + "type": "DISCARD_UNCHANGED_HEARTBEAT", + "parameters": [ + "1h" + ] + }, + { + "type": "NOT_MATCHES_REGEX", + "parameters": [ + "null" + ], + "error_handler": "CUSTOM_ERROR", + "error_handler_params": "Replication is not performed." + } + ], + "master_item": { + "key": "mysql.slave_status[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\",\"{#MASTERHOST}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "replication" + } + ], + "trigger_prototypes": [ + { + "uuid": "a5c91da088414d279f5ea3cd59093ce9", + "expression": "min(/MySQL by Zabbix agent/mysql.seconds_behind_master[\"{#MASTERHOST}\"],5m)>{$MYSQL.REPL_LAG.MAX.WARN}", + "name": "MySQL: Replication lag is too high", + "event_name": "MySQL: Replication lag is too high (over {$MYSQL.REPL_LAG.MAX.WARN} for 5m)", + "priority": "WARNING", + "tags": [ + { + "tag": "scope", + "value": "notice" + } + ] + } + ] + }, + { + "uuid": "1c075f4785604d92a33a868e213070d8", + "name": "MySQL: Replication Slave IO Running {#MASTERHOST}", + "type": "DEPENDENT", + "key": "mysql.slave_io_running[\"{#MASTERHOST}\"]", + "delay": "0", + "history": "7d", + "trends": "0", + "value_type": "CHAR", + "description": "Whether the I/O thread for reading the master's binary log is running.\nNormally, you want this to be Yes unless you have not yet started replication or have\nexplicitly stopped it with STOP SLAVE.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row/field[@name='Slave_IO_Running']/text()" + ] + }, + { + "type": "DISCARD_UNCHANGED_HEARTBEAT", + "parameters": [ + "1h" + ] + } + ], + "master_item": { + "key": "mysql.slave_status[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\",\"{#MASTERHOST}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "replication" + } + ], + "trigger_prototypes": [ + { + "uuid": "8ee45932311443cb906306b1d2c99b19", + "expression": "count(/MySQL by Zabbix agent/mysql.slave_io_running[\"{#MASTERHOST}\"],#1,\"ne\",\"Yes\")=1", + "name": "MySQL: The slave I/O thread is not connected to a replication master", + "priority": "WARNING", + "dependencies": [ + { + "name": "MySQL: The slave I/O thread is not running", + "expression": "count(/MySQL by Zabbix agent/mysql.slave_io_running[\"{#MASTERHOST}\"],#1,\"eq\",\"No\")=1" + } + ], + "tags": [ + { + "tag": "scope", + "value": "availability" + } + ] + }, + { + "uuid": "4c8ca45f26254d9a9a1c9248f1fa1537", + "expression": "count(/MySQL by Zabbix agent/mysql.slave_io_running[\"{#MASTERHOST}\"],#1,\"eq\",\"No\")=1", + "name": "MySQL: The slave I/O thread is not running", + "priority": "AVERAGE", + "description": "Whether the I/O thread for reading the master's binary log is running.", + "tags": [ + { + "tag": "scope", + "value": "notice" + } + ] + } + ] + }, + { + "uuid": "967c6fd13cc04562a9fea174bd90b8c4", + "name": "MySQL: Replication Slave SQL Running {#MASTERHOST}", + "type": "DEPENDENT", + "key": "mysql.slave_sql_running[\"{#MASTERHOST}\"]", + "delay": "0", + "history": "7d", + "trends": "0", + "value_type": "CHAR", + "description": "Whether the SQL thread for executing events in the relay log is running.\nAs with the I/O thread, this should normally be Yes.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row/field[@name='Slave_SQL_Running']/text()" + ] + }, + { + "type": "DISCARD_UNCHANGED_HEARTBEAT", + "parameters": [ + "1h" + ] + } + ], + "master_item": { + "key": "mysql.slave_status[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\",\"{#MASTERHOST}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "replication" + } + ], + "trigger_prototypes": [ + { + "uuid": "bd0d20c05e3b46b6a7c341e5d122208b", + "expression": "count(/MySQL by Zabbix agent/mysql.slave_sql_running[\"{#MASTERHOST}\"],#1,\"eq\",\"No\")=1", + "name": "MySQL: The SQL thread is not running", + "priority": "WARNING", + "description": "Whether the SQL thread for executing events in the relay log is running.", + "dependencies": [ + { + "name": "MySQL: The slave I/O thread is not running", + "expression": "count(/MySQL by Zabbix agent/mysql.slave_io_running[\"{#MASTERHOST}\"],#1,\"eq\",\"No\")=1" + } + ], + "tags": [ + { + "tag": "scope", + "value": "notice" + } + ] + } + ] + }, + { + "uuid": "27e807d840d4474484c2e1f896726b6b", + "name": "MySQL: Replication Slave SQL Running State {#MASTER_HOST}", + "type": "DEPENDENT", + "key": "mysql.slave_sql_running_state[\"{#MASTER_HOST}\"]", + "delay": "0", + "history": "7d", + "trends": "0", + "value_type": "TEXT", + "description": "This shows the state of the SQL driver threads.", + "preprocessing": [ + { + "type": "XMLPATH", + "parameters": [ + "/resultset/row[field/text()='Slave_SQL_Running_State']/field[@name='Value']/text()" + ] + }, + { + "type": "DISCARD_UNCHANGED_HEARTBEAT", + "parameters": [ + "6h" + ] + } + ], + "master_item": { + "key": "mysql.slave_status[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\",\"{#MASTERHOST}\"]" + }, + "tags": [ + { + "tag": "component", + "value": "replication" + } + ] + }, + { + "uuid": "d87c7c03e5884a43912f60ad91c3b46f", + "name": "MySQL: Replication Slave status {#MASTERHOST}", + "key": "mysql.slave_status[\"{$MYSQL.HOST}\",\"{$MYSQL.PORT}\",\"{#MASTERHOST}\"]", + "history": "0", + "trends": "0", + "value_type": "TEXT", + "description": "The item gets status information on the essential parameters of the slave threads.", + "tags": [ + { + "tag": "component", + "value": "raw" + } + ] + } + ], + "preprocessing": [ + { + "type": "JAVASCRIPT", + "parameters": [ + "var matches = value.match(/Master_Host.*>(.*)<.*/);\nif (matches) {\n return JSON.stringify([{\"{#MASTERHOST}\": matches[1]}]);\n}\n\nreturn '[]';" + ] + }, + { + "type": "DISCARD_UNCHANGED_HEARTBEAT", + "parameters": [ + "1d" + ] + } + ] + } + ], + "tags": [ + { + "tag": "class", + "value": "database" + }, + { + "tag": "target", + "value": "mysql" + } + ], + "macros": [ + { + "macro": "{$MYSQL.ABORTED_CONN.MAX.WARN}", + "value": "3", + "description": "The number of failed attempts to connect to the MySQL server for trigger expression." + }, + { + "macro": "{$MYSQL.BUFF_UTIL.MIN.WARN}", + "value": "50", + "description": "The minimum buffer pool utilization in percentage for trigger expression." + }, + { + "macro": "{$MYSQL.CREATED_TMP_DISK_TABLES.MAX.WARN}", + "value": "10", + "description": "The maximum number of created tmp tables on a disk per second for trigger expressions." + }, + { + "macro": "{$MYSQL.CREATED_TMP_FILES.MAX.WARN}", + "value": "10", + "description": "The maximum number of created tmp files on a disk per second for trigger expressions." + }, + { + "macro": "{$MYSQL.CREATED_TMP_TABLES.MAX.WARN}", + "value": "30", + "description": "The maximum number of created tmp tables in memory per second for trigger expressions." + }, + { + "macro": "{$MYSQL.HOST}", + "value": "127.0.0.1", + "description": "Hostname or IP of MySQL host or container." + }, + { + "macro": "{$MYSQL.INNODB_LOG_FILES}", + "value": "2", + "description": "Number of physical files in the InnoDB redo log for calculating innodb_log_file_size." + }, + { + "macro": "{$MYSQL.PORT}", + "value": "3306", + "description": "MySQL service port." + }, + { + "macro": "{$MYSQL.REPL_LAG.MAX.WARN}", + "value": "30m", + "description": "The lag of slave from master for trigger expression." + }, + { + "macro": "{$MYSQL.SLOW_QUERIES.MAX.WARN}", + "value": "3", + "description": "The number of slow queries for trigger expression." + } + ], + "dashboards": [ + { + "uuid": "ce2f9d7bb18e469f97e692baee02841d", + "name": "MySQL performance", + "pages": [ + { + "widgets": [ + { + "type": "graph", + "width": "12", + "height": "5", + "fields": [ + { + "type": "GRAPH", + "name": "graphid", + "value": { + "host": "MySQL by Zabbix agent", + "name": "MySQL: Operations" + } + }, + { + "type": "INTEGER", + "name": "source_type", + "value": "0" + } + ] + }, + { + "type": "graph", + "y": "5", + "width": "12", + "height": "5", + "fields": [ + { + "type": "GRAPH", + "name": "graphid", + "value": { + "host": "MySQL by Zabbix agent", + "name": "MySQL: Connections" + } + }, + { + "type": "INTEGER", + "name": "source_type", + "value": "0" + } + ] + }, + { + "type": "graph", + "y": "10", + "width": "12", + "height": "5", + "fields": [ + { + "type": "GRAPH", + "name": "graphid", + "value": { + "host": "MySQL by Zabbix agent", + "name": "MySQL: InnoDB buffer pool" + } + }, + { + "type": "INTEGER", + "name": "source_type", + "value": "0" + } + ] + }, + { + "type": "graph", + "x": "12", + "width": "12", + "height": "5", + "fields": [ + { + "type": "GRAPH", + "name": "graphid", + "value": { + "host": "MySQL by Zabbix agent", + "name": "MySQL: Queries" + } + }, + { + "type": "INTEGER", + "name": "source_type", + "value": "0" + } + ] + }, + { + "type": "graph", + "x": "12", + "y": "5", + "width": "12", + "height": "5", + "fields": [ + { + "type": "GRAPH", + "name": "graphid", + "value": { + "host": "MySQL by Zabbix agent", + "name": "MySQL: Bandwidth" + } + }, + { + "type": "INTEGER", + "name": "source_type", + "value": "0" + } + ] + }, + { + "type": "graph", + "x": "12", + "y": "10", + "width": "12", + "height": "5", + "fields": [ + { + "type": "GRAPH", + "name": "graphid", + "value": { + "host": "MySQL by Zabbix agent", + "name": "MySQL: Threads" + } + }, + { + "type": "INTEGER", + "name": "source_type", + "value": "0" + } + ] + } + ] + } + ] + } + ], + "valuemaps": [ + { + "uuid": "4f2d7ca3c89246c6b691557447230031", + "name": "Service state", + "mappings": [ + { + "value": "0", + "newvalue": "Down" + }, + { + "value": "1", + "newvalue": "Up" + } + ] + } + ] + } + ], + "graphs": [ + { + "uuid": "6ebb6f300b4a4ada80908ce11cae9e95", + "name": "MySQL: Bandwidth", + "graph_items": [ + { + "drawtype": "GRADIENT_LINE", + "color": "1A7C11", + "item": { + "host": "MySQL by Zabbix agent", + "key": "mysql.bytes_received.rate" + } + }, + { + "sortorder": "1", + "drawtype": "GRADIENT_LINE", + "color": "2774A4", + "item": { + "host": "MySQL by Zabbix agent", + "key": "mysql.bytes_sent.rate" + } + } + ] + }, + { + "uuid": "ea03bd4cc0f948f38ea638fe93f2ac69", + "name": "MySQL: Connections", + "graph_items": [ + { + "color": "1A7C11", + "item": { + "host": "MySQL by Zabbix agent", + "key": "mysql.aborted_clients.rate" + } + }, + { + "sortorder": "1", + "color": "2774A4", + "item": { + "host": "MySQL by Zabbix agent", + "key": "mysql.aborted_connects.rate" + } + }, + { + "sortorder": "2", + "color": "F63100", + "item": { + "host": "MySQL by Zabbix agent", + "key": "mysql.connections.rate" + } + }, + { + "sortorder": "3", + "color": "A54F10", + "item": { + "host": "MySQL by Zabbix agent", + "key": "mysql.max_used_connections" + } + } + ] + }, + { + "uuid": "ee3890503acf44c58fcfedf3c5008656", + "name": "MySQL: InnoDB buffer pool", + "graph_items": [ + { + "color": "1A7C11", + "item": { + "host": "MySQL by Zabbix agent", + "key": "mysql.innodb_buffer_pool_pages_free" + } + }, + { + "sortorder": "1", + "color": "2774A4", + "item": { + "host": "MySQL by Zabbix agent", + "key": "mysql.innodb_buffer_pool_pages_total" + } + }, + { + "sortorder": "2", + "color": "F63100", + "item": { + "host": "MySQL by Zabbix agent", + "key": "mysql.innodb_buffer_pool_read_requests.rate" + } + }, + { + "sortorder": "3", + "color": "A54F10", + "item": { + "host": "MySQL by Zabbix agent", + "key": "mysql.innodb_buffer_pool_reads.rate" + } + } + ] + }, + { + "uuid": "a6296310a0cf4ffcad7b119c5089ef1f", + "name": "MySQL: Operations", + "graph_items": [ + { + "color": "1A7C11", + "item": { + "host": "MySQL by Zabbix agent", + "key": "mysql.com_delete.rate" + } + }, + { + "sortorder": "1", + "color": "2774A4", + "item": { + "host": "MySQL by Zabbix agent", + "key": "mysql.com_insert.rate" + } + }, + { + "sortorder": "2", + "color": "F63100", + "item": { + "host": "MySQL by Zabbix agent", + "key": "mysql.com_select.rate" + } + }, + { + "sortorder": "3", + "color": "A54F10", + "item": { + "host": "MySQL by Zabbix agent", + "key": "mysql.com_update.rate" + } + } + ] + }, + { + "uuid": "ce723556c4974152a8eda029dbdad1bc", + "name": "MySQL: Queries", + "graph_items": [ + { + "color": "1A7C11", + "item": { + "host": "MySQL by Zabbix agent", + "key": "mysql.queries.rate" + } + }, + { + "sortorder": "1", + "color": "2774A4", + "item": { + "host": "MySQL by Zabbix agent", + "key": "mysql.questions.rate" + } + }, + { + "sortorder": "2", + "color": "F63100", + "item": { + "host": "MySQL by Zabbix agent", + "key": "mysql.slow_queries.rate" + } + } + ] + }, + { + "uuid": "e7653013a2d94596a89c93f5352220df", + "name": "MySQL: Threads", + "graph_items": [ + { + "color": "1A7C11", + "item": { + "host": "MySQL by Zabbix agent", + "key": "mysql.threads_cached" + } + }, + { + "sortorder": "1", + "color": "2774A4", + "item": { + "host": "MySQL by Zabbix agent", + "key": "mysql.threads_connected" + } + }, + { + "sortorder": "2", + "color": "F63100", + "item": { + "host": "MySQL by Zabbix agent", + "key": "mysql.threads_created.rate" + } + }, + { + "sortorder": "3", + "color": "A54F10", + "item": { + "host": "MySQL by Zabbix agent", + "key": "mysql.threads_running" + } + } + ] + } + ] + } +} \ No newline at end of file diff --git a/zabbix-templates/nextcloud-by-rcasystems.json b/zabbix-templates/nextcloud-by-rcasystems.json new file mode 100644 index 0000000..1c3c270 --- /dev/null +++ b/zabbix-templates/nextcloud-by-rcasystems.json @@ -0,0 +1,1404 @@ +{ + "zabbix_export": { + "version": "6.4", + "template_groups": [ + { + "uuid": "cf12023e2c3542409d7152bdbb8dcd2a", + "name": "Nextcloud Installation" + }, + { + "uuid": "a571c0d144b14fd4a87a9d9b2aa9fcd6", + "name": "Templates/Applications" + } + ], + "templates": [ + { + "uuid": "eddea30a51d94d56875d2dd78fab8120", + "template": "Nextcloud by RCA Systems", + "name": "Nextcloud by RCA Systems", + "description": "Nextcloud by RCA Systems", + "groups": [ + { + "name": "Nextcloud Installation" + }, + { + "name": "Templates/Applications" + } + ], + "items": [ + { + "uuid": "ca01b1ae4af04990b8ddcbb06482e5f3", + "name": "User Agent - Chrome browser", + "key": "apache2_user_agent_metric[Chrome_browser]", + "delay": "1d", + "description": "User Agent - Chrome browser - Last 24h" + }, + { + "uuid": "579e468d8ea74a05be501afefc0573bc", + "name": "User Agent - Desktop Client Linux", + "key": "apache2_user_agent_metric[Desktop_Client_Linux]", + "delay": "1d", + "description": "User Agent - Desktop Client Linux - Last 24h" + }, + { + "uuid": "87ac9ddd75f24d209d631ce1226402ea", + "name": "User Agent - Desktop Client Mac", + "key": "apache2_user_agent_metric[Desktop_Client_Mac]", + "delay": "1d", + "description": "User Agent - Desktop Client Mac - Last 24h" + }, + { + "uuid": "455b5838ca7248c98779e122232ec11a", + "name": "User Agent - Desktop Client Windows", + "key": "apache2_user_agent_metric[Desktop_Client_Windows]", + "delay": "1d", + "description": "User Agent - Desktop Client Windows - Last 24h" + }, + { + "uuid": "773a49e0bb9a44ee920510b4a73449d7", + "name": "User Agent - Edge browser", + "key": "apache2_user_agent_metric[Edge_browser]", + "delay": "1d", + "description": "User Agent - Edge browser - Last 24h" + }, + { + "uuid": "a8558f5b2dd64d0bb596c3057ff754ff", + "name": "User Agent - Firefox browser", + "key": "apache2_user_agent_metric[Firefox_browser]", + "delay": "1d", + "description": "User Agent - Firefox browser - Last 24h" + }, + { + "uuid": "62b0b00d10f6478e98775308849f9308", + "name": "User Agent - Nextcloud Talk Android", + "key": "apache2_user_agent_metric[Nextcloud_Talk_Android]", + "delay": "1d", + "description": "User Agent - Nextcloud Talk Android - Last 24h" + }, + { + "uuid": "7f9286df05da4fe6af8b44f247f730db", + "name": "User Agent - Nextcloud Talk iOS", + "key": "apache2_user_agent_metric[Nextcloud_Talk_iOS]", + "delay": "1d", + "description": "User Agent - Nextcloud Talk iOS - Last 24h" + }, + { + "uuid": "83b408e385af4de2982cba7eec7ab210", + "name": "User Agent - Safari browser", + "key": "apache2_user_agent_metric[Safari_browser]", + "delay": "1d", + "description": "User Agent - Safari browser - Last 24h" + }, + { + "uuid": "ded1a989412f41d7bbe37ec7c3e4cfc1", + "name": "Number of rows in oc_authtoken", + "key": "db_metric[oc_authtoken,nr_rows]", + "delay": "1h", + "description": "Number of rows in oc_authtoken" + }, + { + "uuid": "102d3ad883a2402286383a727a7c1fb8", + "name": "Size of oc_authtoken", + "key": "db_metric[oc_authtoken,size_kb]", + "delay": "1h", + "units": "bytes", + "description": "Size of oc_authtoken", + "preprocessing": [ + { + "type": "MULTIPLIER", + "parameters": [ + "1024" + ] + } + ] + }, + { + "uuid": "191cbeaa492242f2bfc45f77ae2dea79", + "name": "Number of rows in oc_circles_event", + "key": "db_metric[oc_circles_event,nr_rows]", + "delay": "1h", + "description": "Number of rows in oc_circles_event" + }, + { + "uuid": "2a77521231c9402fae51bdd4881d5f70", + "name": "Size of oc_circles_event", + "key": "db_metric[oc_circles_event,size_kb]", + "delay": "1h", + "units": "bytes", + "description": "Size of oc_circles_event", + "preprocessing": [ + { + "type": "MULTIPLIER", + "parameters": [ + "1024" + ] + } + ] + }, + { + "uuid": "4659d54d88f346aa9b81d4030c871341", + "name": "Number of rows in oc_comments", + "key": "db_metric[oc_comments,nr_rows]", + "delay": "1h", + "description": "Number of rows in oc_comments" + }, + { + "uuid": "631a34f6ee6b473b86058a61999dff34", + "name": "Size of oc_comments", + "key": "db_metric[oc_comments,size_kb]", + "delay": "1h", + "units": "bytes", + "description": "Size of oc_comments", + "preprocessing": [ + { + "type": "MULTIPLIER", + "parameters": [ + "1024" + ] + } + ] + }, + { + "uuid": "afd0e83623dd48608c5ece7b5e080977", + "name": "Number of rows in oc_filecache", + "key": "db_metric[oc_filecache,nr_rows]", + "delay": "1h" + }, + { + "uuid": "bb3cece762ef49c392571dfc60c63521", + "name": "Size of oc_filecache", + "key": "db_metric[oc_filecache,size_kb]", + "delay": "1h", + "units": "bytes", + "description": "Size of oc_filecache", + "preprocessing": [ + { + "type": "MULTIPLIER", + "parameters": [ + "1024" + ] + } + ] + }, + { + "uuid": "e469a3761190441c8b91f8317b16db72", + "name": "Number of rows in oc_share", + "key": "db_metric[oc_share,nr_rows]", + "delay": "1h", + "description": "Number of rows in oc_share" + }, + { + "uuid": "175935c88011467890419e45996404e2", + "name": "Size of oc_share", + "key": "db_metric[oc_share,size_kb]", + "delay": "1h", + "units": "bytes", + "description": "Size of oc_share", + "preprocessing": [ + { + "type": "MULTIPLIER", + "parameters": [ + "1024" + ] + } + ] + }, + { + "uuid": "8bfc17be6a414c5ca715e46ebca038f8", + "name": "Active Users (Last Hour)", + "key": "nc_metric[ocs.data.activeUsers.last1hour]", + "delay": "1h", + "description": "Active users in the last hour" + }, + { + "uuid": "280c9c2ea30f4f97b1167e7d07cb7c0f", + "name": "Active Users (Last 5 Minutes)", + "key": "nc_metric[ocs.data.activeUsers.last5minutes]", + "delay": "5m", + "description": "Active users in the last 5 minutes" + }, + { + "uuid": "cae212b94b404cb1b816825839a6643e", + "name": "Active Users (Last 24 Hours)", + "key": "nc_metric[ocs.data.activeUsers.last24hours]", + "delay": "1d", + "description": "Active users in the last 24 hours" + }, + { + "uuid": "dd6ca0d93db54819811a7d07d5c06981", + "name": "Number of Shares", + "key": "nc_metric[ocs.data.nextcloud.shares.num_shares]", + "description": "Total number of shares" + }, + { + "uuid": "4f732d5bcc504eed92b6402cfd2e4e06", + "name": "Number of Group Shares", + "key": "nc_metric[ocs.data.nextcloud.shares.num_shares_groups]", + "delay": "1h", + "description": "Number of shares (group)" + }, + { + "uuid": "66db9033e1a34bfba2fd81575bab9544", + "name": "Number of Shares by Link", + "key": "nc_metric[ocs.data.nextcloud.shares.num_shares_link]", + "delay": "1h", + "description": "Number of shares (link)" + }, + { + "uuid": "415b19a45d5c47d6835bc2dbdcfe4c51", + "name": "Number of Shares by Email", + "key": "nc_metric[ocs.data.nextcloud.shares.num_shares_mail]", + "delay": "1h", + "description": "Number of shares (mail)" + }, + { + "uuid": "c60c6369bda4415e924d49211f9e79f6", + "name": "Number of Shares in Talk Room", + "key": "nc_metric[ocs.data.nextcloud.shares.num_shares_room]", + "delay": "1h", + "description": "Number of shares (room)" + }, + { + "uuid": "648dff6d0c594164b1fdd2635e3c1d9c", + "name": "Number of Shares with user", + "key": "nc_metric[ocs.data.nextcloud.shares.num_shares_user]", + "delay": "1h", + "description": "Number of Shares (User)" + }, + { + "uuid": "169a4440fd86493e97dc15821a89458c", + "name": "Number of Files", + "key": "nc_metric[ocs.data.nextcloud.storage.num_files]", + "delay": "1h", + "description": "Total number of files" + }, + { + "uuid": "2e7c235636db40dc9299854cfb8170c6", + "name": "Number of Storage Areas", + "key": "nc_metric[ocs.data.nextcloud.storage.num_storages]", + "delay": "1h", + "description": "Number of Storages" + }, + { + "uuid": "4948262dfc4645a7bd0b71d2ba62477f", + "name": "Number of Storage Homes", + "key": "nc_metric[ocs.data.nextcloud.storage.num_storages_home]", + "delay": "1h", + "description": "Number of Storages (Home)" + }, + { + "uuid": "4b1f627d3d404a839c15e68aa6fad8eb", + "name": "Number of Local Storage Areas", + "key": "nc_metric[ocs.data.nextcloud.storage.num_storages_local]", + "delay": "1h", + "description": "Number of Storages (Local)" + }, + { + "uuid": "538fa8eb57d744b9a9bf021b69383d80", + "name": "Number of External Storage Areas", + "key": "nc_metric[ocs.data.nextcloud.storage.num_storages_other]", + "delay": "1h", + "description": "Number of Storages (Other)" + }, + { + "uuid": "cca6fc0764e542afa65c3296311be7bc", + "name": "Number of Installed Applications", + "key": "nc_metric[ocs.data.nextcloud.system.apps.num_installed]", + "delay": "1d", + "description": "Number of installed applications" + }, + { + "uuid": "30b554fb5c2845439e3486b6a0927c1a", + "name": "Database Size", + "key": "nc_metric[ocs.data.server.database.size]", + "delay": "24h", + "description": "Database Size (in bytes)" + }, + { + "uuid": "209893b4f7764f45a26afcf055dbd5cd", + "name": "Database", + "key": "nc_metric[ocs.data.server.database.type]", + "delay": "1d", + "trends": "0", + "value_type": "TEXT", + "description": "Database Type" + }, + { + "uuid": "f8b1b78f1ed7472ba73e5bdb031577a2", + "name": "Database Version", + "key": "nc_metric[ocs.data.server.database.version]", + "delay": "1d", + "trends": "0", + "value_type": "TEXT", + "description": "Database Version" + }, + { + "uuid": "93f98339a7004028a3bbc4dff71e4e0e", + "name": "Data Directory Size", + "key": "storage_metric[total_size]", + "delay": "10m", + "units": "bytes", + "description": "Nextcloud data directory storage size", + "preprocessing": [ + { + "type": "MULTIPLIER", + "parameters": [ + "1024" + ] + } + ] + }, + { + "uuid": "2cc43d1dbefd4a109ec8406e2899654b", + "name": "Data Directory Size (GB)", + "key": "storage_metric[total_size_gb]", + "delay": "10m", + "trends": "0", + "value_type": "TEXT", + "description": "Nextcloud data directory storage size (in Gigabytes)" + } + ], + "dashboards": [ + { + "uuid": "e7808bdb7dc64e23a3d5e8edd8ac4e59", + "name": "Nextcloud Dashboard", + "pages": [ + { + "widgets": [ + { + "type": "item", + "name": "Total Number of Shares", + "width": "4", + "height": "3", + "hide_header": "YES", + "fields": [ + { + "type": "INTEGER", + "name": "adv_conf", + "value": "1" + }, + { + "type": "INTEGER", + "name": "decimal_places", + "value": "0" + }, + { + "type": "STRING", + "name": "description", + "value": "Total Number of Shares" + }, + { + "type": "INTEGER", + "name": "desc_h_pos", + "value": "0" + }, + { + "type": "INTEGER", + "name": "desc_v_pos", + "value": "0" + }, + { + "type": "ITEM", + "name": "itemid", + "value": { + "host": "Nextcloud by RCA Systems", + "key": "nc_metric[ocs.data.nextcloud.shares.num_shares]" + } + }, + { + "type": "INTEGER", + "name": "show", + "value": "1" + }, + { + "type": "INTEGER", + "name": "show", + "value": "2" + }, + { + "type": "INTEGER", + "name": "show", + "value": "4" + } + ] + }, + { + "type": "graph", + "name": "Database Size", + "y": "3", + "width": "12", + "height": "5", + "fields": [ + { + "type": "GRAPH", + "name": "graphid", + "value": { + "host": "Nextcloud by RCA Systems", + "name": "Database size" + } + } + ] + }, + { + "type": "graph", + "name": "Active Users", + "y": "8", + "width": "12", + "height": "5", + "fields": [ + { + "type": "GRAPH", + "name": "graphid", + "value": { + "host": "Nextcloud by RCA Systems", + "name": "Active users" + } + } + ] + }, + { + "type": "graph", + "y": "13", + "width": "12", + "height": "5", + "fields": [ + { + "type": "GRAPH", + "name": "graphid", + "value": { + "host": "Nextcloud by RCA Systems", + "name": "Total Storage in Data Directory" + } + } + ] + }, + { + "type": "graph", + "y": "18", + "width": "5", + "height": "5", + "fields": [ + { + "type": "GRAPH", + "name": "graphid", + "value": { + "host": "Nextcloud by RCA Systems", + "name": "User Agent - Last Natural Day" + } + } + ] + }, + { + "type": "graph", + "y": "23", + "width": "12", + "height": "5", + "fields": [ + { + "type": "GRAPH", + "name": "graphid", + "value": { + "host": "Nextcloud by RCA Systems", + "name": "Size of Largest Database Tables" + } + } + ] + }, + { + "type": "item", + "name": "Total Number of Files", + "x": "4", + "width": "4", + "height": "3", + "hide_header": "YES", + "fields": [ + { + "type": "INTEGER", + "name": "adv_conf", + "value": "1" + }, + { + "type": "INTEGER", + "name": "decimal_places", + "value": "0" + }, + { + "type": "STRING", + "name": "description", + "value": "Total Number of Files (including previews and folders)" + }, + { + "type": "INTEGER", + "name": "desc_h_pos", + "value": "0" + }, + { + "type": "INTEGER", + "name": "desc_v_pos", + "value": "0" + }, + { + "type": "ITEM", + "name": "itemid", + "value": { + "host": "Nextcloud by RCA Systems", + "key": "nc_metric[ocs.data.nextcloud.storage.num_files]" + } + }, + { + "type": "INTEGER", + "name": "show", + "value": "1" + }, + { + "type": "INTEGER", + "name": "show", + "value": "2" + }, + { + "type": "INTEGER", + "name": "show", + "value": "4" + } + ] + }, + { + "type": "graph", + "name": "User Agent - Average per Natural Day", + "x": "5", + "y": "18", + "width": "7", + "height": "5", + "fields": [ + { + "type": "GRAPH", + "name": "graphid", + "value": { + "host": "Nextcloud by RCA Systems", + "name": "User Agent - Average per Natural Day" + } + } + ] + }, + { + "type": "item", + "name": "Total Storage in Data Directory", + "x": "8", + "width": "4", + "height": "3", + "hide_header": "YES", + "fields": [ + { + "type": "INTEGER", + "name": "adv_conf", + "value": "1" + }, + { + "type": "INTEGER", + "name": "decimal_places", + "value": "0" + }, + { + "type": "STRING", + "name": "description", + "value": "Total Storage in Data Directory" + }, + { + "type": "INTEGER", + "name": "desc_h_pos", + "value": "0" + }, + { + "type": "INTEGER", + "name": "desc_v_pos", + "value": "0" + }, + { + "type": "ITEM", + "name": "itemid", + "value": { + "host": "Nextcloud by RCA Systems", + "key": "storage_metric[total_size_gb]" + } + }, + { + "type": "INTEGER", + "name": "show", + "value": "1" + }, + { + "type": "INTEGER", + "name": "show", + "value": "2" + }, + { + "type": "INTEGER", + "name": "show", + "value": "4" + }, + { + "type": "INTEGER", + "name": "units_bold", + "value": "0" + }, + { + "type": "INTEGER", + "name": "units_show", + "value": "0" + } + ] + }, + { + "type": "graph", + "name": "Number of Files", + "x": "12", + "y": "3", + "width": "12", + "height": "5", + "fields": [ + { + "type": "GRAPH", + "name": "graphid", + "value": { + "host": "Nextcloud by RCA Systems", + "name": "Number of Files" + } + } + ] + }, + { + "type": "graph", + "name": "Number of Shares (by type)", + "x": "12", + "y": "8", + "width": "4", + "height": "5", + "fields": [ + { + "type": "GRAPH", + "name": "graphid", + "value": { + "host": "Nextcloud by RCA Systems", + "name": "Number of Shares (by Type)" + } + } + ] + }, + { + "type": "graph", + "x": "12", + "y": "13", + "width": "12", + "height": "5", + "fields": [ + { + "type": "GRAPH", + "name": "graphid", + "value": { + "host": "Nextcloud by RCA Systems", + "name": "Number of Storage Areas" + } + } + ] + }, + { + "type": "graph", + "x": "12", + "y": "18", + "width": "12", + "height": "5", + "fields": [ + { + "type": "GRAPH", + "name": "graphid", + "value": { + "host": "Nextcloud by RCA Systems", + "name": "Number of Rows of Largest Database Tables" + } + } + ] + }, + { + "type": "graph", + "x": "16", + "y": "8", + "width": "4", + "height": "5", + "fields": [ + { + "type": "GRAPH", + "name": "graphid", + "value": { + "host": "Nextcloud by RCA Systems", + "name": "Number of Shares (by Type) - Last Value - Pie Chart" + } + } + ] + }, + { + "type": "clock", + "name": "clock", + "x": "18", + "width": "6", + "height": "3", + "hide_header": "YES", + "fields": [ + { + "type": "INTEGER", + "name": "adv_conf", + "value": "1" + }, + { + "type": "INTEGER", + "name": "clock_type", + "value": "1" + }, + { + "type": "INTEGER", + "name": "show", + "value": "1" + }, + { + "type": "INTEGER", + "name": "show", + "value": "2" + }, + { + "type": "INTEGER", + "name": "show", + "value": "3" + }, + { + "type": "INTEGER", + "name": "tzone_format", + "value": "1" + } + ] + }, + { + "type": "graph", + "name": "Number of Shares (by Type) - Average Value - Pie Chart", + "x": "20", + "y": "8", + "width": "4", + "height": "5", + "fields": [ + { + "type": "GRAPH", + "name": "graphid", + "value": { + "host": "Nextcloud by RCA Systems", + "name": "Number of Shares (by Type) - Average Value - Pie Chart" + } + } + ] + } + ] + } + ] + } + ] + } + ], + "graphs": [ + { + "uuid": "20779ff8bc3346fe8b9af74240d515d3", + "name": "Active users", + "graph_items": [ + { + "color": "1A7C11", + "calc_fnc": "ALL", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "nc_metric[ocs.data.activeUsers.last1hour]" + } + }, + { + "sortorder": "1", + "color": "274482", + "calc_fnc": "ALL", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "nc_metric[ocs.data.activeUsers.last5minutes]" + } + }, + { + "sortorder": "2", + "color": "F63100", + "calc_fnc": "ALL", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "nc_metric[ocs.data.activeUsers.last24hours]" + } + } + ] + }, + { + "uuid": "00e76bf39d854e09bd19bb3dea9f616f", + "name": "Active users in the last 5 minutes", + "graph_items": [ + { + "color": "1A7C11", + "calc_fnc": "ALL", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "nc_metric[ocs.data.activeUsers.last5minutes]" + } + } + ] + }, + { + "uuid": "ed6d0e653d4a43ecbc06c393c0c396d8", + "name": "Active users in the last 24 hours", + "graph_items": [ + { + "color": "1A7C11", + "calc_fnc": "ALL", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "nc_metric[ocs.data.activeUsers.last24hours]" + } + } + ] + }, + { + "uuid": "287f84b0347a42179c137019e4f9f6e5", + "name": "Active users in the last hour", + "graph_items": [ + { + "color": "1A7C11", + "calc_fnc": "ALL", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "nc_metric[ocs.data.activeUsers.last1hour]" + } + } + ] + }, + { + "uuid": "4c5580f5314a4ad58e327f7d47ca4301", + "name": "Database size", + "graph_items": [ + { + "color": "1A7C11", + "calc_fnc": "ALL", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "nc_metric[ocs.data.server.database.size]" + } + } + ] + }, + { + "uuid": "015188c05e794bf08643394ab9fa7e53", + "name": "Number of Files", + "graph_items": [ + { + "color": "1A7C11", + "calc_fnc": "ALL", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "nc_metric[ocs.data.nextcloud.storage.num_files]" + } + } + ] + }, + { + "uuid": "5808ab16e1b445b0b3910e13f1be6e84", + "name": "Number of Rows of Largest Database Tables", + "graph_items": [ + { + "color": "1A7C11", + "calc_fnc": "ALL", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "db_metric[oc_authtoken,nr_rows]" + } + }, + { + "sortorder": "1", + "color": "274482", + "calc_fnc": "ALL", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "db_metric[oc_circles_event,nr_rows]" + } + }, + { + "sortorder": "2", + "color": "F63100", + "calc_fnc": "ALL", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "db_metric[oc_comments,nr_rows]" + } + }, + { + "sortorder": "3", + "color": "2774A4", + "calc_fnc": "ALL", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "db_metric[oc_filecache,nr_rows]" + } + }, + { + "sortorder": "4", + "color": "A54F10", + "calc_fnc": "ALL", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "db_metric[oc_share,nr_rows]" + } + } + ] + }, + { + "uuid": "ad1a59aeb6464aca86c7d7249752dcc1", + "name": "Number of Shares", + "graph_items": [ + { + "color": "1A7C11", + "calc_fnc": "ALL", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "nc_metric[ocs.data.nextcloud.shares.num_shares]" + } + } + ] + }, + { + "uuid": "0a408360b58246d1b74caedb3216b969", + "name": "Number of Shares (by Type)", + "graph_items": [ + { + "color": "274482", + "calc_fnc": "ALL", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "nc_metric[ocs.data.nextcloud.shares.num_shares_groups]" + } + }, + { + "sortorder": "1", + "color": "F63100", + "calc_fnc": "ALL", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "nc_metric[ocs.data.nextcloud.shares.num_shares_link]" + } + }, + { + "sortorder": "2", + "color": "2774A4", + "calc_fnc": "ALL", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "nc_metric[ocs.data.nextcloud.shares.num_shares_mail]" + } + }, + { + "sortorder": "3", + "color": "A54F10", + "calc_fnc": "ALL", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "nc_metric[ocs.data.nextcloud.shares.num_shares_room]" + } + }, + { + "sortorder": "4", + "color": "FC6EA3", + "calc_fnc": "ALL", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "nc_metric[ocs.data.nextcloud.shares.num_shares_user]" + } + } + ] + }, + { + "uuid": "0f40359cd9b6470d85c277015346ab27", + "name": "Number of Shares (by Type) - Average Value - Pie Chart", + "yaxismax": "0", + "show_work_period": "NO", + "show_triggers": "NO", + "type": "EXPLODED", + "show_3d": "YES", + "graph_items": [ + { + "color": "1A7C11", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "nc_metric[ocs.data.nextcloud.shares.num_shares_groups]" + } + }, + { + "sortorder": "1", + "color": "274482", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "nc_metric[ocs.data.nextcloud.shares.num_shares_link]" + } + }, + { + "sortorder": "2", + "color": "F63100", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "nc_metric[ocs.data.nextcloud.shares.num_shares_mail]" + } + }, + { + "sortorder": "3", + "color": "2774A4", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "nc_metric[ocs.data.nextcloud.shares.num_shares_room]" + } + }, + { + "sortorder": "4", + "color": "A54F10", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "nc_metric[ocs.data.nextcloud.shares.num_shares_user]" + } + } + ] + }, + { + "uuid": "d709c34ece094f8d815cd5d8169287aa", + "name": "Number of Shares (by Type) - Last Value - Pie Chart", + "yaxismax": "0", + "show_work_period": "NO", + "show_triggers": "NO", + "type": "EXPLODED", + "show_3d": "YES", + "graph_items": [ + { + "color": "1A7C11", + "calc_fnc": "LAST", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "nc_metric[ocs.data.nextcloud.shares.num_shares_groups]" + } + }, + { + "sortorder": "1", + "color": "274482", + "calc_fnc": "LAST", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "nc_metric[ocs.data.nextcloud.shares.num_shares_link]" + } + }, + { + "sortorder": "2", + "color": "F63100", + "calc_fnc": "LAST", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "nc_metric[ocs.data.nextcloud.shares.num_shares_mail]" + } + }, + { + "sortorder": "3", + "color": "2774A4", + "calc_fnc": "LAST", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "nc_metric[ocs.data.nextcloud.shares.num_shares_room]" + } + }, + { + "sortorder": "4", + "color": "A54F10", + "calc_fnc": "LAST", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "nc_metric[ocs.data.nextcloud.shares.num_shares_user]" + } + } + ] + }, + { + "uuid": "628b4299c4a9492682f76dd9747da276", + "name": "Number of Storage Areas", + "graph_items": [ + { + "color": "1A7C11", + "calc_fnc": "ALL", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "nc_metric[ocs.data.nextcloud.storage.num_storages]" + } + }, + { + "sortorder": "1", + "color": "274482", + "calc_fnc": "ALL", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "nc_metric[ocs.data.nextcloud.storage.num_storages_home]" + } + }, + { + "sortorder": "2", + "color": "F63100", + "calc_fnc": "ALL", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "nc_metric[ocs.data.nextcloud.storage.num_storages_local]" + } + }, + { + "sortorder": "3", + "color": "2774A4", + "calc_fnc": "ALL", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "nc_metric[ocs.data.nextcloud.storage.num_storages_other]" + } + } + ] + }, + { + "uuid": "06ae4a6f7de141538d3432a9c1a60935", + "name": "Size of Largest Database Tables", + "graph_items": [ + { + "color": "1A7C11", + "calc_fnc": "ALL", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "db_metric[oc_authtoken,size_kb]" + } + }, + { + "sortorder": "1", + "color": "274482", + "calc_fnc": "ALL", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "db_metric[oc_circles_event,size_kb]" + } + }, + { + "sortorder": "2", + "color": "F63100", + "calc_fnc": "ALL", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "db_metric[oc_comments,size_kb]" + } + }, + { + "sortorder": "3", + "color": "2774A4", + "calc_fnc": "ALL", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "db_metric[oc_filecache,size_kb]" + } + }, + { + "sortorder": "4", + "color": "A54F10", + "calc_fnc": "ALL", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "db_metric[oc_share,size_kb]" + } + } + ] + }, + { + "uuid": "c95d504d0c43436698723d96f5c698d1", + "name": "Total Storage in Data Directory", + "graph_items": [ + { + "color": "1A7C11", + "calc_fnc": "ALL", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "storage_metric[total_size]" + } + } + ] + }, + { + "uuid": "51561be9b54e4c629a461f851f7e5464", + "name": "User Agent - Average per Natural Day", + "yaxismax": "0", + "show_work_period": "NO", + "show_triggers": "NO", + "type": "PIE", + "show_3d": "YES", + "graph_items": [ + { + "color": "1A7C11", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "apache2_user_agent_metric[Chrome_browser]" + } + }, + { + "sortorder": "1", + "color": "274482", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "apache2_user_agent_metric[Desktop_Client_Linux]" + } + }, + { + "sortorder": "2", + "color": "F63100", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "apache2_user_agent_metric[Desktop_Client_Mac]" + } + }, + { + "sortorder": "3", + "color": "2774A4", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "apache2_user_agent_metric[Desktop_Client_Windows]" + } + }, + { + "sortorder": "4", + "color": "A54F10", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "apache2_user_agent_metric[Edge_browser]" + } + }, + { + "sortorder": "5", + "color": "FC6EA3", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "apache2_user_agent_metric[Firefox_browser]" + } + }, + { + "sortorder": "6", + "color": "6C59DC", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "apache2_user_agent_metric[Nextcloud_Talk_Android]" + } + }, + { + "sortorder": "7", + "color": "AC8C14", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "apache2_user_agent_metric[Nextcloud_Talk_iOS]" + } + }, + { + "sortorder": "8", + "color": "611F27", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "apache2_user_agent_metric[Safari_browser]" + } + } + ] + }, + { + "uuid": "f99a3f8da4d24919a735fab0bdbc7014", + "name": "User Agent - Last Natural Day", + "yaxismax": "0", + "show_work_period": "NO", + "show_triggers": "NO", + "type": "PIE", + "graph_items": [ + { + "color": "1A7C11", + "calc_fnc": "LAST", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "apache2_user_agent_metric[Chrome_browser]" + } + }, + { + "sortorder": "1", + "color": "274482", + "calc_fnc": "LAST", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "apache2_user_agent_metric[Desktop_Client_Linux]" + } + }, + { + "sortorder": "2", + "color": "F63100", + "calc_fnc": "LAST", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "apache2_user_agent_metric[Desktop_Client_Mac]" + } + }, + { + "sortorder": "3", + "color": "2774A4", + "calc_fnc": "LAST", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "apache2_user_agent_metric[Desktop_Client_Windows]" + } + }, + { + "sortorder": "4", + "color": "A54F10", + "calc_fnc": "LAST", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "apache2_user_agent_metric[Edge_browser]" + } + }, + { + "sortorder": "5", + "color": "FC6EA3", + "calc_fnc": "LAST", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "apache2_user_agent_metric[Firefox_browser]" + } + }, + { + "sortorder": "6", + "color": "6C59DC", + "calc_fnc": "LAST", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "apache2_user_agent_metric[Nextcloud_Talk_Android]" + } + }, + { + "sortorder": "7", + "color": "AC8C14", + "calc_fnc": "LAST", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "apache2_user_agent_metric[Nextcloud_Talk_iOS]" + } + }, + { + "sortorder": "8", + "color": "611F27", + "calc_fnc": "LAST", + "item": { + "host": "Nextcloud by RCA Systems", + "key": "apache2_user_agent_metric[Safari_browser]" + } + } + ] + } + ] + } +} \ No newline at end of file diff --git a/zabbix_agentd.conf.d/lxd.conf b/zabbix_agentd.conf.d/lxd.conf new file mode 100644 index 0000000..d827126 --- /dev/null +++ b/zabbix_agentd.conf.d/lxd.conf @@ -0,0 +1,4 @@ +UserParameter=ct.memory.size[*],free -b | awk '$ 1 == "Mem:" {total=$ 2; used=($ 3+$ 5); pused=(($ 3+$ 5)*100/$ 2); free=$ 4; pfree=($ 4*100/$ 2); shared=$ 5; buffers=$ 6; cached=$ 6; available=$ 7; pavailable=($ 7*100/$ 2); if("$1" == "") {printf("%.0f", total )} else {printf("%.0f", $1 "" )} }' +UserParameter=ct.swap.size[*],free -b | awk '$ 1 == "Swap:" {total=$ 2; used=$ 3; free=$ 4; pfree=($ 4*100/$ 2); pused=($ 3*100/$ 2); if("$1" == "") {printf("%.0f", free )} else {printf("%.0f", $1 "" )} }' +UserParameter=ct.cpu.load[*],uptime | awk -F'[, ]+' '{avg1=$(NF-2); avg5=$(NF-1); avg15=$(NF)}{print $2/'$(nproc)'}' +UserParameter=ct.uptime,cut -d"." -f1 /proc/uptime diff --git a/zabbix_agentd.conf.d/mariadb.conf b/zabbix_agentd.conf.d/mariadb.conf new file mode 100644 index 0000000..f071633 --- /dev/null +++ b/zabbix_agentd.conf.d/mariadb.conf @@ -0,0 +1,7 @@ +UserParameter=mysql.ping[*], mysqladmin -h"$1" -P"$2" ping +UserParameter=mysql.get_status_variables[*], mysql -h"$1" -P"$2" -sNX -e "show global status" +UserParameter=mysql.version[*], mysqladmin -s -h"$1" -P"$2" version +UserParameter=mysql.db.discovery[*], mysql -h"$1" -P"$2" -sN -e "show databases" +UserParameter=mysql.dbsize[*], mysql -h"$1" -P"$2" -sN -e "SELECT COALESCE(SUM(DATA_LENGTH + INDEX_LENGTH),0) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='$3'" +UserParameter=mysql.replication.discovery[*], mysql -h"$1" -P"$2" -sNX -e "show slave status" +UserParameter=mysql.slave_status[*], mysql -h"$1" -P"$2" -sNX -e "show slave status" diff --git a/zabbix_agentd.conf.d/nextcloud.conf b/zabbix_agentd.conf.d/nextcloud.conf new file mode 100644 index 0000000..2a2c9ab --- /dev/null +++ b/zabbix_agentd.conf.d/nextcloud.conf @@ -0,0 +1,4 @@ +UserParameter=nc_metric[*],/opt/pyvenv/ncmonitor/bin/python /var/lib/zabbix/scripts/read_nc_metrics.py $1 +UserParameter=storage_metric[*],/opt/pyvenv/ncmonitor/bin/python /var/lib/zabbix/scripts/read_storage_metrics.py $1 +UserParameter=db_metric[*],/opt/pyvenv/ncmonitor/bin/python /var/lib/zabbix/scripts/read_db_metrics.py $1 $2 +UserParameter=apache2_user_agent_metric[*],/opt/pyvenv/ncmonitor/bin/python /var/lib/zabbix/scripts/read_apache2_user_agent_metrics.py $1