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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
<?%
statusfiles = [];
trash = param.usage.shift;
IF param.graphic;
FILTER null;
FOREACH device IN param.usage;
name = reentities(device.first).split('/').last;
free = 100 - device.5;
d = [
[ device.3, device.4],
[ device.5, free],
];
USE my_graph = GD.Graph.pie(200, 150);
label = gettext('Total space');
label = "${label} ${device.0} ${device.2}";
my_graph.set(
label => label,
pie_height => 6,
axislabelclr => 'black',
shadow => 1,
);
my_graph.set_title_font(param.font,8);
my_graph.set_value_font(param.font,8);
my_graph.set_label_font(param.font,6);
file = writefile("status_filesys_${name}.gif", my_graph.plot(d).gif );
statusfiles.push(file);
END;
END;
END;
%?>
<!-- Vitals Template -->
<?% IF param.headingText %?>
<h3><?% param.headingText %?></h3>
<?% END %?>
<?% IF param.graphic %?>
<table border="0" width="95%">
<?% count = 0 %?>
<?% FOREACH file IN statusfiles %?>
<?% IF count % 2 == 0 %?>
<?% IF count > 0 %?>
</tr>
<?% END %?>
<tr>
<?% END %?>
<td colspan=2 align=center>
<img src="<?% file %?>" hspace=5>
</td>
<?% count = count + 1 %?>
<?% END %?>
<?% IF count > 0 %?>
</tr>
<?% END %?><tr>
</table>
<?% ELSE %?>
<table border="0" width="95%">
<tr>
<?% FOREACH field IN trash %?>
<th><?% field %?></th>
<?% END %?>
</tr>
<?% FOREACH zeile IN data %?>
<tr>
<?% FOREACH field IN zeile %?>
<td><?% field %?></td>
<?% END %?>
</tr>
<?% END %?>
</table>
<?% END %?>
|