Commit 4ca0498d authored by Costin Grigoras's avatar Costin Grigoras
Browse files

Enable self monitoring for JW; use `hostname:pid` as node by default

parent 2922a078
......@@ -79,9 +79,10 @@ public class Monitor implements Runnable {
clusterName = MonitorFactory.getConfigString(component, "cluster_name", cluster);
final String pattern = MonitorFactory.getConfigString(component, "node_name", "${hostname}");
final String pattern = MonitorFactory.getConfigString(component, "node_name", component.startsWith("alien.site.") ? "${hostname}:${pid}" : "${hostname}");
nodeName = Format.replace(pattern, "${hostname}", ConfigUtils.getLocalHostname());
String temp = Format.replace(pattern, "${hostname}", ConfigUtils.getLocalHostname());
nodeName = Format.replace(temp, "${pid}", String.valueOf(MonitorFactory.getSelfProcessID()));
}
/**
......
......@@ -231,6 +231,8 @@ public class JobWrapper implements MonitoringObject, Runnable {
statusSenderThread.start();
logger.log(Level.INFO, "JobWrapper initialised. Running as the following user: " + commander.getUser().getName());
monitor.addMonitoring("JobWrapper", this);
}
@Override
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment