-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-svn-id: http://www.observium.org/svn/observer/trunk@2814 61d68cd4-352d-0410-923a-c4978735b2b8
- Loading branch information
adama
committed
Jan 12, 2012
1 parent
c4972c1
commit 6a29f36
Showing
22 changed files
with
15,929 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
ALTER TABLE `bills` CHANGE `bill_cdr` `bill_cdr` BIGINT( 20 ) NULL DEFAULT NULL; | ||
CREATE TABLE IF NOT EXISTS `loadbalancer_rservers` ( `rserver_id` int(11) NOT NULL AUTO_INCREMENT, `farm_id` varchar(128) CHARACTER SET utf8 NOT NULL, `device_id` int(11) NOT NULL, `StateDescr` varchar(64) CHARACTER SET utf8 NOT NULL, PRIMARY KEY (`rserver_id`)) ENGINE=MyISAM AUTO_INCREMENT=514 DEFAULT CHARSET=utf8 | ||
CREATE TABLE IF NOT EXISTS `loadbalancer_vservers` ( `classmap_id` int(11) NOT NULL, `classmap` varchar(128) NOT NULL, `serverstate` varchar(64) NOT NULL, `device_id` int(11) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
if (is_numeric($id)) | ||
{ | ||
# $auth= TRUE; | ||
$rserver = dbFetchRow("SELECT * FROM `loadbalancer_rservers` AS I, `devices` AS D WHERE I.rserver_id = ? AND I.device_id = D.device_id", array($id)); | ||
|
||
if (is_numeric($rserver['device_id']) && ($config['allow_unauth_graphs'] || device_permitted($rserver['device_id']))) | ||
{ | ||
$device = device_by_id_cache($rserver['device_id']); | ||
|
||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("rserver-".$rserver['rserver_id'].".rrd"); | ||
|
||
$title = generate_device_link($device); | ||
$title .= " :: Rserver :: " . htmlentities($rserver['farm_id']); | ||
$auth = TRUE; | ||
} | ||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
##$ds_in = "RserverCurrentConns"; | ||
##$ds_out = "RserverTotalConns"; | ||
|
||
##include("includes/graphs/generic_bytes.inc.php"); | ||
|
||
#$ds = "RserverCurrentConns"; | ||
|
||
#$colour_area = "B0C4DE"; | ||
#$colour_line = "191970"; | ||
|
||
#$colour_area_max = "FFEE99"; | ||
|
||
#$graph_max = 1; | ||
|
||
#$unit_text = "Conns"; | ||
|
||
#include("includes/graphs/generic_simplex.inc.php"); | ||
|
||
|
||
$scale_min = 0; | ||
|
||
include("includes/graphs/common.inc.php"); | ||
$graph_max = 1; | ||
|
||
$ds = "RserverCurrentConns"; | ||
|
||
$colour_area = "B0C4DE"; | ||
$colour_line = "191970"; | ||
|
||
$colour_area_max = "FFEE99"; | ||
|
||
|
||
$nototal = 1; | ||
$unit_text = "Conns"; | ||
|
||
include("includes/graphs/generic_simplex.inc.php"); | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
$scale_min = 0; | ||
|
||
include("includes/graphs/common.inc.php"); | ||
$graph_max = 1; | ||
|
||
$ds = "RserverCurrentConns"; | ||
|
||
$colour_area = "B0C4DE"; | ||
$colour_line = "191970"; | ||
|
||
$colour_area_max = "FFEE99"; | ||
|
||
|
||
$nototal = 1; | ||
$unit_text = "Conns"; | ||
|
||
include("includes/graphs/generic_simplex.inc.php"); | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
$scale_min = 0; | ||
|
||
include("includes/graphs/common.inc.php"); | ||
$graph_max = 1; | ||
|
||
$ds = "RserverTotalConns"; | ||
|
||
$colour_area = "B0C4DE"; | ||
$colour_line = "191970"; | ||
|
||
$colour_area_max = "FFEE99"; | ||
|
||
|
||
$nototal = 1; | ||
$unit_text = "Conns"; | ||
|
||
include("includes/graphs/generic_simplex.inc.php"); | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
if (is_numeric($id)) | ||
{ | ||
# $auth= TRUE; | ||
$vserver = dbFetchRow("SELECT * FROM `loadbalancer_vservers` AS I, `devices` AS D WHERE I.classmap_id = ? AND I.device_id = D.device_id", array($id)); | ||
|
||
if (is_numeric($vserver['device_id']) && ($config['allow_unauth_graphs'] || device_permitted($vserver['device_id']))) | ||
{ | ||
$device = device_by_id_cache($vserver['device_id']); | ||
|
||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("vserver-".$vserver['classmap_id'].".rrd"); | ||
|
||
$title = generate_device_link($device); | ||
$title .= " :: Serverfarm :: " . htmlentities($vserver['classmap_id']); | ||
$auth = TRUE; | ||
} | ||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
#include("includes/graphs/common.inc.php"); | ||
|
||
|
||
$ds_in = "ByteCounts"; | ||
$ds_out = "ClientByteCounts"; | ||
|
||
include("includes/graphs/generic_bytes.inc.php"); | ||
#include("includes/graphs/generic_duplex.inc.php"); | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
$scale_min = 0; | ||
|
||
include("includes/graphs/common.inc.php"); | ||
$graph_max = 1; | ||
|
||
$ds = "NumberOfConnections"; | ||
|
||
$colour_area = "B0C4DE"; | ||
$colour_line = "191970"; | ||
|
||
$colour_area_max = "FFEE99"; | ||
|
||
|
||
$nototal = 1; | ||
$unit_text = "Conns"; | ||
|
||
include("includes/graphs/generic_simplex.inc.php"); | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
$ds_in = "PacketCounts"; | ||
$ds_out = "ClientPacketCounts"; | ||
|
||
$colour_area_in = "AA66AA"; | ||
$colour_line_in = "330033"; | ||
$colour_area_out = "FFDD88"; | ||
$colour_line_out = "FF6600"; | ||
|
||
$colour_area_in_max = "cc88cc"; | ||
$colour_area_out_max = "FFefaa"; | ||
|
||
$graph_max = 1; | ||
$unit_text = "Packets"; | ||
|
||
include("includes/graphs/generic_duplex.inc.php"); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
<?php | ||
|
||
print_optionbar_start(); | ||
|
||
echo("<span style='font-weight: bold;'>Serverfarm Rservers</span> » "); | ||
|
||
#$auth = TRUE; | ||
|
||
$menu_options = array('basic' => 'Basic', | ||
); | ||
|
||
if (!$_GET['opta']) { $_GET['opta'] = "basic"; } | ||
|
||
$sep = ""; | ||
foreach ($menu_options as $option => $text) | ||
{ | ||
if ($_GET['optd'] == $option) { echo("<span class='pagemenu-selected'>"); } | ||
echo('<a href="device/device=' . $device['device_id'] . '/tab=routing/proto=loadbalancer_rservers/' . $option . '/">' . $text | ||
. '</a>'); | ||
if ($_GET['optd'] == $option) { echo("</span>"); } | ||
echo(" | "); | ||
} | ||
|
||
unset($sep); | ||
|
||
echo(' Graphs: '); | ||
|
||
#$graph_types = array("bits" => "Bits", | ||
# "pkts" => "Packets", | ||
# "errors" => "Errors"); | ||
|
||
$graph_types = array("curr" => "CurrentConns", | ||
"failed" => "FailedConns", | ||
"total" => "TotalConns"); | ||
|
||
foreach ($graph_types as $type => $descr) | ||
{ | ||
echo("$type_sep"); | ||
if ($_GET['opte'] == $type) { echo("<span class='pagemenu-selected'>"); } | ||
echo('<a href="device/device=' . $device['device_id'] . '/tab=routing/proto=loadbalancer_rservers/graphs/'.$type.'/">'.$descr.'</a>'); | ||
if ($_GET['opte'] == $type) { echo("</span>"); } | ||
|
||
$type_sep = " | "; | ||
} | ||
|
||
print_optionbar_end(); | ||
|
||
echo("<div style='margin: 5px;'><table border=0 cellspacing=0 cellpadding=0 width=100%>"); | ||
$i = "0"; | ||
foreach (dbFetchRows("SELECT * FROM `loadbalancer_rservers` WHERE `device_id` = ? ORDER BY `farm_id`", array($device['device_id'])) as $rserver) | ||
{ | ||
if (is_integer($i/2)) { $bg_colour = $list_colour_a; } else { $bg_colour = $list_colour_b; } | ||
|
||
if($rserver['StateDescr'] == "Server is now operational") { $rserver_class="green"; } else { $rserver_class="red"; } | ||
|
||
echo("<tr bgcolor='$bg_colour'>"); | ||
#echo("<td width=320 class=list-large>" . $tunnel['local_addr'] . " » " . $tunnel['peer_addr'] . "</a></td>"); | ||
echo("<td width=700 class=list-small>" . $rserver['farm_id'] . "</a></td>"); | ||
#echo("<td width=150 class=box-desc>" . $rserver['farm_id'] . "</td>"); | ||
echo("<td width=230 class=list-small><span class='".$rserver_class."'>" . $rserver['StateDescr'] . "</span></td>"); | ||
echo("</tr>"); | ||
if ($_GET['optd'] == "graphs") | ||
{ | ||
echo('<tr class="list-bold">'); | ||
echo("<td colspan = 3>"); | ||
$graph_type = "rserver_" . $_GET['opte']; | ||
|
||
$graph_array['height'] = "100"; | ||
$graph_array['width'] = "215"; | ||
$graph_array['to'] = $config['time']['now']; | ||
$graph_array['id'] = $rserver['rserver_id']; | ||
$graph_array['type'] = $graph_type; | ||
|
||
include("includes/print-quadgraphs.inc.php"); | ||
#include("includes/print-interface-graphs.inc.php"); | ||
|
||
echo(" | ||
</td> | ||
</tr>"); | ||
} | ||
|
||
echo("</td>"); | ||
echo("</tr>"); | ||
|
||
$i++; | ||
} | ||
|
||
echo("</table></div>"); | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<?php | ||
|
||
print_optionbar_start(); | ||
|
||
echo("<span style='font-weight: bold;'>Serverfarms</span> » "); | ||
|
||
#$auth = TRUE; | ||
|
||
$menu_options = array('basic' => 'Basic', | ||
); | ||
|
||
if (!$_GET['opta']) { $_GET['opta'] = "basic"; } | ||
|
||
$sep = ""; | ||
foreach ($menu_options as $option => $text) | ||
{ | ||
if ($_GET['optd'] == $option) { echo("<span class='pagemenu-selected'>"); } | ||
echo('<a href="device/device=' . $device['device_id'] . '/tab=routing/proto=loadbalancer_vservers/' . $option . '/">' . $text | ||
. '</a>'); | ||
if ($_GET['optd'] == $option) { echo("</span>"); } | ||
echo(" | "); | ||
} | ||
|
||
unset($sep); | ||
|
||
echo(' Graphs: '); | ||
|
||
$graph_types = array("bits" => "Bits", | ||
"pkts" => "Packets", | ||
"conns" => "Connections"); | ||
|
||
|
||
foreach ($graph_types as $type => $descr) | ||
{ | ||
echo("$type_sep"); | ||
if ($_GET['opte'] == $type) { echo("<span class='pagemenu-selected'>"); } | ||
echo('<a href="device/device=' . $device['device_id'] . '/tab=routing/proto=loadbalancer_vservers/graphs/'.$type.'/">'.$descr.'</a>'); | ||
if ($_GET['opte'] == $type) { echo("</span>"); } | ||
|
||
$type_sep = " | "; | ||
} | ||
|
||
print_optionbar_end(); | ||
|
||
echo("<div style='margin: 5px;'><table border=0 cellspacing=0 cellpadding=0 width=100%>"); | ||
$i = "0"; | ||
foreach (dbFetchRows("SELECT * FROM `loadbalancer_vservers` WHERE `device_id` = ? ORDER BY `classmap`", array($device['device_id'])) as $vserver) | ||
{ | ||
if (is_integer($i/2)) { $bg_colour = $list_colour_a; } else { $bg_colour = $list_colour_b; } | ||
|
||
if($vserver['serverstate'] == "inService") { $vserver_class="green"; } else { $vserver_class="red"; } | ||
|
||
echo("<tr bgcolor='$bg_colour'>"); | ||
#echo("<td width=320 class=list-large>" . $tunnel['local_addr'] . " » " . $tunnel['peer_addr'] . "</a></td>"); | ||
echo("<td width=700 class=list-small>" . $vserver['classmap'] . "</a></td>"); | ||
#echo("<td width=150 class=box-desc>" . $rserver['farm_id'] . "</td>"); | ||
echo("<td width=230 class=list-small><span class='".$vserver_class."'>" . $vserver['serverstate'] . "</span></td>"); | ||
echo("</tr>"); | ||
if ($_GET['optd'] == "graphs") | ||
{ | ||
echo('<tr class="list-bold">'); | ||
echo("<td colspan = 3>"); | ||
$graph_type = "vserver_" . $_GET['opte']; | ||
|
||
$graph_array['height'] = "100"; | ||
$graph_array['width'] = "215"; | ||
$graph_array['to'] = $config['time']['now']; | ||
$graph_array['id'] = $vserver['classmap_id']; | ||
$graph_array['type'] = $graph_type; | ||
|
||
include("includes/print-quadgraphs.inc.php"); | ||
|
||
echo(" | ||
</td> | ||
</tr>"); | ||
} | ||
|
||
echo("</td>"); | ||
echo("</tr>"); | ||
|
||
$i++; | ||
} | ||
|
||
echo("</table></div>"); | ||
|
||
?> |
Oops, something went wrong.