#!/bin/sh



HOSTS="3 10 17 19 20 23 31 32 33 128 130 131 133 134 135 136 137 138 140 142
143 144 145 146 147 148 150 151 152 153 155 156 157 158 160 161"


cat > graph/uptime.html << EOF
<html>
<head><title>Uptime</title></head>
<body>
<style type="text/css">img { border-width: 0 }</style>
<center>
<h1>Uptime</h1>
EOF
cat > graph/load.html << EOF
<html>
<head><title>load</title></head>
<body>
<style type="text/css">img { border-width: 0 }</style>
<center>
<h1>Load average</h1>
EOF
cat > graph/procs.html << EOF
<html>
<head><title>Process count</title></head>
<body>
<style type="text/css">img { border-width: 0 }</style>
<center>
<h1>Process count</h1>
EOF

for i in $HOSTS; do
	IP="10.42.1.$i"
	HOST=`host "$IP"`
	cat >> "graph/uptime.html" << EOF
<a href="$IP/host.html"><img src="$IP/uptime.png" alt="$IP"/></a><br/>
EOF
	cat >> "graph/load.html" << EOF
<a href="$IP/host.html"><img src="$IP/load.png" alt="$IP"/></a><br/>
EOF
	cat >> "graph/procs.html" << EOF
<a href="$IP/host.html"><img src="$IP/procs.png" alt="$IP"/></a><br/>
EOF

	cat > "graph/$IP/host.html" << EOF
<html>
<head><title>$HOST</title></head>
<body>
<style type="text/css">img { border-width: 0 }</style>
<center>
<h1>$HOST</h1>
<img src="uptime.png" alt="uptime"/><br/>
<img src="load.png" alt="load"/><br/>
<img src="procs.png" alt="procs"/><br/>
</center>
</body>
</html>
EOF
done

cat >> graph/uptime.html << EOF
</center>
</body>
</html>
EOF
cat >> graph/load.html << EOF
</center>
</body>
</html>
EOF
cat >> graph/procs.html << EOF
</center>
</body>
</html>
EOF

