diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md index 3fe1da1..81bcb88 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,12 @@ # System Monitor -Java based system monitoring solution with support for plugins. +This software is free to use and is licensed under the [Apache 2.0 License](LICENSE). - 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. +![Sysmon Icon](doc/monitoring-eye-svgrepo-com.png) + ## Components ### Client @@ -15,13 +17,13 @@ Runs on your hosts and collects metrics, which are sent to the central *server*. ### Server -Receives aggregated metrics from clients and saves these into InfluxDB. +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. +Loaded by the *client* and provides extensions for doing the actual collecting of metrics. [More information](plugins/README.md). diff --git a/client/src/main/java/sysmon/client/ClientRouteBuilder.java b/client/src/main/java/sysmon/client/ClientRouteBuilder.java index 6adf7fe..7353b57 100644 --- a/client/src/main/java/sysmon/client/ClientRouteBuilder.java +++ b/client/src/main/java/sysmon/client/ClientRouteBuilder.java @@ -43,7 +43,7 @@ public class ClientRouteBuilder extends RouteBuilder { // Load configuration if available if(configuration.isForExtension(name)) { - log.info(">>> Loading configuring for extension: " + ext.getDescription()); + log.info("Loading configuring for extension: " + ext.getDescription()); ext.setConfiguration(configuration.getForExtension(name)); } @@ -55,7 +55,7 @@ public class ClientRouteBuilder extends RouteBuilder { continue; } - log.info(">>> Enabling extension: " + ext.getDescription()); + log.info("Enabling extension: " + ext.getDescription()); providers.add(provides); // Setup Camel route for this extension @@ -72,25 +72,29 @@ public class ClientRouteBuilder extends RouteBuilder { .log("${body}") .to("seda:metrics?discardWhenFull=true"); } else { - log.info(">>> Skipping extension (not supported or disabled): " + ext.getDescription()); + log.info("Skipping extension (not supported or disabled): " + ext.getDescription()); } } - from("seda:metrics") + from("seda:metrics?purgeWhenStopping=true") .aggregate(constant(true), AggregationStrategies.beanAllowNull(ComboAppender.class, "append")) - //.aggregate(new GroupedExchangeAggregationStrategy()).constant(true) - //.aggregate(constant(true), new ListOfResultsStrategy()) - // wait for 5 seconds to aggregate - .completionTimeout(5000L).to("seda:outbound"); + .completionTimeout(5000L) + .doTry() + .to("seda:outbound?discardWhenFull=true") + .log("Aggregating ${body} before sending to server.") + .doCatch(Exception.class) + .log(LoggingLevel.WARN, "Error: ${exception.message}.") + .end(); - from("seda:outbound") + from("seda:outbound?purgeWhenStopping=true") .setHeader(Exchange.HTTP_METHOD, constant("POST")) .doTry() .marshal(new JacksonDataFormat(ComboResult.class)) .to((String)registry.lookupByName("myServerUrl")) + .log("${body}") .doCatch(Exception.class) - .log(LoggingLevel.WARN,"Error: ${exception.message}") + .log(LoggingLevel.WARN,"Error: ${exception.message}.") .end(); } diff --git a/client/src/main/resources/application.properties b/client/src/main/resources/application.properties index 4e881d2..b01e8aa 100644 --- a/client/src/main/resources/application.properties +++ b/client/src/main/resources/application.properties @@ -30,3 +30,6 @@ camel.main.name = sysmon-client camel.main.lightweight = true # and eager load classes #camel.main.eager-classloading = true + +# limit the seda queue size +camel.component.seda.queue-size=10 \ No newline at end of file diff --git a/client/src/main/resources/simplelogger.properties b/client/src/main/resources/simplelogger.properties index a2f88ce..ef3458f 100644 --- a/client/src/main/resources/simplelogger.properties +++ b/client/src/main/resources/simplelogger.properties @@ -4,3 +4,5 @@ org.slf4j.simpleLogger.showShortLogName=true org.slf4j.simpleLogger.dateTimeFormat=yyyy-MM-dd HH:mm:ss.SSS org.slf4j.simpleLogger.levelInBrackets=true org.slf4j.simpleLogger.defaultLogLevel=warn +org.slf4j.simpleLogger.showThreadName=false +org.slf4j.simpleLogger.showLogName=false diff --git a/doc/Sysmon - Host Overview-1631013497580.json b/doc/Sysmon - Host Overview-1632317598140.json similarity index 82% rename from doc/Sysmon - Host Overview-1631013497580.json rename to doc/Sysmon - Host Overview-1632317598140.json index 79a78f9..509e9ec 100644 --- a/doc/Sysmon - Host Overview-1631013497580.json +++ b/doc/Sysmon - Host Overview-1632317598140.json @@ -20,7 +20,7 @@ "type": "grafana", "id": "grafana", "name": "Grafana", - "version": "8.0.6" + "version": "8.1.4" }, { "type": "panel", @@ -40,6 +40,12 @@ "name": "Stat", "version": "" }, + { + "type": "panel", + "id": "text", + "name": "Text", + "version": "" + }, { "type": "panel", "id": "timeseries", @@ -56,6 +62,12 @@ "hide": true, "iconColor": "rgba(0, 211, 255, 1)", "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, "type": "dashboard" } ] @@ -65,9 +77,26 @@ "gnetId": null, "graphTooltip": 0, "id": null, - "iteration": 1631013342292, + "iteration": 1632317456870, "links": [], "panels": [ + { + "datasource": null, + "gridPos": { + "h": 3, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 28, + "options": { + "content": "## Metrics are collected by an agent running inside of each LPAR / VM / Host.\n \n For more information: [bitbucket.org/mnellemann/sysmon](https://bitbucket.org/mnellemann/sysmon)\n ", + "mode": "markdown" + }, + "pluginVersion": "8.1.4", + "transparent": true, + "type": "text" + }, { "collapsed": false, "datasource": null, @@ -75,7 +104,7 @@ "h": 1, "w": 24, "x": 0, - "y": 0 + "y": 3 }, "id": 4, "panels": [], @@ -93,10 +122,10 @@ "fill": 1, "fillGradient": 0, "gridPos": { - "h": 10, + "h": 5, "w": 12, "x": 0, - "y": 1 + "y": 4 }, "hiddenSeries": false, "id": 2, @@ -116,7 +145,7 @@ "alertThreshold": true }, "percentage": false, - "pluginVersion": "8.0.6", + "pluginVersion": "8.1.4", "pointradius": 2, "points": false, "renderer": "flot", @@ -329,7 +358,8 @@ "value": 80 } ] - } + }, + "unit": "string" }, "overrides": [ { @@ -341,6 +371,14 @@ { "id": "displayName", "value": "Mode" + }, + { + "id": "noValue", + "value": "N/A" + }, + { + "id": "unit", + "value": "string" } ] }, @@ -353,6 +391,14 @@ { "id": "displayName", "value": "Type" + }, + { + "id": "noValue", + "value": "N/A" + }, + { + "id": "unit", + "value": "string" } ] }, @@ -365,6 +411,10 @@ { "id": "displayName", "value": "Entitlements" + }, + { + "id": "noValue", + "value": "N/A" } ] }, @@ -377,16 +427,20 @@ { "id": "displayName", "value": "Logical CPUs" + }, + { + "id": "noValue", + "value": "N/A" } ] } ] }, "gridPos": { - "h": 4, + "h": 5, "w": 12, "x": 12, - "y": 1 + "y": 4 }, "id": 16, "options": { @@ -398,13 +452,13 @@ "calcs": [ "lastNotNull" ], - "fields": "", + "fields": "/.*/", "values": false }, "text": {}, "textMode": "value_and_name" }, - "pluginVersion": "8.0.6", + "pluginVersion": "8.1.4", "targets": [ { "groupBy": [ @@ -416,7 +470,7 @@ }, { "params": [ - "linear" + "previous" ], "type": "fill" } @@ -500,6 +554,7 @@ } ] ], + "slimit": "1", "tags": [ { "key": "hostname", @@ -512,338 +567,21 @@ "timeFrom": null, "timeShift": null, "title": "LPAR Details (IBM Power)", - "type": "stat" - }, - { - "datasource": "${DS_INFLUXDB-SYSMON}", - "fieldConfig": { - "defaults": { - "color": { - "mode": "continuous-GrYlRd" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] - }, - "unit": "none" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "base_disk.iotime" - }, - "properties": [ - { - "id": "displayName", - "value": "I/O Time" - }, - { - "id": "unit", - "value": "ms" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "base_disk.queue" - }, - "properties": [ - { - "id": "displayName", - "value": "Queue" - }, - { - "id": "unit", - "value": "none" - } - ] - } - ] - }, - "gridPos": { - "h": 6, - "w": 4, - "x": 12, - "y": 5 - }, - "id": 19, - "options": { - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true, - "text": {} - }, - "pluginVersion": "8.0.6", - "targets": [ + "transformations": [ { - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "linear" - ], - "type": "fill" + "id": "filterFieldsByName", + "options": { + "include": { + "names": [ + "aix_processor.mode", + "aix_processor.type", + "aix_processor.ent", + "aix_processor.lcpu" + ] } - ], - "measurement": "base_disk", - "orderByTime": "ASC", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "iotime" - ], - "type": "field" - }, - { - "params": [], - "type": "last" - }, - { - "params": [ - "1s" - ], - "type": "non_negative_derivative" - }, - { - "params": [ - "iotime" - ], - "type": "alias" - } - ], - [ - { - "params": [ - "queue" - ], - "type": "field" - }, - { - "params": [], - "type": "last" - }, - { - "params": [ - "queue" - ], - "type": "alias" - } - ] - ], - "tags": [ - { - "key": "hostname", - "operator": "=~", - "value": "/^$hostname$/" - } - ] + } } ], - "timeFrom": null, - "timeShift": null, - "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" }, { @@ -861,10 +599,10 @@ "fill": 1, "fillGradient": 0, "gridPos": { - "h": 10, + "h": 6, "w": 12, "x": 0, - "y": 11 + "y": 9 }, "hiddenSeries": false, "id": 8, @@ -884,7 +622,7 @@ "alertThreshold": true }, "percentage": false, - "pluginVersion": "8.0.6", + "pluginVersion": "8.1.4", "pointradius": 2, "points": false, "renderer": "flot", @@ -1041,54 +779,81 @@ } }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, "datasource": "${DS_INFLUXDB-SYSMON}", "fieldConfig": { "defaults": { - "unit": "binBps" + "color": { + "mode": "continuous-GrYlRd" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "none" }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "base_disk.iotime" + }, + "properties": [ + { + "id": "displayName", + "value": "I/O Time" + }, + { + "id": "unit", + "value": "ms" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "base_disk.queue" + }, + "properties": [ + { + "id": "displayName", + "value": "Queue" + }, + { + "id": "unit", + "value": "none" + } + ] + } + ] }, - "fill": 1, - "fillGradient": 0, "gridPos": { - "h": 10, - "w": 12, + "h": 6, + "w": 4, "x": 12, - "y": 11 + "y": 9 }, - "hiddenSeries": false, - "id": 10, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", + "id": 19, "options": { - "alertThreshold": true + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true, + "text": {} }, - "percentage": false, - "pluginVersion": "8.0.6", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + "pluginVersion": "8.1.4", "targets": [ { - "alias": "$col", "groupBy": [ { "params": [ @@ -1112,7 +877,7 @@ [ { "params": [ - "reads" + "iotime" ], "type": "field" }, @@ -1128,7 +893,7 @@ }, { "params": [ - "reads" + "iotime" ], "type": "alias" } @@ -1136,7 +901,295 @@ [ { "params": [ - "writes" + "queue" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [ + "queue" + ], + "type": "alias" + } + ] + ], + "tags": [ + { + "key": "hostname", + "operator": "=~", + "value": "/^$hostname$/" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "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": 9 + }, + "id": 17, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "8.1.4", + "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, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_INFLUXDB-SYSMON}", + "description": "", + "fieldConfig": { + "defaults": { + "unit": "binBps" + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 15 + }, + "hiddenSeries": false, + "id": 18, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "8.1.4", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$tag_name ($col)", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "name" + ], + "type": "tag" + }, + { + "params": [ + "linear" + ], + "type": "fill" + } + ], + "measurement": "base_network", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "tx_bytes" ], "type": "field" }, @@ -1152,7 +1205,37 @@ }, { "params": [ - "writes" + "tx" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "rx_bytes" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [ + "1s" + ], + "type": "non_negative_derivative" + }, + { + "params": [ + "*-1" + ], + "type": "math" + }, + { + "params": [ + "rx" ], "type": "alias" } @@ -1171,7 +1254,191 @@ "timeFrom": null, "timeRegions": [], "timeShift": null, - "title": "Disk Usage", + "title": "Network I/O", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:248", + "format": "binBps", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "$$hashKey": "object:249", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_INFLUXDB-SYSMON}", + "fieldConfig": { + "defaults": { + "unit": "binBps" + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 15 + }, + "hiddenSeries": false, + "id": 10, + "legend": { + "avg": false, + "current": false, + "hideEmpty": true, + "hideZero": true, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "8.1.4", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": true, + "steppedLine": false, + "targets": [ + { + "alias": "$tag_name ($col)", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "name" + ], + "type": "tag" + }, + { + "params": [ + "linear" + ], + "type": "fill" + } + ], + "measurement": "base_disk", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "read" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [ + "1s" + ], + "type": "non_negative_derivative" + }, + { + "params": [ + "*-1" + ], + "type": "math" + }, + { + "params": [ + "read" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "write" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [ + "1s" + ], + "type": "non_negative_derivative" + }, + { + "params": [ + "write" + ], + "type": "alias" + } + ] + ], + "tags": [ + { + "key": "hostname", + "operator": "=~", + "value": "/^$hostname$/" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Disk Device I/O", "tooltip": { "shared": true, "sort": 0, @@ -1218,23 +1485,25 @@ "datasource": "${DS_INFLUXDB-SYSMON}", "fieldConfig": { "defaults": { - "unit": "binBps" + "unit": "dtdurationms" }, "overrides": [] }, "fill": 1, "fillGradient": 0, "gridPos": { - "h": 11, + "h": 10, "w": 12, "x": 0, - "y": 21 + "y": 24 }, "hiddenSeries": false, - "id": 18, + "id": 24, "legend": { "avg": false, "current": false, + "hideEmpty": true, + "hideZero": true, "max": false, "min": false, "show": true, @@ -1248,7 +1517,7 @@ "alertThreshold": true }, "percentage": false, - "pluginVersion": "8.0.6", + "pluginVersion": "8.1.4", "pointradius": 2, "points": false, "renderer": "flot", @@ -1258,7 +1527,7 @@ "steppedLine": false, "targets": [ { - "alias": "$col", + "alias": "$tag_name($tag_pid)", "groupBy": [ { "params": [ @@ -1268,63 +1537,45 @@ }, { "params": [ - "linear" + "pid" + ], + "type": "tag" + }, + { + "params": [ + "name" + ], + "type": "tag" + }, + { + "params": [ + "null" ], "type": "fill" } ], - "measurement": "base_network", + "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": [ - "txBytes" + "user_time" ], "type": "field" }, { "params": [], - "type": "mean" - }, - { - "params": [ - "1s" - ], - "type": "non_negative_derivative" - }, - { - "params": [ - "tx" - ], - "type": "alias" - } - ], - [ - { - "params": [ - "rxBytes" - ], - "type": "field" + "type": "last" }, { "params": [], - "type": "mean" - }, - { - "params": [ - "1s" - ], - "type": "non_negative_derivative" - }, - { - "params": [ - "rx" - ], - "type": "alias" + "type": "non_negative_difference" } ] ], @@ -1341,7 +1592,7 @@ "timeFrom": null, "timeRegions": [], "timeShift": null, - "title": "Network Usage", + "title": "Running Processes - User Time", "tooltip": { "shared": true, "sort": 0, @@ -1357,8 +1608,7 @@ }, "yaxes": [ { - "$$hashKey": "object:248", - "format": "binBps", + "format": "dtdurationms", "label": null, "logBase": 1, "max": null, @@ -1366,7 +1616,6 @@ "show": true }, { - "$$hashKey": "object:249", "format": "short", "label": null, "logBase": 1, @@ -1380,6 +1629,320 @@ "alignLevel": null } }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_INFLUXDB-SYSMON}", + "description": "", + "fill": 0, + "fillGradient": 0, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 24 + }, + "hiddenSeries": false, + "id": 26, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "8.1.4", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$tag_mount", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "mount" + ], + "type": "tag" + }, + { + "params": [ + "linear" + ], + "type": "fill" + } + ], + "measurement": "base_filesystem", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT ( ( ( last(\"total_bytes\") - last(\"free_bytes\") ) / last(\"total_bytes\")) * 100) AS \"used\" FROM \"base_filesystem\" WHERE (\"hostname\" =~ /^$hostname$/) AND $timeFilter GROUP BY time($__interval), \"mount\" fill(linear)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "free_bytes" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + }, + { + "params": [ + "free" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "total_bytes" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + }, + { + "params": [ + "total" + ], + "type": "alias" + } + ] + ], + "tags": [ + { + "key": "hostname", + "operator": "=~", + "value": "/^$hostname$/" + } + ] + } + ], + "thresholds": [ + { + "$$hashKey": "object:221", + "colorMode": "warning", + "fill": true, + "line": false, + "op": "gt", + "value": 80, + "yaxis": "left" + }, + { + "$$hashKey": "object:227", + "colorMode": "critical", + "fill": true, + "line": false, + "op": "gt", + "value": 90, + "yaxis": "left" + } + ], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Filesystem Usage", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:196", + "decimals": null, + "format": "percent", + "label": "Percentage Used", + "logBase": 1, + "max": "100", + "min": null, + "show": true + }, + { + "$$hashKey": "object:197", + "format": "short", + "label": "Inodes Free", + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "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 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 34 + }, + "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": "last" + } + ] + ], + "tags": [ + { + "key": "hostname", + "operator": "=~", + "value": "/^$hostname$/" + } + ] + } + ], + "title": "Running Processes - Resident Memory", + "transformations": [], + "type": "timeseries" + }, { "datasource": "${DS_INFLUXDB-SYSMON}", "description": "", @@ -1501,10 +2064,10 @@ ] }, "gridPos": { - "h": 11, + "h": 10, "w": 12, "x": 12, - "y": 21 + "y": 34 }, "id": 22, "options": { @@ -1522,7 +2085,7 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "8.0.6", + "pluginVersion": "8.1.4", "targets": [ { "groupBy": [ @@ -1703,281 +2266,14 @@ "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 - User 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 - Resident Memory", - "type": "timeseries" } ], - "refresh": "1m", + "refresh": "30s", "schemaVersion": 30, "style": "dark", - "tags": [], + "tags": [ + "sysmon" + ], "templating": { "list": [ { @@ -2025,5 +2321,5 @@ "timezone": "", "title": "Sysmon - Host Overview", "uid": "QkVPjseMk", - "version": 46 + "version": 62 } \ No newline at end of file diff --git a/doc/Sysmon - Process Explorer-1631263229100.json b/doc/Sysmon - Process Explorer-1632317613366.json similarity index 96% rename from doc/Sysmon - Process Explorer-1631263229100.json rename to doc/Sysmon - Process Explorer-1632317613366.json index 80e64a4..394ef52 100644 --- a/doc/Sysmon - Process Explorer-1631263229100.json +++ b/doc/Sysmon - Process Explorer-1632317613366.json @@ -14,7 +14,7 @@ "type": "grafana", "id": "grafana", "name": "Grafana", - "version": "8.1.2" + "version": "8.1.4" }, { "type": "datasource", @@ -34,6 +34,12 @@ "name": "Table", "version": "" }, + { + "type": "panel", + "id": "text", + "name": "Text", + "version": "" + }, { "type": "panel", "id": "timeseries", @@ -65,9 +71,26 @@ "gnetId": null, "graphTooltip": 0, "id": null, - "iteration": 1631256755587, + "iteration": 1632317604857, "links": [], "panels": [ + { + "datasource": null, + "gridPos": { + "h": 3, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 30, + "options": { + "content": "## Metrics are collected by an agent running inside of each LPAR / VM / Host.\n \n For more information: [bitbucket.org/mnellemann/sysmon](https://bitbucket.org/mnellemann/sysmon)\n ", + "mode": "markdown" + }, + "pluginVersion": "8.1.4", + "transparent": true, + "type": "text" + }, { "collapsed": false, "datasource": null, @@ -75,7 +98,7 @@ "h": 1, "w": 24, "x": 0, - "y": 0 + "y": 3 }, "id": 4, "panels": [], @@ -113,14 +136,14 @@ "h": 6, "w": 12, "x": 0, - "y": 1 + "y": 4 }, "id": 16, "options": { "showHeader": true, "sortBy": [] }, - "pluginVersion": "8.1.2", + "pluginVersion": "8.1.4", "targets": [ { "groupBy": [ @@ -223,7 +246,7 @@ "fieldConfig": { "defaults": { "color": { - "mode": "palette-classic" + "mode": "thresholds" }, "mappings": [], "thresholds": { @@ -268,7 +291,7 @@ "h": 6, "w": 7, "x": 12, - "y": 1 + "y": 4 }, "id": 19, "options": { @@ -286,7 +309,7 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "8.1.2", + "pluginVersion": "8.1.4", "targets": [ { "groupBy": [ @@ -422,7 +445,7 @@ "h": 6, "w": 5, "x": 19, - "y": 1 + "y": 4 }, "id": 26, "options": { @@ -440,7 +463,7 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "8.1.2", + "pluginVersion": "8.1.4", "targets": [ { "groupBy": [ @@ -580,7 +603,7 @@ "h": 11, "w": 12, "x": 0, - "y": 7 + "y": 10 }, "id": 24, "options": { @@ -755,7 +778,7 @@ "h": 11, "w": 12, "x": 12, - "y": 7 + "y": 10 }, "id": 25, "options": { @@ -953,5 +976,5 @@ "timezone": "", "title": "Sysmon - Process Explorer", "uid": "Vjut5mS7k", - "version": 15 + "version": 18 } \ No newline at end of file diff --git a/doc/monitoring-eye-svgrepo-com.png b/doc/monitoring-eye-svgrepo-com.png new file mode 100644 index 0000000..8c022ed Binary files /dev/null and b/doc/monitoring-eye-svgrepo-com.png differ diff --git a/doc/monitoring-eye-svgrepo-com.svg b/doc/monitoring-eye-svgrepo-com.svg new file mode 100644 index 0000000..afac18f --- /dev/null +++ b/doc/monitoring-eye-svgrepo-com.svg @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gradle.properties b/gradle.properties index 03f3c8e..4c9311f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -version=0.1.2 +version=0.1.3 pf4jVersion=3.6.0 slf4jVersion=1.7.32 camelVersion=3.11.2 diff --git a/plugins/os-ibmi/build.gradle b/plugins/os-ibmi/build.gradle index f3624d7..3cbc369 100644 --- a/plugins/os-ibmi/build.gradle +++ b/plugins/os-ibmi/build.gradle @@ -3,5 +3,5 @@ plugins { dependencies { // https://mvnrepository.com/artifact/net.sf.jt400/jt400 - implementation group: 'net.sf.jt400', name: 'jt400', version: '10.6' + implementation group: 'net.sf.jt400', name: 'jt400', version: '10.7' } \ No newline at end of file diff --git a/server/src/main/java/sysmon/server/Application.java b/server/src/main/java/sysmon/server/Application.java index 1b4c8e7..e95b5e7 100644 --- a/server/src/main/java/sysmon/server/Application.java +++ b/server/src/main/java/sysmon/server/Application.java @@ -32,7 +32,7 @@ public class Application implements Callable { private Integer listenPort = 9925; @CommandLine.Option(names = { "-t", "--threads" }, description = "Threads for processing inbound metrics(default: ${DEFAULT-VALUE}).", paramLabel = "") - private Integer threads = 5; + private Integer threads = 1; @CommandLine.Option(names = { "-d", "--debug" }, description = "Enable debugging (default: ${DEFAULT_VALUE}).") private boolean enableDebug = false; diff --git a/server/src/main/java/sysmon/server/ComboResultToPointProcessor.java b/server/src/main/java/sysmon/server/ComboResultToPointProcessor.java index 5cbfbd6..a8c4f33 100644 --- a/server/src/main/java/sysmon/server/ComboResultToPointProcessor.java +++ b/server/src/main/java/sysmon/server/ComboResultToPointProcessor.java @@ -4,19 +4,15 @@ import org.apache.camel.Exchange; import org.apache.camel.Processor; import org.influxdb.dto.BatchPoints; import org.influxdb.dto.Point; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import sysmon.shared.ComboResult; import sysmon.shared.Measurement; import sysmon.shared.MetricResult; -import java.util.List; import java.util.Map; import java.util.concurrent.TimeUnit; public class ComboResultToPointProcessor implements Processor { - private static final Logger log = LoggerFactory.getLogger(ComboResultToPointProcessor.class); private static String influxDbName; ComboResultToPointProcessor(String influxDbName) { @@ -24,22 +20,17 @@ public class ComboResultToPointProcessor implements Processor { } @Override - public void process(Exchange exchange) throws Exception { + public void process(Exchange exchange) { ComboResult comboResult = exchange.getIn().getBody(ComboResult.class); - //MetricResult metricResult = exchange.getIn().getBody(MetricResult.class); - - //log.info("Size of measurements: " + measurementList.size()); BatchPoints.Builder batchPoints = BatchPoints .database(ComboResultToPointProcessor.influxDbName) .precision(TimeUnit.MILLISECONDS); - List results = comboResult.getMetricResults(); - for(MetricResult metricResult : results) { + for(MetricResult metricResult : comboResult.getMetricResults()) { - List measurementList = metricResult.getMeasurements(); - for(Measurement measurement : measurementList) { + for(Measurement measurement : metricResult.getMeasurements()) { Point.Builder point = Point.measurement(metricResult.getName()) .time(metricResult.getTimestamp(), TimeUnit.MILLISECONDS) @@ -65,6 +56,7 @@ public class ComboResultToPointProcessor implements Processor { } batchPoints.point(point.build()); } + } exchange.getIn().setBody(batchPoints.build()); diff --git a/server/src/main/java/sysmon/server/MetricResultToPointProcessor.java b/server/src/main/java/sysmon/server/MetricResultToPointProcessor.java index 7afafd0..70216f5 100644 --- a/server/src/main/java/sysmon/server/MetricResultToPointProcessor.java +++ b/server/src/main/java/sysmon/server/MetricResultToPointProcessor.java @@ -4,8 +4,6 @@ import org.apache.camel.Exchange; import org.apache.camel.Processor; import org.influxdb.dto.BatchPoints; import org.influxdb.dto.Point; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import sysmon.shared.Measurement; import sysmon.shared.MetricResult; @@ -15,7 +13,6 @@ import java.util.concurrent.TimeUnit; public class MetricResultToPointProcessor implements Processor { - private static final Logger log = LoggerFactory.getLogger(MetricResultToPointProcessor.class); private static String influxDbName; MetricResultToPointProcessor(String influxDbName) { diff --git a/server/src/main/java/sysmon/server/ServerRouteBuilder.java b/server/src/main/java/sysmon/server/ServerRouteBuilder.java index 631f9e7..3e50481 100644 --- a/server/src/main/java/sysmon/server/ServerRouteBuilder.java +++ b/server/src/main/java/sysmon/server/ServerRouteBuilder.java @@ -40,18 +40,19 @@ public class ServerRouteBuilder extends RouteBuilder { .setHeader(Exchange.HTTP_RESPONSE_CODE, constant(202)) .setHeader("Content-Type", constant("application/x-www-form-urlencoded")) .to("seda:inbound?discardWhenFull=true") + .setBody(simple("OK, received by server.")) .doCatch(Exception.class) - .log(LoggingLevel.WARN, "Error: ${exception.message}") + .log(LoggingLevel.WARN, "Error: ${exception.message}.") .end() .endRest(); fromF("seda:inbound?concurrentConsumers=%s", threads) - .log(">>> metric: ${header.hostname} - ${body}") + .log("From ${header.hostname}: ${body}.") .doTry() .process(new ComboResultToPointProcessor(dbname)) .toF("influxdb://ref.myInfluxConnection?batch=true") //&retentionPolicy=autogen .doCatch(Exception.class) - .log(LoggingLevel.WARN, "Error: ${exception.message}") + .log(LoggingLevel.WARN, "Error: ${exception.message}.") .end(); } diff --git a/server/src/main/resources/simplelogger.properties b/server/src/main/resources/simplelogger.properties index a2f88ce..ef3458f 100644 --- a/server/src/main/resources/simplelogger.properties +++ b/server/src/main/resources/simplelogger.properties @@ -4,3 +4,5 @@ org.slf4j.simpleLogger.showShortLogName=true org.slf4j.simpleLogger.dateTimeFormat=yyyy-MM-dd HH:mm:ss.SSS org.slf4j.simpleLogger.levelInBrackets=true org.slf4j.simpleLogger.defaultLogLevel=warn +org.slf4j.simpleLogger.showThreadName=false +org.slf4j.simpleLogger.showLogName=false diff --git a/shared/src/main/java/sysmon/shared/ComboResult.java b/shared/src/main/java/sysmon/shared/ComboResult.java index 014dad2..416706a 100644 --- a/shared/src/main/java/sysmon/shared/ComboResult.java +++ b/shared/src/main/java/sysmon/shared/ComboResult.java @@ -28,7 +28,7 @@ public class ComboResult implements Serializable { @Override public String toString() { - return "ComboResult of size: " + metricResults.size(); + return metricResults.size() + " results"; } } diff --git a/shared/src/main/java/sysmon/shared/MetricResult.java b/shared/src/main/java/sysmon/shared/MetricResult.java index 9e92e94..4c64793 100644 --- a/shared/src/main/java/sysmon/shared/MetricResult.java +++ b/shared/src/main/java/sysmon/shared/MetricResult.java @@ -75,28 +75,12 @@ public class MetricResult implements Serializable { } public String toString() { - StringBuilder sb = new StringBuilder(String.format("%s - %s => ", timestamp.toString(), name)); + StringBuilder sb = new StringBuilder(String.format("From %s: ", name)); if(measurements != null && !measurements.isEmpty()) { - + sb.append(String.format("%d measurement(s) ", measurements.size())); for(Measurement m : measurements) { - - sb.append("{ "); - if(m != null && m.getTags() != null) { - for (Map.Entry entry : m.getTags().entrySet()) - sb.append(entry.getKey()).append(": ").append(entry.getValue()).append(", "); - } - sb.append("} "); - - /* - sb.append("[ "); - if(m != null && m.getFields() != null) { - for (Map.Entry entry : m.getFields().entrySet()) - sb.append(entry.getKey()).append(": ").append(entry.getValue()).append(", "); - } - sb.append("] "); - */ - + sb.append(String.format("{ tags: %d, fields: %d } ", m.getTags().size(), m.getFields().size())); } }