From 85c66eeb763e204c80c83532d43b8fc388093b73 Mon Sep 17 00:00:00 2001
From: Christopher Milan <chrismilan@ucla.edu>
Date: Fri, 14 Mar 2025 19:41:46 -0700
Subject: [PATCH] add block device report

---
 blk.cgi    | 35 +++++++++++++++++++++++++++++++++++
 index.html |  1 +
 2 files changed, 36 insertions(+)
 create mode 100755 blk.cgi

diff --git a/blk.cgi b/blk.cgi
new file mode 100755
index 0000000..cf7021b
--- /dev/null
+++ b/blk.cgi
@@ -0,0 +1,35 @@
+#!/usr/bin/rrdcgi
+<RRD::SETENV TZ America/Los_Angeles>
+<html>
+<head><title>Cluster Block Device Report</title></head>
+<body style="background-image: url('/bg.gif')">
+<h1>Cluster Block Device Report</h1>
+<RRD::GRAPH gpu1h.png --title="IO Metrics, Last Hour"
+  -s -1hr -w 560 -h 240 -S 120s -z
+  --vertical-label "Bytes/s"
+  DEF:ts=/www/stats/temescal/blk.rrd:r_sectors:AVERAGE
+  DEF:ys=/www/stats/ynez/blk.rrd:r_sectors:AVERAGE
+  DEF:ss=/www/stats/serrano/blk.rrd:r_sectors:AVERAGE
+  CDEF:t=ts,512,*
+  CDEF:y=ys,512,*
+  CDEF:s=ss,512,*
+  VDEF:curt=t,LAST    VDEF:cury=y,LAST    VDEF:curs=s,LAST
+  VDEF:avgt=t,AVERAGE VDEF:avgy=y,AVERAGE VDEF:avgs=s,AVERAGE
+  VDEF:maxt=t,MAXIMUM VDEF:maxy=y,MAXIMUM VDEF:maxs=s,MAXIMUM
+  COMMENT:"               Current    Average    Maximum\l"
+  LINE2:t#FF0099:"Temescal"       GPRINT:curt:"%5.0lf %SB/s" GPRINT:avgt:"%5.0lf %SB/s" GPRINT:maxt:"%5.0lf %SB/s\l"
+  LINE2:y#66CC00:"Ynez    "       GPRINT:cury:"%5.0lf %SB/s" GPRINT:avgy:"%5.0lf %SB/s" GPRINT:maxy:"%5.0lf %SB/s\l"
+  LINE2:s#6600CC:"Serrano "       GPRINT:curs:"%5.0lf %SB/s" GPRINT:avgs:"%5.0lf %SB/s" GPRINT:maxs:"%5.0lf %SB/s\l">
+<footer style="text-align:center">
+<hr />
+<a href="https://acme.com/software/thttpd/"><img src="/badges/thttpd.gif" alt="powered by thttpd" height="31" width="88"></a>
+<a href="https://www.freebsd.org/"><img src="/badges/freebsd.gif" alt="powered by FreeBSD" height="31" width="88"></a>
+<a href="//cherf.ais-ucla.org/"><img src="/badges/cherf.gif" alt="powered by cherf" height="31" width="88"></a>
+<address>
+&copy; 2025 Christopher Milan
+<br />
+<a href="/">stats.ais-ucla.org</a>
+</address>
+</footer>
+</body>
+</html>
diff --git a/index.html b/index.html
index 6f81b06..a74d0e3 100644
--- a/index.html
+++ b/index.html
@@ -12,6 +12,7 @@
       <li><a href=/cpu.cgi>CPU Report</a></li>
       <li><a href=/mem.cgi>Memory Report</a></li>
       <li><a href=/gpu.cgi>GPU Report</a></li>
+      <li><a href=/blk.cgi>Block Device Report</a></li>
     </ul>
   </main>
   <footer style="text-align: center">
-- 
2.43.0