Cleanup and updates to README files.

This commit is contained in:
Mark Nellemann 2022-02-16 12:34:51 +01:00
parent 17b8f7f2ab
commit 16525059aa
18 changed files with 23 additions and 62 deletions

View File

@ -1,15 +1,18 @@
# System Monitor
System monitoring solution with support for plugins.
![Sysmon Icon](doc/sysmon.png)
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-320x320.png)
## Components
### Client
### Client / Agent
Runs on your hosts and collects metrics, which are sent to the central *server*.

View File

@ -1,6 +1,6 @@
# Client
# Client / Agent
This is the client component of SysMon. Install on the hosts for which you want to collect metrics.
This is the client component of SysMon. Install on the hosts where you want to collect metrics.
## Installation

1
doc/sysmon.drawio Normal file
View File

@ -0,0 +1 @@
<mxfile host="Electron" modified="2022-02-16T10:59:18.347Z" agent="5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/16.5.1 Chrome/96.0.4664.110 Electron/16.0.7 Safari/537.36" etag="7br3EGAmvduaKIlR3_Vo" version="16.5.1" type="device"><diagram id="JBJC25AnoTCSJF4dnfuA" name="Page-1">3VjLctowFP0aLzuDJfxaBpK0maHNgkXbVUdY149GtlxZDtCvr4RlwNgQUmDIAAwjnSvJ8jlHurYsPM4WnwUpkq+cArPQgC4sfG8hZA8RsvRvQJc14nu4BmKRUtNoA0zTv2DAgUGrlELZaig5ZzIt2mDI8xxC2cKIEHzebhZx1r5qQWLoANOQsC76PaUyMajtBpvAF0jjxFzaR14dyEjT2NxJmRDK51sQfrDwWHAu61K2GAPT5DW81P0e90TXExOQy2M65Ohnsfz2OIVfo/lfET/Cn4n3yYzySlhlbniS5tXCzFguGxoEr3IKeiTbwqN5kkqYFiTU0bkSXmGJzJgJly8gw8RUopSxMWdcrAbCkaO/Gue53MLrj+4sBX+BrYi7+qiImSoICYu9HNhrZpUlgWcgxVI1MR2QY8Qwbmyq8y1pG72SLVVdgxHjpng98oZwVTCcv4N/1OH/7unHrbJv+2327eG16Xc7VANVy99UuZAJj3lO2MMGHbXF2LSZcF4Y8DdIuTR7GakkPyBQPQF91cOkqknySoRw4GbMxiqJiEEeaDfsF0kAIzJ9bc/j7IzjjuGnyzLjucKmIJS9Lmd+sKkDXp/JA9fD5Ewmd+wdk6Nrm9y7JZMPjzS5c02TDzsmf8ojVi3uRx0p1FNBoYvhkqWKcYHf9vis1mYyWwMkfIlXij1XUg0DjQa1OLbzVlaIwA3DvoVBvWA2GJxnYbjBzsKwuwvD7VkX/qXWhdNRST3DRiQnFnKZ1LyqzciNdemelMmME0FLSy9dl2Rak/pfIXdMEZPm8V51KQ+rbMXTu8U9LFyE9gjnzlznTDuaP3hbuN4d7WLK+R3lnmUCorzVBye8k1PQsQpcLKfYpyeVFt3/kWHOmFSCI5MKvmZSCTqmv4v1nZ7k+R2bUwJ+1LuhuKEPs6g/sZ/mbdT2dtC1ttPjbHQxZzu35Oxmo/jY1m5meWve3j1uWL8AX83cp7/wfiRzNweCH9vc3TO2mzA33jnN6TtMO5O5VXVzTrqKbZ0244d/</diagram></mxfile>

BIN
doc/sysmon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

View File

@ -1,6 +1,6 @@
version=0.1.8
pf4jVersion=3.6.0
slf4jVersion=1.7.33
camelVersion=3.14.0
picocliVersion=4.6.2
oshiVersion=6.1.1
version = 0.1.9
pf4jVersion = 3.6.0
slf4jVersion = 1.7.33
camelVersion = 3.14.1
picocliVersion = 4.6.2
oshiVersion = 6.1.2

Binary file not shown.

View File

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

View File

@ -1,6 +1,6 @@
# System Monitor Plugins
Collection of standard sysmon plugins.
Collection of standard sysmon plugins for use with the client.
- [base](os-base/) - Base OS metrics (through [oshi](https://github.com/oshi/oshi))
- [aix](os-aix/) - AIX (and Power) specific metrics

View File

@ -1,6 +1,5 @@
package sysmon.plugins.os_aix;
import org.pf4j.Extension;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import sysmon.shared.Measurement;
@ -47,7 +46,7 @@ public class AixNetstatExtension implements MetricExtension {
return false;
}
if(!PluginHelper.canExecute("netstat")) {
if(PluginHelper.notExecutable("netstat")) {
log.warn("Requires the 'netstat' command.");
return false;
}

View File

@ -47,7 +47,7 @@ public class AixProcessorExtension implements MetricExtension {
return false;
}
if(!PluginHelper.canExecute("lparstat")) {
if(PluginHelper.notExecutable("lparstat")) {
log.warn("Requires the 'lparstat' command.");
return false;
}

View File

@ -4,7 +4,6 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.pf4j.Plugin;
import org.pf4j.PluginWrapper;
import oshi.PlatformEnum;
import oshi.SystemInfo;
import oshi.hardware.HardwareAbstractionLayer;

View File

@ -1,6 +1,5 @@
package sysmon.plugins.os_linux;
import org.pf4j.Extension;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import sysmon.shared.Measurement;
@ -47,7 +46,7 @@ public class LinuxNetstatExtension implements MetricExtension {
return false;
}
if(!PluginHelper.canExecute("netstat")) {
if(PluginHelper.notExecutable("netstat")) {
log.warn("Requires the 'netstat' command.");
return false;
}

View File

@ -20,7 +20,7 @@ public class MetricResultToPointProcessor implements Processor {
}
@Override
public void process(Exchange exchange) throws Exception {
public void process(Exchange exchange) {
MetricResult metricResult = exchange.getIn().getBody(MetricResult.class);
List<Measurement> measurementList = metricResult.getMeasurements();

View File

@ -10,7 +10,7 @@ import sysmon.shared.ComboResult;
public class ServerRouteBuilder extends RouteBuilder {
@Override
public void configure() throws Exception {
public void configure() {
final Registry registry = getContext().getRegistry();
final String dbname = registry.lookupByNameAndType("dbname", String.class);

View File

@ -1,21 +0,0 @@
package sysmon.server.bean;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Objects;
public class Hello implements Processor {
private final static Logger log = LoggerFactory.getLogger(Hello.class);
public void process(Exchange exchange) throws Exception {
String name = exchange.getIn().getHeader("name", String.class);
String msg = "Hello " + Objects.requireNonNull(name, "universe");
log.info(msg);
exchange.getMessage().setBody(msg);
}
}

View File

@ -1,18 +0,0 @@
package sysmon.server.bean;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
public class IncomingMetricProcessor implements Processor {
public void process(Exchange exchange) throws Exception {
//MetricResult payload = exchange.getIn().getBody(MetricResult.class);
//log.info("I am going to send this data to InfluxDB.");
//log.info(payload.toString());
exchange.getMessage().setBody("OK");
}
}

View File

@ -3,7 +3,6 @@ package sysmon.shared;
import java.io.Serializable;
import java.time.Instant;
import java.util.ArrayList;
import java.util.Map;
public class MetricResult implements Serializable {

View File

@ -52,10 +52,10 @@ public class PluginHelper {
}
public static boolean canExecute(String cmd) {
public static boolean notExecutable(String cmd) {
return Stream.of(System.getenv("PATH").split(Pattern.quote(File.pathSeparator)))
.map(Paths::get)
.anyMatch(path -> Files.exists(path.resolve(cmd)));
.noneMatch(path -> Files.exists(path.resolve(cmd)));
}