diff --git a/solr/core/src/java/org/apache/solr/handler/admin/StatusOp.java b/solr/core/src/java/org/apache/solr/handler/admin/StatusOp.java index 4978201b613..6fcf80a137d 100644 --- a/solr/core/src/java/org/apache/solr/handler/admin/StatusOp.java +++ b/solr/core/src/java/org/apache/solr/handler/admin/StatusOp.java @@ -18,6 +18,8 @@ package org.apache.solr.handler.admin; import java.io.Closeable; +import java.io.File; +import java.nio.file.Path; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -39,6 +41,14 @@ public void execute(CoreAdminHandler.CallInfo it) throws Exception { String reconcile = params.get(CoreAdminParams.RECONCILE_THRESHOLD); boolean isIndexInfoNeeded = Boolean.parseBoolean(null == indexInfo ? "true" : indexInfo); NamedList status = new SimpleOrderedMap<>(); + NamedList nodeStatus = new SimpleOrderedMap<>(); + if (it.handler.coreContainer != null) { + Path solrDataHome = it.handler.coreContainer.getCoreRootDirectory(); + File dataDir = solrDataHome.toFile(); + nodeStatus.add("indexDiskSizeTotal", dataDir.getTotalSpace()); + nodeStatus.add("indexDiskSizeAvailable", dataDir.getUsableSpace()); + } + it.rsp.add("nodeStatus", nodeStatus); Map failures = new HashMap<>(); for (Map.Entry failure : it.handler.coreContainer.getCoreInitFailures().entrySet()) {