Skip to Content.
Sympa Menu

perfsonar-dev - [GEANT/SA2/E2EMon] r407 - trunk/G2_E2E/G2_E2E_MonitoringSystem/src/Generate_GUI

Subject: perfsonar development work

List archive

[GEANT/SA2/E2EMon] r407 - trunk/G2_E2E/G2_E2E_MonitoringSystem/src/Generate_GUI


Chronological Thread 
  • From:
  • To:
  • Subject: [GEANT/SA2/E2EMon] r407 - trunk/G2_E2E/G2_E2E_MonitoringSystem/src/Generate_GUI
  • Date: Wed, 24 Mar 2010 11:54:04 GMT

Author: dfn.fritz
Date: 2010-03-24 11:54:04 +0000 (Wed, 24 Mar 2010)
New Revision: 407

Modified:

trunk/G2_E2E/G2_E2E_MonitoringSystem/src/Generate_GUI/G2_E2E_GenerateHTML.pm
Log:
Included horizontal view PSANALYSIS-185 and improvement in errorhandling of
IDL PSANALYSIS-193

Modified:
trunk/G2_E2E/G2_E2E_MonitoringSystem/src/Generate_GUI/G2_E2E_GenerateHTML.pm
===================================================================
---
trunk/G2_E2E/G2_E2E_MonitoringSystem/src/Generate_GUI/G2_E2E_GenerateHTML.pm
2010-03-24 11:52:04 UTC (rev 406)
+++
trunk/G2_E2E/G2_E2E_MonitoringSystem/src/Generate_GUI/G2_E2E_GenerateHTML.pm
2010-03-24 11:54:04 UTC (rev 407)
@@ -523,7 +523,12 @@
}
print FH $html_header_A;
print FH "</header>\n";
- print FH "<frameset rows=\"200px,40%,* \">\n";
+ if ( $::SETTINGS_GENERAL {"E2ELINKVIEW"} eq "VERTICAL" ) {
+ print FH "<frameset rows=\"200px,60%,* \">\n";
+ }
+ else {
+ print FH "<frameset rows=\"200px,40%,* \">\n";
+ }
print FH " <frame src=\"".GetE2ELinkFileName( "",
$e2e_link->getE2ELinkID(), "1" )."\" name=\"General\" frameborder=\"0\"
border=\"0\">\n";
print FH " <frame src=\"".GetE2ELinkFileName( "",
$e2e_link->getE2ELinkID(), "2" )."\" name=\"E2ELink\" frameborder=\"0\"
border=\"0\">\n";
print FH " <frame src=\"".GetE2ELinkFileName( "",
$e2e_link->getE2ELinkID(), "3" )."\" name=\"Alarms\" frameborder=\"0\"
border=\"0\">\n";
@@ -573,8 +578,14 @@
. GetE2ELinkFileName( "", $e2e_link->getE2ELinkID(), "2" ) . '">';
print FH $html_header_B;

- print FH GenerateView_E2ELink_Semigraphical("", $e2e_link);
-
+ if ( $::SETTINGS_GENERAL {"E2ELINKVIEW"} eq "VERTICAL" ) {
+ print FH GenerateView_E2ELink_Semigraphical_vertical("", $e2e_link);
+ }
+ else
+ {
+ print FH GenerateView_E2ELink_Semigraphical("", $e2e_link);
+ }
+
print FH $html_trailer;
close FH;
chmod 0664,$html_fileName_view_e2elink_2;
@@ -963,7 +974,342 @@

return $html_content;
}
+################################################################################################
+# Function to create Link Status Page in vertical view
+################################################################################################

+sub GenerateView_E2ELink_Semigraphical_vertical
+{
+ my $pic_pref = shift;
+ my $e2e_link = shift;
+
+ my $pic_ep = $pic_pref . $pic_root . "ep.jpg";
+ my $pic_dp = $pic_pref . $pic_root . "dp.jpg";
+ my $pic_gap = $pic_pref . $pic_root . "gap.png";
+ my $pic_dl = $pic_pref . $pic_root . "Arr_DL_";
+ my $pic_idl = $pic_pref . $pic_root . "Arr_IDL_";
+ my $pic_idpl_left = $pic_pref . $pic_root . "Arr_IDPL_left_";
+ my $pic_idpl_right = $pic_pref . $pic_root . "Arr_IDPL_right_";
+ my $pic_up = "green_vertical.png";
+ my $pic_down = "red_vertical.png";
+ my $pic_degraded = "yellow_vertical.png";
+ my $pic_unknown = "unknown_vertical.png";
+
+ # Write nice semigraphical view for e2e link
+
+ # start the table cols
+ my $last_tp = undef;
+ my $no_cols_dom = 0;
+ my $no_dom_color = 0;
+ my @dom_color = ( "#CCFFFF", "#FFFFCC" );
+
+ my $last_domain = undef;
+ my $bgcolor_gap = "#FF69B4"; # disply all gaps in pink ;-)
+
+ my $html_content = "";
+
+ # write header
+ $html_content .= "<table>\n";
+ $html_content .= "<tr><td bgcolor=#EEEEEE><b>Domain</b></td>";
+ $html_content .= "<td bgcolor=#EEEEEE><b>Link Structure</b></td>";
+ $html_content .= "<td bgcolor=#EEEEEE><b>Type</b></td>";
+ $html_content .= "<td bgcolor=#EEEEEE><b>Local&nbsp;Name</b></td>";
+ $html_content .= "<td bgcolor=#EEEEEE><b>State&nbsp;Oper.</b></td>";
+ $html_content .= "<td bgcolor=#EEEEEE><b>State&nbsp;Admin.</b></td>";
+ $html_content .= "<td bgcolor=#EEEEEE><b>Timestamp</b></td></tr>\n";
+
+ # iterate all involved monitored links sequentially
+ my @e2e_monlinks = @{ $e2e_link->getMonitoredLinks() };
+ foreach my $monlink (@e2e_monlinks) {
+
+ my $topology_point_A = $monlink->getTopologyPointA();
+ my $topology_point_B = $monlink->getTopologyPointB();
+
+ # Handling of error case (gap in E2E link)
+ if ( defined($last_tp) && ( $last_tp != $topology_point_A ) ) {
+
+ # check for new domain
+ if ($last_domain ne $topology_point_A->getAuthoritativeDomain())
+ {
+ $last_domain = $topology_point_A->getAuthoritativeDomain();
+ $no_dom_color = ( $no_dom_color + 1 ) %scalar(@dom_color);
+ $html_content .="<tr><td align=center
bgcolor=".$dom_color[$no_dom_color].">" .
$topology_point_A->getAuthoritativeDomain() . "</td>";
+
+ }
+ else
+ {
+ # no domain change
+ $html_content .= "<tr><td align=center
bgcolor=".$dom_color[$no_dom_color]."></td>";
+ }
+
+ $html_content .= "<td align=center
bgcolor=$bgcolor_gap><img src=$pic_gap></td>";
+ $html_content .= "<td align=center
bgcolor=$bgcolor_gap>Gap</td>";
+ $html_content .= "<td align=center
bgcolor=$bgcolor_gap>-</td>";
+ $html_content .= "<td align=center
bgcolor=$bgcolor_gap>-</td>";
+ $html_content .= "<td align=center
bgcolor=$bgcolor_gap>-</td>" if ($::SETTINGS_GENERAL {"ADMINSTATE"} eq
"SHOW");
+ $html_content .= "<td align=center
bgcolor=$bgcolor_gap>-</td>" if ($::SETTINGS_GENERAL {"TIMESTAMP"} eq "SHOW")
;
+ $html_content .= "</tr>\n";
+
+ }
+
+ # Print TopologyPoint A in Table (either gap or first endpoint of
E2E link)
+ if ( ( !defined($last_tp) ) || ( $last_tp != $topology_point_A ) ) {
+
+ if ( $last_domain ne $topology_point_A->getAuthoritativeDomain()
) {
+ $last_domain = $topology_point_A->getAuthoritativeDomain();
+ $no_dom_color = ( $no_dom_color + 1 ) %scalar(@dom_color);
+ $html_content .= "<tr><td align=center
bgcolor=".$dom_color[$no_dom_color].">" .
$topology_point_A->getAuthoritativeDomain() . " </td>";
+ }
+ else
+ {
+ $html_content .= "<tr><td align=center
bgcolor=".$dom_color[$no_dom_color]."></td>";
+ }
+ $html_content .=
+ "<td align=center><img src="
+ . ( ( $monlink->getTopologyPointA_Role() eq "DEMARCPOINT") ?
$pic_dp : $pic_ep )
+ . "></td>";
+ $html_content .=
+ "<td align=center>"
+ . (
+ ( $monlink->getTopologyPointA_Role() eq "DEMARCPOINT") ?
"Demarc" : "EndPoint" )
+ . "</td>";
+ $html_content .=
+ "<td align=center><b>"
+ . GenerateTopologyPointInfo($topology_point_A)
+ . "</b></td>";
+ $html_content .= "<td align=center>-</td>";
+ $html_content .= "<td align=center>-</td>" if
($::SETTINGS_GENERAL {"ADMINSTATE"} eq "SHOW");
+ $html_content .= "<td align=center>-</td>" if
($::SETTINGS_GENERAL {"TIMESTAMP"} eq "SHOW");
+ $html_content .= "</tr>\n";
+ }
+
+ # Print Link Info in Table
+ my $linktype = $monlink->getLinkType();
+
+ if ( ($linktype eq "DOMAIN_LINK") or ($linktype eq "ID_LINK") ) {
+
+ # change domain
+ if ($linktype eq "ID_LINK" )
+ {
+ # if the link is monitored by the old domain, reset colspan
to 0, else to 1
+ if ($monlink->getMonitoringResponsible() eq $last_domain) {
+ $html_content .= "<tr><td align=center
bgcolor=".$dom_color[$no_dom_color]."></td>";
+ }
+ else {
+ $last_domain = $monlink->getMonitoringResponsible();
+ $no_dom_color = ( $no_dom_color + 1 )
%scalar(@dom_color);
+ $html_content .= "<tr><td align=center
bgcolor=".$dom_color[$no_dom_color].">" .
$monlink->getMonitoringResponsible() . "</td>";
+ }
+ }
+ else
+ {
+ $html_content .= "<tr><td align=center
bgcolor=".$dom_color[$no_dom_color]."></td>";
+ }
+
+ my $pic_link = undef;
+
+ $pic_link = $pic_dl if ($linktype eq "DOMAIN_LINK");
+ $pic_link = $pic_idl if ($linktype eq "ID_LINK");
+
+ $pic_link .= $pic_unknown if ( $monlink->getStateOper eq
"UNKNOWN" );
+ $pic_link .= $pic_up if ( $monlink->getStateOper eq "UP" );
+ $pic_link .= $pic_down if ( $monlink->getStateOper eq "DOWN"
);
+ $pic_link .= $pic_degraded if ( $monlink->getStateOper eq
"DEGRADED" );
+
+ $html_content .= "<td align=center><img src=" . $pic_link .
"></td>";
+ $html_content .=
+ "<td align=center>"
+ . ( $G2_E2E_Enums::enum_display_names{ $monlink->getLinkType }
)
+ . "</td>";
+ $html_content .=
+ "<td align=center>" . $monlink->getLocalName . "</td>";
+ $html_content .=
+ "<td align=center>"
+ . (
+ $G2_E2E_Enums::enum_display_names{ $monlink->getStateOper()
} )
+ . "</td>";
+ if ( $::SETTINGS_GENERAL {"ADMINSTATE"} eq "SHOW" ) {
+ $html_content .=
+ "<td align=center>"
+ . (
+ $G2_E2E_Enums::enum_display_names{ $monlink->getStateAdmin()
} )
+ . "</td>";
+ }
+ if ( $::SETTINGS_GENERAL {"TIMESTAMP"} eq "SHOW" ) {
+ $html_content .= "<td align=center>" .
$monlink->getTimeStamp . "</td>";
+ }
+ $html_content .= "</tr>\n";
+ }
+ # now we have ID Link Partial Info
+ else {
+ my @part_infos = @{ $monlink->getPartialInfos() };
+
+ # change domain after the first part of the link
+
+ my $part_info_A = undef;
+ my $part_info_B = undef;
+ foreach my $info (@part_infos) {
+ $part_info_A = $info
+ if ( $info->getMonitoringResponsible() eq
+ $topology_point_A->getAuthoritativeDomain() );
+ $part_info_B = $info
+ if ( $info->getMonitoringResponsible() eq
+ $topology_point_B->getAuthoritativeDomain() );
+ }
+
+ # write "left part" of the link
+ $html_content .= "<tr><td align=center
bgcolor=".$dom_color[$no_dom_color]."></td>";
+
+ my $pic_link = $pic_idpl_left;
+
+ if ( !defined($part_info_A) ) {
+ $pic_link .= $pic_unknown;
+ $html_content .= "<td align=center><img src=" . $pic_link .
"></td>";
+ $html_content .=
+ "<td align=center>"
+ . ( $G2_E2E_Enums::enum_display_names{
$monlink->getLinkType } )
+ . "</td>";
+ $html_content .= "<td align=center>-</td>";
+ $html_content .= "<td align=center>-</td>";
+ $html_content .= "<td align=center>-</td>" if (
$::SETTINGS_GENERAL {"ADMINSTATE"} eq "SHOW" );
+ $html_content .= "<td align=center>-</td>" if (
$::SETTINGS_GENERAL {"TIMESTAMP"} eq "SHOW" );
+ $html_content .= "</tr>\n";
+ }
+ else {
+ $pic_link .= $pic_unknown
+ if ( $part_info_A->getStateOper eq "UNKNOWN" );
+ $pic_link .= $pic_up if ( $part_info_A->getStateOper eq "UP"
);
+ $pic_link .= $pic_down
+ if ( $part_info_A->getStateOper eq "DOWN" );
+ $pic_link .= $pic_degraded
+ if ( $part_info_A->getStateOper eq "DEGRADED" );
+
+ $html_content .= "<td align=center><img src=" . $pic_link .
"></td>";
+
+ $html_content .=
+ "<td align=center>"
+ . ( $G2_E2E_Enums::enum_display_names{
$monlink->getLinkType } )
+ . "</td>";
+
+ $html_content .=
+ "<td align=center>" . $part_info_A->getLocalName . "</td>";
+ $html_content .=
+ "<td align=center>"
+ . (
+ $G2_E2E_Enums::enum_display_names{ $part_info_A
+ ->getStateOper() } )
+ . "</td>";
+ if ( $::SETTINGS_GENERAL {"ADMINSTATE"} eq "SHOW" ) {
+ $html_content .=
+ "<td align=center>"
+ . (
+ $G2_E2E_Enums::enum_display_names{
$part_info_A->getStateAdmin() } )
+ . "</td>";
+ }
+ if ( $::SETTINGS_GENERAL {"TIMESTAMP"} eq "SHOW" ) {
+ $html_content .=
+ "<td align=center>" . $part_info_A->getTimeStamp .
"</td>";
+ }
+ $html_content .= "</tr>\n";
+ }
+
+ # write "right part" of the link
+# $html_content .= "<tr><td align=center>" .
$part_info_B->getAuthoritativeDomain() . "</td>";
+ $last_domain = $topology_point_B->getAuthoritativeDomain();
+ $no_dom_color = ( $no_dom_color +1 ) % scalar(@dom_color);
+
+ my $pic_link = $pic_idpl_right;
+
+ if ( !defined($part_info_B) ) {
+ $html_content .= "<tr><td align=center
bgcolor=".$dom_color[$no_dom_color].">" . $last_domain ."</td>";
+
+ $pic_link .= $pic_unknown;
+
+ $html_content .= "<td align=center><img src=" . $pic_link .
"></td>";
+
+ $html_content .=
+ "<td align=center>"
+ . ( $G2_E2E_Enums::enum_display_names{
$monlink->getLinkType } )
+ . "</td>";
+ $html_content .= "<td align=center>-</td>";
+ $html_content .= "<td align=center>-</td>";
+ $html_content .= "<td align=center>-</td>" if (
$::SETTINGS_GENERAL {"ADMINSTATE"} eq "SHOW" );
+ $html_content .= "<td align=center>-</td>" if (
$::SETTINGS_GENERAL {"TIMESTAMP"} eq "SHOW" );
+ $html_content .= "</tr>\n";
+ }
+ else {
+ $html_content .= "<tr><td align=center
bgcolor=".$dom_color[$no_dom_color].">" .
$part_info_B->getMonitoringResponsible() . "</td>";
+
+ $pic_link .= $pic_unknown
+ if ( $part_info_B->getStateOper eq "UNKNOWN" );
+ $pic_link .= $pic_up if ( $part_info_B->getStateOper eq "UP"
);
+ $pic_link .= $pic_down
+ if ( $part_info_B->getStateOper eq "DOWN" );
+ $pic_link .= $pic_degraded
+ if ( $part_info_B->getStateOper eq "DEGRADED" );
+
+ $html_content .= "<td align=center><img src=" . $pic_link .
"></td>";
+
+ $html_content .=
+ "<td align=center>"
+ . ( $G2_E2E_Enums::enum_display_names{ $monlink->getLinkType
} )
+ . "</td>";
+
+ $html_content .=
+ "<td align=center>" . $part_info_B->getLocalName . "</td>";
+ $html_content .=
+ "<td align=center>"
+ . (
+ $G2_E2E_Enums::enum_display_names{ $part_info_B
+ ->getStateOper() } )
+ . "</td>";
+ if ( $::SETTINGS_GENERAL {"ADMINSTATE"} eq "SHOW" ) {
+ $html_content .=
+ "<td align=center>"
+ . ( $G2_E2E_Enums::enum_display_names{
$part_info_B->getStateAdmin() } )
+ . "</td>";
+ }
+ if ( $::SETTINGS_GENERAL {"ADMINSTATE"} eq "SHOW" ) {
+ $html_content .=
+ "<td align=center>" . $part_info_B->getTimeStamp . "</td>";
+ }
+ $html_content .= "</tr>\n";
+ }
+
+ }
+
+ # Print TopologyPoint B in Table
+ $html_content .= "<tr><td align=center
bgcolor=".$dom_color[$no_dom_color]."></td>";
+ $html_content .=
+ "<td align=center><img src="
+ . ( ( $monlink->getTopologyPointB_Role() eq "DEMARCPOINT" ) ?
$pic_dp : $pic_ep )
+ . "></td>";
+ $html_content .=
+ "<td align=center>"
+ . ( ( $monlink->getTopologyPointB_Role() eq "DEMARCPOINT") ?
"Demarc" : "EndPoint" )
+ . "</td>";
+ $html_content .=
+ "<td align=center><b>"
+ . GenerateTopologyPointInfo($topology_point_B)
+ . "</b></td>";
+ $html_content .= "<td align=center>-</td>";
+ $html_content .= "<td align=center>-</td>" if ( $::SETTINGS_GENERAL
{"ADMINSTATE"} eq "SHOW" );
+ $html_content .= "<td align=center>-</td>" if ( $::SETTINGS_GENERAL
{"TIMESTAMP"} eq "SHOW" );
+ $html_content .= "</tr>\n";
+
+ $last_tp = $topology_point_B;
+
+ } # end of foreach MonitoredLink
+
+ # end the table cols and rows
+
+# $row_names =~ s#-#-<wbr />#g;
+# $row_time =~ s#T#<wbr />T#g;
+ $html_content .= "</table><br><br>\n";
+
+ return $html_content;
+}
+
# ========================

sub ArrayContains {



  • [GEANT/SA2/E2EMon] r407 - trunk/G2_E2E/G2_E2E_MonitoringSystem/src/Generate_GUI, svn-noreply, 03/24/2010

Archive powered by MHonArc 2.6.16.

Top of Page