Ensure hostname is provided, if it can't be properly detected.
This commit is contained in:
parent
37a822b687
commit
3a89ab42f9
22
README.md
22
README.md
|
@ -4,6 +4,28 @@ 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*.
|
||||
|
||||
|
||||
|
||||
## Known problems
|
||||
|
||||
### Correct timezone and clock
|
||||
|
||||
- Ensure you have **correct timezone and date/time** and NTPd (or similar) running to keep it accurate!
|
||||
|
||||
### Naming collision
|
||||
|
||||
You can't have hosts with the same name, as these cannot be distinguished when metrics are
|
||||
written to InfluxDB (which uses the hostname as key).
|
||||
|
||||
### Renaming hosts
|
||||
|
||||
If you rename a host, the metrics in InfluxDB will still be available by the old hostname, and new metrics will be written with the new hostname. There is no easy way to migrate the old data, but you can delete it easily:
|
||||
|
||||
```text
|
||||
USE sysmon;
|
||||
DELETE WHERE hostname = 'unknown';
|
||||
```
|
||||
|
||||
## Components
|
||||
|
||||
### Client
|
||||
|
|
|
@ -41,8 +41,8 @@ public class Application implements Callable<Integer> {
|
|||
try {
|
||||
hostname = InetAddress.getLocalHost().getHostName();
|
||||
} catch (UnknownHostException e) {
|
||||
log.warn(e.getMessage());
|
||||
hostname = "unknown";
|
||||
System.err.println("Could not detect hostname. Use the '-n' or '--hostname' option to specify it.");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
# System Monitor Plugins
|
||||
|
||||
Collection of sysmon plugins.
|
||||
Collection of standard sysmon plugins.
|
|
@ -2,7 +2,6 @@ package sysmon.shared;
|
|||
|
||||
import org.pf4j.ExtensionPoint;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public interface MetricExtension extends ExtensionPoint {
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ public class PluginHelper {
|
|||
}
|
||||
|
||||
} catch (IOException | InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
log.warn("executeCommand() - exception: " + e.getMessage());
|
||||
}
|
||||
|
||||
return inputStream;
|
||||
|
|
Loading…
Reference in a new issue