forked from HPCNow/PHPQstat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheader.php
29 lines (24 loc) · 843 Bytes
/
header.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
include('config.inc.php');
if ($qstat_reduce == "yes") {
if (!file_exists("/tmp/load.xml")) {
exec("./qinfo.sh");
}
$loadcheck = simplexml_load_file("/tmp/load.xml");
$lastepoch = strtotime($loadcheck->last) + ($cache_time * 60);
if ($lastepoch < time() ) {
exec("./qinfo.sh");
$loadcheck = simplexml_load_file("/tmp/load.xml");
}
if ($loadcheck->load == "Not Available") {
echo "<tr><td><b><font color=red>Unable to get load from master server, check snmpd server. </font></b>";
} else {
echo "<tr><td>";
}
if ($loadcheck->check == "yes") {
echo "<b><font color=red>Refresh waiting due to high load. Last refresh: $loadcheck->last - 5 minute load average: $loadcheck->load</font></b></td></tr>";
} else {
echo "Last refresh: $loadcheck->last - 5 minute load average: $loadcheck->load</td></tr>";
}
}
?>