<%@ page import="org.apache.solr.core.SolrCore, org.apache.solr.schema.IndexSchema, java.io.BufferedReader, java.io.File, java.io.FileReader, java.net.InetAddress, java.net.UnknownHostException, java.util.Date"%> <% SolrCore core = SolrCore.getSolrCore(); Integer port = new Integer(request.getServerPort()); IndexSchema schema = core.getSchema(); String collectionName = schema!=null ? schema.getName():"unknown"; String rootdir = "/var/opt/resin3/"+port.toString(); File pidFile = new File(rootdir + "/logs/resin.pid"); String startTime = ""; try { startTime = (pidFile.lastModified() > 0) ? new Date(pidFile.lastModified()).toString() : "No Resin Pid found (logs/resin.pid)"; } catch (Exception e) { out.println(""); out.println("Couldn't open Solr pid file:" + e.toString()); out.println(""); } String hostname="localhost"; try { InetAddress addr = InetAddress.getLocalHost(); // Get IP Address byte[] ipAddr = addr.getAddress(); // Get hostname // hostname = addr.getHostName(); hostname = addr.getCanonicalHostName(); } catch (UnknownHostException e) {} File getinfo = new File(rootdir + "/logs/jvm.log"); %> SOLR

SOLR Thread Dump (<%= collectionName %>)

<%= hostname %> : <%= port.toString() %>
<% Runtime rt = Runtime.getRuntime(); Process p = rt.exec(rootdir + "/getinfo"); p.waitFor(); %>

Exit Value:

<%= p.exitValue() %>

Current Time: <%= new Date().toString() %>
Server Start At: <%= startTime %>
<% BufferedReader in = new BufferedReader(new FileReader(getinfo)); StringBuffer buf = new StringBuffer(); String line; while((line = in.readLine()) != null) { if (line.startsWith("taking thread dump")) { buf = new StringBuffer(); } buf.append(line).append("
"); } %>
Thread Dumps
[All Entries]
Last Entry <%= buf.toString() %>


Return to Admin Page