|
@@ -6,11 +6,16 @@ public class UnameCollector extends AbstractMetricCollector implements MetricCol
|
|
|
static final Gauge unameGauge = Gauge.build()
|
|
static final Gauge unameGauge = Gauge.build()
|
|
|
.name("node_uname_info")
|
|
.name("node_uname_info")
|
|
|
.help("Labeled system information as provided by the uname system call")
|
|
.help("Labeled system information as provided by the uname system call")
|
|
|
- .labelNames("domainname", "machine", "nodename", "sysname", "version")
|
|
|
|
|
|
|
+ .labelNames("domainname", "machine", "nodename", "release", "sysname", "version")
|
|
|
.register();
|
|
.register();
|
|
|
|
|
|
|
|
public UnameCollector() {
|
|
public UnameCollector() {
|
|
|
- unameGauge.labels("fp.ltd.nu", "somehostname", "x64", "l4", "l5").set(1);
|
|
|
|
|
|
|
+ unameGauge.labels(this.runCommand("domainname"),
|
|
|
|
|
+ System.getProperty("os.arch"),
|
|
|
|
|
+ this.runCommand("hostname"),
|
|
|
|
|
+ System.getProperty("os.version"),
|
|
|
|
|
+ System.getProperty("os.name"),
|
|
|
|
|
+ this.runCommand("uname -v")).set(1);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public UnameCollector(MetricCollector nextCollector) {
|
|
public UnameCollector(MetricCollector nextCollector) {
|
|
@@ -18,8 +23,6 @@ public class UnameCollector extends AbstractMetricCollector implements MetricCol
|
|
|
this.setNextCollector(nextCollector);
|
|
this.setNextCollector(nextCollector);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // node_uname_info{domainname="(none)",machine="x86_64",nodename="lnx-host-01",release="4.4.0-87-generic",sysname="Linux",version="#110-Ubuntu SMP Tue Jul 18 12:55:35 UTC 2017"} 1
|
|
|
|
|
- // node_uname_info{nodename="get",} 1.0
|
|
|
|
|
public void collectMetric() {
|
|
public void collectMetric() {
|
|
|
// Nothing to be done, call next collector
|
|
// Nothing to be done, call next collector
|
|
|
if (this.getNextCollector() != null) {
|
|
if (this.getNextCollector() != null) {
|