-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathcontent2-1.cgi
141 lines (132 loc) · 4.72 KB
/
content2-1.cgi
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
141
###############################################################################
#
# Zen Load Balancer Software License
# This file is part of the Zen Load Balancer software package.
#
# Copyright (C) 2014 SOFINTEL IT ENGINEERING SL, Sevilla (Spain)
#
# This library is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# This library is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this library; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
###############################################################################
print "
<!--Content INI-->
<div id=\"page-content\">
<!--Content Header INI-->
<h2>Monitoring::Graphs</h2>
<!--Content Header END-->
";
#opendir(DIR, "$basedir$img_dir");
#@files = grep(/\_d.png$/,readdir(DIR));
#closedir(DIR);
if ( $action && $action ne "Select Graph type" )
{
print " <div class=\"container_12\">
<div class=\"grid_12\">
<div class=\"box-header\"> Graphs daily, weekly, monthly yearly </div>
<div class=\"box stats\">
";
print '<center><img src="data:image/png;base64,' . &printGraph( $action, "d" ) . '"/></center><br><br>';
print '<center><img src="data:image/png;base64,' . &printGraph( $action, "w" ) . '"/></center><br><br>';
print '<center><img src="data:image/png;base64,' . &printGraph( $action, "m" ) . '"/></center><br><br>';
print '<center><img src="data:image/png;base64,' . &printGraph( $action, "y" ) . '"/></center><br><br>';
print "</div></div></div>";
print "<form method=\"get\" action=\"index.cgi\">";
print "<input type=\"hidden\" name=\"id\" value=\"2-1\">";
print "<input type=\"submit\" value=\"Return\" name=\"return\" class=\"button small\">";
print "</form>";
}
else
{
if ( $graphtype eq "System" )
{
@graphselected[0] = "";
@graphselected[1] = "selected=\"selected\"";
@graphselected[2] = "";
@graphselected[3] = "";
}
elsif ( $graphtype eq "Network" )
{
@graphselected[0] = "";
@graphselected[1] = "";
@graphselected[2] = "selected=\"selected\"";
@graphselected[3] = "";
}
elsif ( $graphtype eq "Farm" )
{
@graphselected[0] = "";
@graphselected[1] = "";
@graphselected[2] = "";
@graphselected[3] = "selected=\"selected\"";
}
else
{
@graphselected[0] = "";
@graphselected[1] = "";
@graphselected[2] = "";
@graphselected[3] = "";
}
print " <div class=\"container_12\">
<div class=\"grid_12\">
<div class=\"box-header\"> $graphtype Graphs daily </div>
<div class=\"box stats\">
";
print "<form method=\"get\" action=\"index.cgi\">";
print "<b>Select the type of Graphs to show</b>";
print "<br>";
print "<select name=\"graphtype\">\n";
print "<option value=\"All\" @graphselected[0]>Show all Graphs</option>";
print "<option value=\"System\" @graphselected[1]>Show system type Graphs</option>";
print "<option value=\"Network\" @graphselected[2]>Show network traffic type Graphs</option>";
print "<option value=\"Farm\" @graphselected[3]>Show farm type Graphs</option>";
print "</select>";
print "<input type=\"hidden\" name=\"id\" value=\"$id\">";
print "<br>";
print "<br>";
print "<input type=\"submit\" value=\"Select Graph type\" name=\"action\" class=\"button small\">";
print "</form>";
print "<br>";
if ( $graphtype =~ /^$/ || $graphtype eq "All" )
{
@gtypes = ( System, Network, Farm );
foreach $gtype ( @gtypes )
{
@graphlist = &getGraphs2Show( $gtype );
foreach $graph ( @graphlist )
{
print "<a href=\"?id=$id&action=$graph\"><center><img src=\"img/icons/small/zoom_in.png\" title=\"More info\"></a>";
print '<img src="data:image/png;base64,' . &printGraph( $graph, "d" ) . '"/>';
print "</center><br><br>";
}
}
}
else
{
@graphlist = &getGraphs2Show( $graphtype );
foreach $graph ( @graphlist )
{
print "<a href=\"?id=$id&action=$graph\"><center><img src=\"img/icons/small/zoom_in.png\" title=\"More info\"></a>";
#print "<img src=\"img/graphs/$graph\"></center><br><br>";
print '<img src="data:image/png;base64,' . &printGraph( $graph, "d" ) . '"/>';
print "</center><br><br>";
}
}
print "</div></div></div>";
}
print "<br class=\"cl\" >";
print " </div>
<!--Content END-->
</div>
</div>
";