1 |
|
<? |
2 |
|
|
3 |
< |
# The report directory, and the number of days to display. |
4 |
< |
$rrddir = "/home/tdb/public_html/rrd"; |
5 |
< |
$rrdwebdir = "/~tdb/rrd"; |
6 |
< |
#$maxDaysShown = 7; |
3 |
> |
# The rrd directory containing the images |
4 |
> |
$imgdir = "/home/tdb/public_html/rrd"; |
5 |
> |
$imgwebdir = "/~tdb/rrd"; |
6 |
|
|
7 |
< |
# Page appearance. |
9 |
< |
$scaleImage = "24hour.gif"; |
7 |
> |
# Page appearance |
8 |
|
$lineColor = "#9999ff"; |
9 |
|
|
10 |
+ |
# tidy up the visual names |
11 |
+ |
function tidyName($machine_name, $string) { |
12 |
+ |
# The name CPU information should be displayed as |
13 |
+ |
if($string == "cpu") { |
14 |
+ |
return "Processor usage"; |
15 |
+ |
} |
16 |
+ |
|
17 |
+ |
# The name Load information should be displayed as |
18 |
+ |
if($string == "load") { |
19 |
+ |
return "System loads"; |
20 |
+ |
} |
21 |
+ |
|
22 |
+ |
# The name Memory information should be displayed as |
23 |
+ |
if($string == "mem") { |
24 |
+ |
return "Memory usage"; |
25 |
+ |
} |
26 |
+ |
|
27 |
+ |
# The name Process information should be displayed as |
28 |
+ |
if($string == "proc") { |
29 |
+ |
return "Processes"; |
30 |
+ |
} |
31 |
+ |
|
32 |
+ |
# The name Swap information should be displayed as |
33 |
+ |
if($string == "swap") { |
34 |
+ |
return "Swap usage"; |
35 |
+ |
} |
36 |
+ |
|
37 |
+ |
# The name User information should be displayed as |
38 |
+ |
if($string == "users") { |
39 |
+ |
return "User counts"; |
40 |
+ |
} |
41 |
+ |
|
42 |
+ |
# Values use for escaping (need to match the perl scripts!) |
43 |
+ |
# / converted to a decimal then hex'd |
44 |
+ |
$hex_slash = "_2f"; |
45 |
+ |
# _ converted to a decimal then hex'd |
46 |
+ |
$hex_underscore = "_5f"; |
47 |
+ |
|
48 |
+ |
# The name Disk information should be displayed as |
49 |
+ |
if(preg_match("/^disk-(\S+)$/", $string, $matches)) { |
50 |
+ |
$string = preg_replace("/$hex_slash/", "/", $matches[1]); |
51 |
+ |
$string = preg_replace("/$hex_underscore/", "#", $string); |
52 |
+ |
return "Disk usage: $string"; |
53 |
+ |
} |
54 |
+ |
|
55 |
+ |
# The name Queue information should be displayed as |
56 |
+ |
if($machine_name == "i-scream-server" && preg_match("/^\d+$/", $string)) { |
57 |
+ |
$readfile = file("/u1/i-scream/rrd/$machine_name/$string.def"); |
58 |
+ |
return "Queue: $readfile[0]"; |
59 |
+ |
} |
60 |
+ |
|
61 |
+ |
# Catch all... don't change it |
62 |
+ |
return "$string"; |
63 |
+ |
} |
64 |
+ |
|
65 |
|
# Files to include |
66 |
|
$titleHTML = "title.inc.php"; |
67 |
|
$bottomHTML = "bottom.inc"; |
68 |
|
$machineNameHTML = "machine_name.inc"; |
69 |
|
$reportHTML = "report.inc"; |
70 |
|
|
18 |
– |
# What are the names of the report files? |
19 |
– |
#$reportLimitsFile = "i-maxmin.txt"; |
20 |
– |
#$reportChartFile = "i-chart.gif"; |
21 |
– |
#$reportChartDataFile = "i-data.txt"; |
22 |
– |
|
71 |
|
# Submission details. |
72 |
|
$formMethod = "GET"; |
73 |
|
$thisPage = "browser2.php"; |
26 |
– |
|
27 |
– |
# Leave this alone unless you know what you're doing ;) |
28 |
– |
$minFileSize = 33; |
74 |
|
|
75 |
|
?> |