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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
| #!/bin/bash
NS_VSERVER="$1"
HTML_FILE="/srv/www/htdocs/${NS_VSERVER}.html"
cat > $HTML_FILE << EOF
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>$NS_VSERVER - Anzahl Clients nach Datum</title>
<style>
.ns {
margin:0px;padding:0px;
width:100%;
border:1px solid #000000;
-moz-border-radius-bottomleft:0px;
-webkit-border-bottom-left-radius:0px;
border-bottom-left-radius:0px;
-moz-border-radius-bottomright:0px;
-webkit-border-bottom-right-radius:0px;
border-bottom-right-radius:0px;
-moz-border-radius-topright:0px;
-webkit-border-top-right-radius:0px;
border-top-right-radius:0px;
-moz-border-radius-topleft:0px;
-webkit-border-top-left-radius:0px;
border-top-left-radius:0px;
}.ns table{
border-collapse: collapse;
border-spacing: 0;
width:100%;
height:100%;
margin:0px;padding:0px;
}.ns th{
font-size:14px;
font-family:Verdana;
font-weight:bold;
border:1px solid #000000;
border-width:0px 1px 1px 0px;
text-align:left;
padding:7px;
}.ns tr:last-child td:last-child {
-moz-border-radius-bottomright:0px;
-webkit-border-bottom-right-radius:0px;
border-bottom-right-radius:0px;
}
.ns table tr:first-child td:first-child {
-moz-border-radius-topleft:0px;
-webkit-border-top-left-radius:0px;
border-top-left-radius:0px;
}
.ns table tr:first-child td:last-child {
-moz-border-radius-topright:0px;
-webkit-border-top-right-radius:0px;
border-top-right-radius:0px;
}.ns tr:last-child td:first-child{
-moz-border-radius-bottomleft:0px;
-webkit-border-bottom-left-radius:0px;
border-bottom-left-radius:0px;
}.ns tr:hover td{
}
.ns tr:nth-child(odd){ background-color:#aad4ff; }
.ns tr:nth-child(even) { background-color:#ffffff; }.ns td{
vertical-align:middle;
border:1px solid #000000;
border-width:0px 1px 1px 0px;
text-align:left;
padding:7px;
font-size:14px;
font-family:Verdana;
font-weight:normal;
color:#000000;
}.ns tr:last-child td{
border-width:0px 1px 0px 0px;
}.ns tr td:last-child{
border-width:0px 0px 1px 0px;
}.ns tr:last-child td:last-child{
border-width:0px 0px 0px 0px;
}
.ns tr:first-child td{
background:-o-linear-gradient(bottom, #005fbf 5%, #003f7f 100%); background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #005fbf), color-stop(1, #003f7f) );
background:-moz-linear-gradient( center top, #005fbf 5%, #003f7f 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#005fbf", endColorstr="#003f7f"); background: -o-linear-gradient(top,#005fbf,003f7f);
background-color:#005fbf;
border:0px solid #000000;
text-align:center;
border-width:0px 0px 1px 1px;
font-size:14px;
font-family:Verdana;
font-weight:bold;
color:#ffffff;
}
.ns tr:first-child:hover td{
background:-o-linear-gradient(bottom, #005fbf 5%, #003f7f 100%); background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #005fbf), color-stop(1, #003f7f) );
background:-moz-linear-gradient( center top, #005fbf 5%, #003f7f 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#005fbf", endColorstr="#003f7f"); background: -o-linear-gradient(top,#005fbf,003f7f);
background-color:#005fbf;
}
.ns tr:first-child td:first-child{
border-width:0px 0px 1px 0px;
}
.ns tr:first-child td:last-child{
border-width:0px 0px 1px 1px;
}
</style>
</head>
<body>
<h3>NetScaler Vserver $NS_VSERVER - sortiert nach Datum</h1>
<div class="ns">
<table border="1">
<tr>
<th>Datum</th>
<th>Zeit</th>
<th>Anzahl Clients</th>
</tr>
EOF
for line in $( tac /srv/www/${NS_VSERVER}_conntable.log ); do
DATE="$( echo $line | cut -d\; -f1 | cut -d_ -f1 )"
TIME="$( echo $line | cut -d\; -f1 | cut -d_ -f2 )"
CONNECTIONS="$( echo $line | cut -d\; -f2 )"
cat >> $HTML_FILE << EOF
<tr>
<td>$DATE</td>
<td>$TIME</td>
<td>$CONNECTIONS</td>
</tr>
EOF
done
cat >> $HTML_FILE << EOF
</div>
</body>
</html>
EOF
|