Skip to content

Instantly share code, notes, and snippets.

@seandavi
Created May 15, 2012 19:17
Show Gist options
  • Select an option

  • Save seandavi/2704329 to your computer and use it in GitHub Desktop.

Select an option

Save seandavi/2704329 to your computer and use it in GitHub Desktop.
Sun Grid Engine qstat to html
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="now"/>
<xsl:template match="/">
<html>
<head>
<title>SGE Qstat Results</title>
<link href="/css/main.css" rel="stylesheet" type="text/css" />
<meta http-equiv="refresh" content="60" />
</head>
<body>
<div id="page">
<div id="content">
<h1>Qstat Results</h1>
<h2>Current Time: <xsl:value-of select="$now"/></h2>
<p>(Updated every 60 seconds)</p>
<h2>Queues</h2>
<table>
<tr>
<th>Name</th>
<th>QType</th>
<th>Slots Used</th>
<th>Slots Reserved</th>
<th>Slots Total</th>
<th>Architecture</th>
<th>Details</th>
</tr>
<xsl:apply-templates select="job_info/queue_info/Queue-List" mode="table"/>
</table>
<h2>Queue Details</h2>
<ul>
<xsl:apply-templates select="job_info/queue_info/Queue-List" mode="detail"/>
</ul>
</div>
<div id="sidebar">
<ul>
<li><h2>Local Links</h2>
<ul>
<li><a href="/infrastructure.html">Our hardware/software infrastructure</a></li>
<li><a href="/~sdavis/">Sean Davis' Home Page</a></li>
<li><a href="/sarcoma/">Sarcoma Gene Expression Database</a></li>
<li><a href="/bioc_mirror/">The NCI Bioconductor Mirror</a></li>
<li><a href="/cran_mirror/">The NCI Cran Mirror</a></li>
<li><a href="/solexa/">Solexa documentation</a></li>
</ul>
</li>
</ul>
</div>
</div>
</body>
<script src="http://static.getclicky.com/js" type="text/javascript"></script>
<script type="text/javascript">clicky.init(147760);</script>
</html>
</xsl:template>
<xsl:template match="Queue-List" mode="table">
<tr>
<td><xsl:value-of select="name"/></td>
<td><xsl:value-of select="qtype"/></td>
<td><xsl:value-of select="slots_used"/></td>
<td><xsl:value-of select="slots_resv"/></td>
<td><xsl:value-of select="slots_total"/></td>
<td><xsl:value-of select="arch"/></td>
<td>
<a>
<xsl:attribute name="href">
<xsl:value-of select="concat('#',name)"/>
</xsl:attribute>
Details
</a>
</td>
</tr>
</xsl:template>
<xsl:template match="Queue-List" mode="detail">
<li>
<a>
<xsl:attribute name="name">
<xsl:value-of select="name"/>
</xsl:attribute>
</a>
<xsl:value-of select="name"/>
<ul>
<xsl:apply-templates select="resource"/>
</ul>
</li>
</xsl:template>
<xsl:template match="resource">
<li>
<xsl:value-of select="@name"/>
<xsl:text>=</xsl:text>
<xsl:value-of select="."/>
</li>
</xsl:template>
</xsl:stylesheet>
#!/bin/bash
SGE_ROOT=/import/cluster/sge6_2u5/
/import/cluster/sge6_2u5/bin/lx24-amd64/qstat -F -xml | xsltproc --stringparam now "`date`" /home/sdavis/cronscripts/qstat.xsl - > /home/www/watson/htdocs/sge/qstat.html
chmod a+r /home/www/watson/htdocs/sge/qstat.html
/import/cluster/sge6_2u5/bin/lx24-amd64/qstat -F -xml > /home/www/watson/htdocs/sge/qstat.xml
chmod a+r /home/www/watson/htdocs/sge/qstat.xml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment