diff --git a/README.md b/README.md index 0227942..9316ab2 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ Java based system monitoring solution with support for plugins. -- Example Grafana [dashboard](https://bitbucket.org/mnellemann/sysmon/downloads/sysmon-example-dashboard.png) showing metrics from a host running *sysmon*. - +- Example dashboards are provided in the [doc/](doc) folder, which can be imported into your Grafana installation. +- Screenshots are available in the [downloads](https://bitbucket.org/mnellemann/sysmon/downloads/) section. ## Known problems @@ -32,12 +32,16 @@ DELETE WHERE hostname = 'unknown'; Runs on your hosts and collects metrics, which are sent to the central *server*. +[More information](client/README.md). ### Server Receives aggregated metrics from clients and saves these into InfluxDB. +[More information](server/README.md). ### Plugins -Loaded by the client and provides extensions for doing the actual collecting of metrics. \ No newline at end of file +Loaded by the client and provides extensions for doing the actual collecting of metrics. + +[More information](plugins/README.md). \ No newline at end of file diff --git a/client/build.gradle b/client/build.gradle index e7f062e..325859e 100644 --- a/client/build.gradle +++ b/client/build.gradle @@ -37,7 +37,7 @@ def projectName = "sysmon-client" application { // Define the main class for the application. mainClass.set('sysmon.client.Application') - applicationDefaultJvmArgs = [ "-server", "-Xms32m", "-Xmx32m" ] + applicationDefaultJvmArgs = [ "-server", "-XX:+UseG1GC", "-Xmx32m" ] } run { diff --git a/doc/Sysmon Agent-1623356330000.json b/doc/Sysmon - Overview-1631005725048.json similarity index 78% rename from doc/Sysmon Agent-1623356330000.json rename to doc/Sysmon - Overview-1631005725048.json index 8424464..c8e126a 100644 --- a/doc/Sysmon Agent-1623356330000.json +++ b/doc/Sysmon - Overview-1631005725048.json @@ -20,7 +20,7 @@ "type": "grafana", "id": "grafana", "name": "Grafana", - "version": "8.0.0" + "version": "8.0.6" }, { "type": "panel", @@ -39,6 +39,12 @@ "id": "stat", "name": "Stat", "version": "" + }, + { + "type": "panel", + "id": "timeseries", + "name": "Time series", + "version": "" } ], "annotations": { @@ -59,7 +65,7 @@ "gnetId": null, "graphTooltip": 0, "id": null, - "iteration": 1623356323404, + "iteration": 1631005716742, "links": [], "panels": [ { @@ -88,7 +94,7 @@ "fillGradient": 0, "gridPos": { "h": 10, - "w": 10, + "w": 12, "x": 0, "y": 1 }, @@ -110,7 +116,7 @@ "alertThreshold": true }, "percentage": false, - "pluginVersion": "8.0.0", + "pluginVersion": "8.0.6", "pointradius": 2, "points": false, "renderer": "flot", @@ -134,7 +140,7 @@ "type": "fill" } ], - "measurement": "processor", + "measurement": "base_processor", "orderByTime": "ASC", "policy": "default", "refId": "A", @@ -278,6 +284,7 @@ }, "yaxes": [ { + "$$hashKey": "object:42", "format": "short", "label": null, "logBase": 1, @@ -286,6 +293,7 @@ "show": true }, { + "$$hashKey": "object:43", "format": "short", "label": null, "logBase": 1, @@ -326,7 +334,7 @@ { "matcher": { "id": "byName", - "options": "processor_lpar.mode" + "options": "aix_processor.mode" }, "properties": [ { @@ -338,7 +346,7 @@ { "matcher": { "id": "byName", - "options": "processor_lpar.type" + "options": "aix_processor.type" }, "properties": [ { @@ -350,7 +358,7 @@ { "matcher": { "id": "byName", - "options": "processor_lpar.ent" + "options": "aix_processor.ent" }, "properties": [ { @@ -362,7 +370,7 @@ { "matcher": { "id": "byName", - "options": "processor_lpar.lcpu" + "options": "aix_processor.lcpu" }, "properties": [ { @@ -374,9 +382,9 @@ ] }, "gridPos": { - "h": 3, - "w": 4, - "x": 10, + "h": 4, + "w": 12, + "x": 12, "y": 1 }, "id": 16, @@ -395,7 +403,7 @@ "text": {}, "textMode": "value_and_name" }, - "pluginVersion": "8.0.0", + "pluginVersion": "8.0.6", "targets": [ { "groupBy": [ @@ -412,7 +420,7 @@ "type": "fill" } ], - "measurement": "processor_lpar", + "measurement": "aix_processor", "orderByTime": "ASC", "policy": "default", "refId": "A", @@ -502,180 +510,7 @@ ], "timeFrom": null, "timeShift": null, - "title": "Power LPAR Details", - "type": "stat" - }, - { - "datasource": "${DS_INFLUXDB-SYSMON}", - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "continuous-GrYlRd" - }, - "decimals": 2, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "processor_lpar.entc" - }, - "properties": [ - { - "id": "displayName", - "value": "Consumed Entitlements" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "processor_lpar.physc" - }, - "properties": [ - { - "id": "displayName", - "value": "Consumed Phys. Cores" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "processor_lpar.lbusy" - }, - "properties": [ - { - "id": "displayName", - "value": "Busy Logical CPUs" - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 10, - "x": 14, - "y": 1 - }, - "id": 17, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "text": {}, - "textMode": "auto" - }, - "pluginVersion": "8.0.0", - "targets": [ - { - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "linear" - ], - "type": "fill" - } - ], - "measurement": "processor_lpar", - "orderByTime": "ASC", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "physc" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - }, - { - "params": [ - "physc" - ], - "type": "alias" - } - ], - [ - { - "params": [ - "lbusy" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - }, - { - "params": [ - "lbusy" - ], - "type": "alias" - } - ], - [ - { - "params": [ - "entc" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - }, - { - "params": [ - "entc" - ], - "type": "alias" - } - ] - ], - "tags": [ - { - "key": "hostname", - "operator": "=~", - "value": "/^$hostname$/" - } - ] - } - ], - "timeFrom": null, - "timeShift": null, - "title": "Power LPAR Processor Usage", + "title": "LPAR Details (IBM Power)", "type": "stat" }, { @@ -701,7 +536,7 @@ { "matcher": { "id": "byName", - "options": "disk.iotime" + "options": "base_disk.iotime" }, "properties": [ { @@ -717,7 +552,7 @@ { "matcher": { "id": "byName", - "options": "disk.queue" + "options": "base_disk.queue" }, "properties": [ { @@ -733,10 +568,10 @@ ] }, "gridPos": { - "h": 7, + "h": 6, "w": 4, - "x": 10, - "y": 4 + "x": 12, + "y": 5 }, "id": 19, "options": { @@ -751,7 +586,7 @@ "showThresholdMarkers": true, "text": {} }, - "pluginVersion": "8.0.0", + "pluginVersion": "8.0.6", "targets": [ { "groupBy": [ @@ -768,7 +603,7 @@ "type": "fill" } ], - "measurement": "disk", + "measurement": "base_disk", "orderByTime": "ASC", "policy": "default", "refId": "A", @@ -831,6 +666,185 @@ "title": "Disk Metrics", "type": "gauge" }, + { + "datasource": "${DS_INFLUXDB-SYSMON}", + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "continuous-GrYlRd" + }, + "decimals": 2, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "short" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "aix_processor.entc" + }, + "properties": [ + { + "id": "displayName", + "value": "Consumed Entitlements" + }, + { + "id": "unit", + "value": "percent" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "aix_processor.physc" + }, + "properties": [ + { + "id": "displayName", + "value": "Consumed Phys. Cores" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "aix_processor.lbusy" + }, + "properties": [ + { + "id": "displayName", + "value": "Busy Logical CPUs" + } + ] + } + ] + }, + "gridPos": { + "h": 6, + "w": 8, + "x": 16, + "y": 5 + }, + "id": 17, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "8.0.6", + "targets": [ + { + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "linear" + ], + "type": "fill" + } + ], + "measurement": "aix_processor", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "physc" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [ + "physc" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "lbusy" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [ + "lbusy" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "entc" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [ + "entc" + ], + "type": "alias" + } + ] + ], + "tags": [ + { + "key": "hostname", + "operator": "=~", + "value": "/^$hostname$/" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "LPAR Processor Usage (IBM Power)", + "type": "stat" + }, { "aliasColors": {}, "bars": false, @@ -847,7 +861,7 @@ "fillGradient": 0, "gridPos": { "h": 10, - "w": 10, + "w": 12, "x": 0, "y": 11 }, @@ -869,7 +883,7 @@ "alertThreshold": true }, "percentage": false, - "pluginVersion": "8.0.0", + "pluginVersion": "8.0.6", "pointradius": 2, "points": false, "renderer": "flot", @@ -893,7 +907,7 @@ "type": "fill" } ], - "measurement": "memory", + "measurement": "base_memory", "orderByTime": "ASC", "policy": "default", "refId": "A", @@ -1001,6 +1015,7 @@ }, "yaxes": [ { + "$$hashKey": "object:144", "format": "bytes", "label": null, "logBase": 1, @@ -1009,6 +1024,7 @@ "show": true }, { + "$$hashKey": "object:145", "format": "short", "label": null, "logBase": 1, @@ -1038,8 +1054,8 @@ "fillGradient": 0, "gridPos": { "h": 10, - "w": 14, - "x": 10, + "w": 12, + "x": 12, "y": 11 }, "hiddenSeries": false, @@ -1060,7 +1076,7 @@ "alertThreshold": true }, "percentage": false, - "pluginVersion": "8.0.0", + "pluginVersion": "8.0.6", "pointradius": 2, "points": false, "renderer": "flot", @@ -1084,7 +1100,7 @@ "type": "fill" } ], - "measurement": "disk", + "measurement": "base_disk", "orderByTime": "ASC", "policy": "default", "refId": "A", @@ -1168,6 +1184,7 @@ }, "yaxes": [ { + "$$hashKey": "object:196", "format": "binBps", "label": null, "logBase": 1, @@ -1176,6 +1193,7 @@ "show": true }, { + "$$hashKey": "object:197", "format": "short", "label": null, "logBase": 1, @@ -1205,7 +1223,7 @@ "fillGradient": 0, "gridPos": { "h": 11, - "w": 10, + "w": 12, "x": 0, "y": 21 }, @@ -1227,7 +1245,7 @@ "alertThreshold": true }, "percentage": false, - "pluginVersion": "8.0.0", + "pluginVersion": "8.0.6", "pointradius": 2, "points": false, "renderer": "flot", @@ -1251,7 +1269,7 @@ "type": "fill" } ], - "measurement": "network", + "measurement": "base_network", "orderByTime": "ASC", "policy": "default", "refId": "A", @@ -1335,6 +1353,7 @@ }, "yaxes": [ { + "$$hashKey": "object:248", "format": "binBps", "label": null, "logBase": 1, @@ -1343,6 +1362,7 @@ "show": true }, { + "$$hashKey": "object:249", "format": "short", "label": null, "logBase": 1, @@ -1365,6 +1385,7 @@ "mode": "continuous-GrYlRd" }, "mappings": [], + "min": 0, "thresholds": { "mode": "absolute", "steps": [ @@ -1374,13 +1395,13 @@ } ] }, - "unit": "none" + "unit": "short" }, "overrides": [ { "matcher": { "id": "byName", - "options": "network_sockets.sockets" + "options": "linux_network_sockets.sockets" }, "properties": [ { @@ -1392,7 +1413,7 @@ { "matcher": { "id": "byName", - "options": "network_sockets.tcp_alloc" + "options": "linux_network_sockets.tcp_alloc" }, "properties": [ { @@ -1404,7 +1425,7 @@ { "matcher": { "id": "byName", - "options": "network_sockets.tcp_inuse" + "options": "linux_network_sockets.tcp_inuse" }, "properties": [ { @@ -1416,7 +1437,7 @@ { "matcher": { "id": "byName", - "options": "network_sockets.tcp_mem" + "options": "linux_network_sockets.tcp_mem" }, "properties": [ { @@ -1428,7 +1449,7 @@ { "matcher": { "id": "byName", - "options": "network_sockets.tcp_orphan" + "options": "linux_network_sockets.tcp_orphan" }, "properties": [ { @@ -1440,7 +1461,7 @@ { "matcher": { "id": "byName", - "options": "network_sockets.tcp_tw" + "options": "linux_network_sockets.tcp_tw" }, "properties": [ { @@ -1452,7 +1473,7 @@ { "matcher": { "id": "byName", - "options": "network_sockets.udp_inuse" + "options": "linux_network_sockets.udp_inuse" }, "properties": [ { @@ -1464,7 +1485,7 @@ { "matcher": { "id": "byName", - "options": "network_sockets.udp_mem" + "options": "linux_network_sockets.udp_mem" }, "properties": [ { @@ -1477,8 +1498,8 @@ }, "gridPos": { "h": 11, - "w": 14, - "x": 10, + "w": 12, + "x": 12, "y": 21 }, "id": 22, @@ -1497,7 +1518,7 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "8.0.0", + "pluginVersion": "8.0.6", "targets": [ { "groupBy": [ @@ -1514,7 +1535,7 @@ "type": "fill" } ], - "measurement": "network_sockets", + "measurement": "linux_network_sockets", "orderByTime": "ASC", "policy": "default", "refId": "A", @@ -1678,9 +1699,278 @@ "timeShift": null, "title": "Network Sockets (Linux)", "type": "stat" + }, + { + "datasource": "${DS_INFLUXDB-SYSMON}", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "dtdurationms" + }, + "overrides": [] + }, + "gridPos": { + "h": 14, + "w": 12, + "x": 0, + "y": 32 + }, + "id": 24, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "pluginVersion": "8.0.6", + "targets": [ + { + "alias": "$tag_name($tag_pid)", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "pid" + ], + "type": "tag" + }, + { + "params": [ + "name" + ], + "type": "tag" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "base_process", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT non_negative_difference(sum(last(\"user_time\"),last(\"kernel_time\"))) FROM \"base_process\" WHERE (\"hostname\" =~ /^$hostname$/) AND $timeFilter GROUP BY time($__interval), \"pid\", \"name\" fill(null)", + "rawQuery": false, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "user_time" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + }, + { + "params": [], + "type": "non_negative_difference" + } + ] + ], + "tags": [ + { + "key": "hostname", + "operator": "=~", + "value": "/^$hostname$/" + } + ] + } + ], + "title": "Running Processes - By Processor Time", + "type": "timeseries" + }, + { + "datasource": "${DS_INFLUXDB-SYSMON}", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 14, + "w": 12, + "x": 12, + "y": 32 + }, + "id": 25, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "pluginVersion": "8.0.6", + "targets": [ + { + "alias": "$tag_name($tag_pid)", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "pid" + ], + "type": "tag" + }, + { + "params": [ + "name" + ], + "type": "tag" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "base_process", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(non_negative_derivative(mean(\"user_time\"), 30s), non_negative_derivative(mean(\"user_time\"), 30s)) FROM \"base_process\" WHERE (\"hostname\" =~ /^$hostname$/) AND $timeFilter GROUP BY time($__interval), \"pid\", \"name\" fill(null)", + "rawQuery": false, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "mem_rss" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "hostname", + "operator": "=~", + "value": "/^$hostname$/" + } + ] + } + ], + "title": "Running Processes - By Memory Usage", + "type": "timeseries" } ], - "refresh": "30s", + "refresh": "1m", "schemaVersion": 30, "style": "dark", "tags": [], @@ -1690,17 +1980,17 @@ "allValue": null, "current": {}, "datasource": "${DS_INFLUXDB-SYSMON}", - "definition": "SHOW TAG VALUES FROM \"processor\" WITH KEY = \"hostname\" WHERE time > now() - 24h", + "definition": "SHOW TAG VALUES FROM \"base_memory\" WITH KEY = \"hostname\" WHERE time > now() - 60m", "description": null, "error": null, "hide": 0, - "includeAll": true, + "includeAll": false, "label": "Host", - "multi": true, + "multi": false, "name": "hostname", "options": [], - "query": "SHOW TAG VALUES FROM \"processor\" WITH KEY = \"hostname\" WHERE time > now() - 24h", - "refresh": 1, + "query": "SHOW TAG VALUES FROM \"base_memory\" WITH KEY = \"hostname\" WHERE time > now() - 60m", + "refresh": 2, "regex": "", "skipUrlSync": false, "sort": 0, @@ -1712,13 +2002,12 @@ ] }, "time": { - "from": "now-6h", + "from": "now-3h", "to": "now-30s" }, "timepicker": { - "nowDelay": "1m", + "nowDelay": "30s", "refresh_intervals": [ - "10s", "30s", "1m", "5m", @@ -1730,7 +2019,7 @@ ] }, "timezone": "", - "title": "Sysmon Agent", + "title": "Sysmon - Overview", "uid": "QkVPjseMk", - "version": 30 + "version": 44 } \ No newline at end of file diff --git a/doc/Sysmon - Process Explorer-1631005707732.json b/doc/Sysmon - Process Explorer-1631005707732.json new file mode 100644 index 0000000..4f7d894 --- /dev/null +++ b/doc/Sysmon - Process Explorer-1631005707732.json @@ -0,0 +1,980 @@ +{ + "__inputs": [ + { + "name": "DS_INFLUXDB-SYSMON", + "label": "InfluxDB-sysmon", + "description": "", + "type": "datasource", + "pluginId": "influxdb", + "pluginName": "InfluxDB" + } + ], + "__requires": [ + { + "type": "panel", + "id": "gauge", + "name": "Gauge", + "version": "" + }, + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "8.0.6" + }, + { + "type": "datasource", + "id": "influxdb", + "name": "InfluxDB", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "version": "" + }, + { + "type": "panel", + "id": "timeseries", + "name": "Time series", + "version": "" + } + ], + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "description": "Metrics from within host / guest / partition.", + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": null, + "iteration": 1631005248811, + "links": [], + "panels": [ + { + "collapsed": false, + "datasource": null, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 4, + "panels": [], + "repeat": "hostname", + "title": "${hostname}", + "type": "row" + }, + { + "datasource": "${DS_INFLUXDB-SYSMON}", + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "base_process.user" + }, + "properties": [ + { + "id": "displayName", + "value": "User" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "base_process.group" + }, + "properties": [ + { + "id": "displayName", + "value": "Group" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "base_process.path" + }, + "properties": [ + { + "id": "displayName", + "value": "Path" + } + ] + } + ] + }, + "gridPos": { + "h": 6, + "w": 12, + "x": 0, + "y": 1 + }, + "id": 16, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "vertical", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "value_and_name" + }, + "pluginVersion": "8.0.6", + "targets": [ + { + "groupBy": [], + "measurement": "base_process", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "user" + ], + "type": "field" + }, + { + "params": [ + "user" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "group" + ], + "type": "field" + }, + { + "params": [ + "group" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "path" + ], + "type": "field" + }, + { + "params": [ + "path" + ], + "type": "alias" + } + ] + ], + "tags": [ + { + "key": "hostname", + "operator": "=~", + "value": "/^$hostname$/" + }, + { + "condition": "AND", + "key": "name", + "operator": "=~", + "value": "/^$process$/" + }, + { + "condition": "AND", + "key": "pid", + "operator": "=~", + "value": "/^$pid$/" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Details", + "type": "stat" + }, + { + "datasource": "${DS_INFLUXDB-SYSMON}", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "bytes" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "base_process.rss" + }, + "properties": [ + { + "id": "displayName", + "value": "Resident" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "base_process.virt" + }, + "properties": [ + { + "id": "displayName", + "value": "Virtual" + } + ] + } + ] + }, + "gridPos": { + "h": 6, + "w": 7, + "x": 12, + "y": 1 + }, + "id": 19, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "8.0.6", + "targets": [ + { + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "linear" + ], + "type": "fill" + } + ], + "measurement": "base_process", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "mem_rss" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + }, + { + "params": [ + "rss" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "mem_virt" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + }, + { + "params": [ + "virt" + ], + "type": "alias" + } + ] + ], + "tags": [ + { + "key": "hostname", + "operator": "=~", + "value": "/^$hostname$/" + }, + { + "condition": "AND", + "key": "name", + "operator": "=~", + "value": "/^$process$/" + }, + { + "condition": "AND", + "key": "pid", + "operator": "=~", + "value": "/^$pid$/" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Memory Metrics", + "type": "stat" + }, + { + "datasource": "${DS_INFLUXDB-SYSMON}", + "fieldConfig": { + "defaults": { + "color": { + "mode": "continuous-GrYlRd" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "bytes" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "base_process.read" + }, + "properties": [ + { + "id": "displayName", + "value": "Read Bytes" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "base_process.write" + }, + "properties": [ + { + "id": "displayName", + "value": "Write Bytes" + } + ] + } + ] + }, + "gridPos": { + "h": 6, + "w": 5, + "x": 19, + "y": 1 + }, + "id": 26, + "options": { + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true, + "text": {} + }, + "pluginVersion": "8.0.6", + "targets": [ + { + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "base_process", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "read_bytes" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + }, + { + "params": [], + "type": "non_negative_difference" + }, + { + "params": [ + "read" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "write_bytes" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + }, + { + "params": [], + "type": "non_negative_difference" + }, + { + "params": [ + "write" + ], + "type": "alias" + } + ] + ], + "tags": [ + { + "key": "hostname", + "operator": "=~", + "value": "/^$hostname$/" + }, + { + "condition": "AND", + "key": "name", + "operator": "=~", + "value": "/^$process$/" + }, + { + "condition": "AND", + "key": "pid", + "operator": "=~", + "value": "/^$pid$/" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Disk Metrics", + "type": "gauge" + }, + { + "datasource": "${DS_INFLUXDB-SYSMON}", + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "dtdurationms" + }, + "overrides": [] + }, + "gridPos": { + "h": 11, + "w": 12, + "x": 0, + "y": 7 + }, + "id": 24, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "pluginVersion": "8.0.6", + "targets": [ + { + "alias": "$col", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "name" + ], + "type": "tag" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "base_process", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT non_negative_difference(sum(last(\"user_time\"),last(\"kernel_time\"))) FROM \"base_process\" WHERE (\"hostname\" =~ /^$hostname$/) AND $timeFilter GROUP BY time($__interval), \"pid\", \"name\" fill(null)", + "rawQuery": false, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "user_time" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + }, + { + "params": [], + "type": "non_negative_difference" + }, + { + "params": [ + "user" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "kernel_time" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + }, + { + "params": [], + "type": "non_negative_difference" + }, + { + "params": [ + "kernel" + ], + "type": "alias" + } + ] + ], + "tags": [ + { + "key": "hostname", + "operator": "=~", + "value": "/^$hostname$/" + }, + { + "condition": "AND", + "key": "name", + "operator": "=~", + "value": "/^$process$/" + }, + { + "condition": "AND", + "key": "pid", + "operator": "=~", + "value": "/^$pid$/" + } + ] + } + ], + "title": "Processor Time", + "type": "timeseries" + }, + { + "datasource": "${DS_INFLUXDB-SYSMON}", + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 11, + "w": 12, + "x": 12, + "y": 7 + }, + "id": 25, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "pluginVersion": "8.0.6", + "targets": [ + { + "alias": "$col", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "name" + ], + "type": "tag" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "base_process", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(non_negative_derivative(mean(\"user_time\"), 30s), non_negative_derivative(mean(\"user_time\"), 30s)) FROM \"base_process\" WHERE (\"hostname\" =~ /^$hostname$/) AND $timeFilter GROUP BY time($__interval), \"pid\", \"name\" fill(null)", + "rawQuery": false, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "files" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [ + "files" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "threads" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [ + "threads" + ], + "type": "alias" + } + ] + ], + "tags": [ + { + "key": "hostname", + "operator": "=~", + "value": "/^$hostname$/" + }, + { + "condition": "AND", + "key": "name", + "operator": "=~", + "value": "/^$process$/" + }, + { + "condition": "AND", + "key": "pid", + "operator": "=~", + "value": "/^$pid$/" + } + ] + } + ], + "title": "Threads & Open Files", + "type": "timeseries" + } + ], + "refresh": "1m", + "schemaVersion": 30, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "allValue": null, + "current": {}, + "datasource": "${DS_INFLUXDB-SYSMON}", + "definition": "SHOW TAG VALUES FROM \"base_memory\" WITH KEY = \"hostname\" WHERE time > now() - 60m", + "description": null, + "error": null, + "hide": 0, + "includeAll": false, + "label": "Host", + "multi": false, + "name": "hostname", + "options": [], + "query": "SHOW TAG VALUES FROM \"base_memory\" WITH KEY = \"hostname\" WHERE time > now() - 60m", + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": null, + "current": {}, + "datasource": "${DS_INFLUXDB-SYSMON}", + "definition": "SHOW TAG VALUES FROM \"base_process\" WITH KEY = \"name\" WHERE hostname =~ /$hostname/AND time > now() - 60m", + "description": null, + "error": null, + "hide": 0, + "includeAll": false, + "label": "Process", + "multi": false, + "name": "process", + "options": [], + "query": "SHOW TAG VALUES FROM \"base_process\" WITH KEY = \"name\" WHERE hostname =~ /$hostname/AND time > now() - 60m", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "allValue": null, + "current": {}, + "datasource": "${DS_INFLUXDB-SYSMON}", + "definition": "SHOW TAG VALUES FROM \"base_process\" WITH KEY = \"pid\" WHERE hostname =~ /$hostname/AND \"name\" =~ /$process/ AND time > now() - 60m", + "description": null, + "error": null, + "hide": 0, + "includeAll": true, + "label": "PID", + "multi": false, + "name": "pid", + "options": [], + "query": "SHOW TAG VALUES FROM \"base_process\" WITH KEY = \"pid\" WHERE hostname =~ /$hostname/AND \"name\" =~ /$process/ AND time > now() - 60m", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + } + ] + }, + "time": { + "from": "now-3h", + "to": "now-30s" + }, + "timepicker": { + "nowDelay": "30s", + "refresh_intervals": [ + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ] + }, + "timezone": "", + "title": "Sysmon - Process Explorer", + "uid": "Vjut5mS7k", + "version": 6 +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 6d784a9..d22e2d2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,4 +3,4 @@ pf4jVersion=3.6.0 slf4jVersion=1.7.32 camelVersion=3.11.1 picocliVersion=4.6.1 -oshiVersion=5.8.1 \ No newline at end of file +oshiVersion=5.8.2 \ No newline at end of file diff --git a/plugins/os-base/src/main/java/sysmon/plugins/os_base/BaseProcessExtension.java b/plugins/os-base/src/main/java/sysmon/plugins/os_base/BaseProcessExtension.java index 2612486..35baf16 100644 --- a/plugins/os-base/src/main/java/sysmon/plugins/os_base/BaseProcessExtension.java +++ b/plugins/os-base/src/main/java/sysmon/plugins/os_base/BaseProcessExtension.java @@ -78,8 +78,8 @@ public class BaseProcessExtension implements MetricExtension { tagsMap.put("pid", String.valueOf(p.getProcessID())); tagsMap.put("name", name); - //tagsMap.put("path", p.getPath()); + fieldsMap.put("path", p.getPath()); fieldsMap.put("mem_rss", p.getResidentSetSize()); fieldsMap.put("mem_virt", p.getVirtualSize()); fieldsMap.put("kernel_time", p.getKernelTime()); diff --git a/server/build.gradle b/server/build.gradle index 5a6ecaa..032e695 100644 --- a/server/build.gradle +++ b/server/build.gradle @@ -28,7 +28,7 @@ def projectName = "sysmon-server" application { // Define the main class for the application. mainClass.set('sysmon.server.Application') - applicationDefaultJvmArgs = [ "-server", "-Xms128m", "-Xmx128m" ] + applicationDefaultJvmArgs = [ "-server", "-XX:+UseG1GC", "-Xmx128m" ] } tasks.named('test') {