diff --git a/README.md b/README.md index 9316ab2..3fe1da1 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,26 @@ Java based system monitoring solution with support for plugins. - 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. +## Components + +### Client + +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. + +[More information](plugins/README.md). + ## Known problems @@ -24,24 +44,4 @@ If you rename a host, the metrics in InfluxDB will still be available by the old ```text USE sysmon; DELETE WHERE hostname = 'unknown'; -``` - -## Components - -### Client - -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. - -[More information](plugins/README.md). \ No newline at end of file +``` \ No newline at end of file diff --git a/doc/AIX.md b/client/doc/AIX.md similarity index 100% rename from doc/AIX.md rename to client/doc/AIX.md diff --git a/doc/sysmon-client.service b/client/doc/sysmon-client.service similarity index 100% rename from doc/sysmon-client.service rename to client/doc/sysmon-client.service diff --git a/doc/systemd.md b/client/doc/systemd.md similarity index 100% rename from doc/systemd.md rename to client/doc/systemd.md diff --git a/doc/Sysmon - Overview-1631005725048.json b/doc/Sysmon - Host Overview-1631013497580.json similarity index 99% rename from doc/Sysmon - Overview-1631005725048.json rename to doc/Sysmon - Host Overview-1631013497580.json index c8e126a..79a78f9 100644 --- a/doc/Sysmon - Overview-1631005725048.json +++ b/doc/Sysmon - Host Overview-1631013497580.json @@ -65,7 +65,7 @@ "gnetId": null, "graphTooltip": 0, "id": null, - "iteration": 1631005716742, + "iteration": 1631013342292, "links": [], "panels": [ { @@ -126,6 +126,7 @@ "steppedLine": false, "targets": [ { + "alias": "$col", "groupBy": [ { "params": [ @@ -893,6 +894,7 @@ "steppedLine": false, "targets": [ { + "alias": "$col", "groupBy": [ { "params": [ @@ -1086,6 +1088,7 @@ "steppedLine": false, "targets": [ { + "alias": "$col", "groupBy": [ { "params": [ @@ -1255,6 +1258,7 @@ "steppedLine": false, "targets": [ { + "alias": "$col", "groupBy": [ { "params": [ @@ -1830,7 +1834,7 @@ ] } ], - "title": "Running Processes - By Processor Time", + "title": "Running Processes - User Time", "type": "timeseries" }, { @@ -1966,7 +1970,7 @@ ] } ], - "title": "Running Processes - By Memory Usage", + "title": "Running Processes - Resident Memory", "type": "timeseries" } ], @@ -2019,7 +2023,7 @@ ] }, "timezone": "", - "title": "Sysmon - Overview", + "title": "Sysmon - Host Overview", "uid": "QkVPjseMk", - "version": 44 + "version": 46 } \ No newline at end of file diff --git a/doc/Sysmon - Process Explorer-1631005707732.json b/doc/Sysmon - Process Explorer-1631013513804.json similarity index 92% rename from doc/Sysmon - Process Explorer-1631005707732.json rename to doc/Sysmon - Process Explorer-1631013513804.json index 4f7d894..3e2d159 100644 --- a/doc/Sysmon - Process Explorer-1631005707732.json +++ b/doc/Sysmon - Process Explorer-1631013513804.json @@ -34,6 +34,12 @@ "name": "Stat", "version": "" }, + { + "type": "panel", + "id": "table", + "name": "Table", + "version": "" + }, { "type": "panel", "id": "timeseries", @@ -59,7 +65,7 @@ "gnetId": null, "graphTooltip": 0, "id": null, - "iteration": 1631005248811, + "iteration": 1631013505736, "links": [], "panels": [ { @@ -83,7 +89,11 @@ "fieldConfig": { "defaults": { "color": { - "mode": "thresholds" + "mode": "fixed" + }, + "custom": { + "align": "left", + "displayMode": "auto" }, "mappings": [], "thresholds": { @@ -94,46 +104,10 @@ "value": null } ] - } + }, + "unit": "string" }, - "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" - } - ] - } - ] + "overrides": [] }, "gridPos": { "h": 6, @@ -143,29 +117,25 @@ }, "id": 16, "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "center", - "orientation": "vertical", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "text": {}, - "textMode": "value_and_name" + "showHeader": true, + "sortBy": [] }, "pluginVersion": "8.0.6", "targets": [ { - "groupBy": [], + "groupBy": [ + { + "params": [ + "pid" + ], + "type": "tag" + } + ], "measurement": "base_process", "orderByTime": "ASC", "policy": "default", "refId": "A", - "resultFormat": "time_series", + "resultFormat": "table", "select": [ [ { @@ -174,6 +144,10 @@ ], "type": "field" }, + { + "params": [], + "type": "last" + }, { "params": [ "user" @@ -188,6 +162,10 @@ ], "type": "field" }, + { + "params": [], + "type": "last" + }, { "params": [ "group" @@ -198,13 +176,17 @@ [ { "params": [ - "path" + "prio" ], "type": "field" }, + { + "params": [], + "type": "last" + }, { "params": [ - "path" + "priority" ], "type": "alias" } @@ -234,7 +216,7 @@ "timeFrom": null, "timeShift": null, "title": "Details", - "type": "stat" + "type": "table" }, { "datasource": "${DS_INFLUXDB-SYSMON}", @@ -271,7 +253,7 @@ { "matcher": { "id": "byName", - "options": "base_process.virt" + "options": "base_process.vsz" }, "properties": [ { @@ -336,7 +318,7 @@ }, { "params": [], - "type": "last" + "type": "sum" }, { "params": [ @@ -348,17 +330,17 @@ [ { "params": [ - "mem_virt" + "mem_vsz" ], "type": "field" }, { "params": [], - "type": "last" + "type": "sum" }, { "params": [ - "virt" + "vsz" ], "type": "alias" } @@ -467,7 +449,7 @@ }, { "params": [ - "null" + "previous" ], "type": "fill" } @@ -487,7 +469,7 @@ }, { "params": [], - "type": "last" + "type": "sum" }, { "params": [], @@ -509,7 +491,7 @@ }, { "params": [], - "type": "last" + "type": "sum" }, { "params": [], @@ -657,7 +639,7 @@ }, { "params": [], - "type": "last" + "type": "sum" }, { "params": [], @@ -679,7 +661,7 @@ }, { "params": [], - "type": "last" + "type": "sum" }, { "params": [], @@ -832,7 +814,7 @@ }, { "params": [], - "type": "mean" + "type": "sum" }, { "params": [ @@ -850,7 +832,7 @@ }, { "params": [], - "type": "mean" + "type": "sum" }, { "params": [ @@ -935,7 +917,7 @@ "type": "query" }, { - "allValue": null, + "allValue": "", "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", @@ -976,5 +958,5 @@ "timezone": "", "title": "Sysmon - Process Explorer", "uid": "Vjut5mS7k", - "version": 6 + "version": 11 } \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index d22e2d2..084a2b6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -version=0.0.8 +version=0.0.9 pf4jVersion=3.6.0 slf4jVersion=1.7.32 camelVersion=3.11.1 diff --git a/plugins/README.md b/plugins/README.md index 75d3ab9..6e6b5b9 100644 --- a/plugins/README.md +++ b/plugins/README.md @@ -1,3 +1,7 @@ # System Monitor Plugins -Collection of standard sysmon plugins. \ No newline at end of file +Collection of standard sysmon plugins. + +- [base](os-base/) - base OS metrics +- [aix](os-aix/) - AIX (and Power) specific metrics +- [linux](os-linux/) - Linux specific metrics \ 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 35baf16..6178053 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 @@ -71,7 +71,7 @@ public class BaseProcessExtension implements MetricExtension { if(!includeList.contains(name)) { continue; } - log.debug("pid: " + p.getProcessID() + ", name: " + name + ", virt: " + p.getVirtualSize() + " rss: " + p.getResidentSetSize()); + log.debug("pid: " + p.getProcessID() + ", name: " + name + ", virt: " + p.getVirtualSize() + " rss: " + p.getResidentSetSize() + " cmd: " + p.getCommandLine()); HashMap tagsMap = new HashMap<>(); HashMap fieldsMap = new HashMap<>(); @@ -79,9 +79,8 @@ public class BaseProcessExtension implements MetricExtension { tagsMap.put("pid", String.valueOf(p.getProcessID())); tagsMap.put("name", name); - fieldsMap.put("path", p.getPath()); fieldsMap.put("mem_rss", p.getResidentSetSize()); - fieldsMap.put("mem_virt", p.getVirtualSize()); + fieldsMap.put("mem_vsz", p.getVirtualSize()); fieldsMap.put("kernel_time", p.getKernelTime()); fieldsMap.put("user_time", p.getUserTime()); fieldsMap.put("read_bytes", p.getBytesRead()); @@ -90,6 +89,7 @@ public class BaseProcessExtension implements MetricExtension { fieldsMap.put("threads", p.getThreadCount()); fieldsMap.put("user", p.getUser()); fieldsMap.put("group", p.getGroup()); + fieldsMap.put("prio", p.getPriority()); measurementList.add(new Measurement(tagsMap, fieldsMap)); } diff --git a/doc/sysmon-server.service b/server/doc/sysmon-server.service similarity index 100% rename from doc/sysmon-server.service rename to server/doc/sysmon-server.service diff --git a/server/doc/systemd.md b/server/doc/systemd.md new file mode 100644 index 0000000..3a196cc --- /dev/null +++ b/server/doc/systemd.md @@ -0,0 +1,10 @@ +# SystemD Notes + +Setup as systemd service to start automatically at boot: + +```shell +cp sysmon-server.service /etc/systemd/system/ +systemctl daemon-reload +systemctl enable sysmon-server +systemctl restart sysmon-server +``` \ No newline at end of file