"Fossies" - the Fresh Open Source Software Archive

Member "node-runner-0.6.0/html/status-monitor.php" (24 Nov 2004, 23293 Bytes) of package /linux/www/old/node-runner-0.6.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "status-monitor.php" see the Fossies "Dox" file reference documentation.

A hint: This file contains one or more very long lines, so maybe it is better readable using the pure text view mode that shows the contents as wrapped lines within the browser window.


    1 <?
    2 require_once("connect.php");
    3 if (($secure_monitor) && ($_SESSION["isloggedin"] != $glbl_hash)) {
    4     header("Location: ".$nr_url."login.php?referrer=status-monitor.php");
    5     exit;
    6 } else if (($secure_monitor) && ($_SESSION["isloggedin"] == $glbl_hash) && ($_SESSION["isadmin"] != $glbl_hash)) {
    7     header("Location: ".$nr_url);
    8     exit;
    9 }
   10 
   11 
   12 
   13 ####### Get Endpoint Count
   14 unset($server_count);
   15 $query_server_count = "SELECT id FROM objects WHERE server='Y' and enabled='Y'";
   16 $result_server_count = db_query($query_server_count);
   17 $server_count = db_num_rows($result_server_count);
   18 ####### End Endpoint Count
   19 
   20 
   21 ####### Get Total Nodes Count
   22 unset($total_nodes);
   23 $query_nodes_count = "SELECT id FROM objects WHERE enabled='Y'";
   24 $result_nodes_count = db_query($query_nodes_count);
   25 $total_nodes = db_num_rows($result_nodes_count);
   26 ####### End Total Nodes Count
   27 
   28 
   29 ####### Get Oldest Alert Log Data
   30 unset($oldest_data);
   31 $query_oldest = "SELECT time FROM alert_log ORDER BY id ASC LIMIT 1";
   32 $result_oldest = db_query($query_oldest);
   33 list($oldest_timestamp) = db_fetch_array($result_oldest);
   34 $oldest_timestamp = date("F j, Y", $oldest_timestamp);
   35 ####### End Oldest Alert Log Data
   36 
   37 ####### Get Up/Down Percentile
   38 function count_deps($parent) {
   39         GLOBAL $cnt;
   40         // Recursive function to count dependencies
   41         $sql = "SELECT id FROM objects WHERE dependency='$parent'";
   42         $result = db_query($sql);
   43         while ($r = db_fetch_array($result)) {
   44                $cnt++;
   45                count_deps($r['id']);
   46         }
   47 return $cnt;
   48 }
   49 
   50 unset($total_down_count);
   51 $query1 = "SELECT description FROM alert_log WHERE resolved='N'";
   52 $result1 = db_query($query1);
   53   while ($r = db_fetch_array($result1)) {
   54          $description = $r["description"];
   55 
   56          $query1a = "SELECT id FROM objects WHERE enabled='Y' AND description='$description'";
   57          $result1a = db_query($query1a);
   58          list($id1a) = db_fetch_array($result1a);
   59          $cnt = 1;
   60          $total_down_count += count_deps($id1a);
   61   }
   62 
   63 $now = mktime();
   64 $today = date("D", $now);
   65 $mon_time = intval(date("Hi", $now));
   66 unset($now);
   67 
   68 $query2 = "SELECT count(description) FROM objects WHERE enabled='Y' and smon_time<='$mon_time' and emon_time>='$mon_time' and days like '%$today%'";
   69 $result2 = db_query($query2);
   70 list($tmp_total_nodes) = db_fetch_array($result2);
   71 
   72 if ($total_down_count > 0) {
   73   $percent = 100 * (1 - ($total_down_count / $tmp_total_nodes));
   74   $percent = round($percent, 2);
   75   if ($percent < 0) { $percent = 0;  }
   76 } else {
   77   $percent = 100;
   78 }
   79 ####### End Up/Down Percentile
   80 
   81 ####### Query DOWN nodes manually #######
   82 function list_of_includes($dir) {
   83     // Returns array of file names from $dir
   84 
   85     $i=0;
   86       if ($use_dir = @opendir($dir)) {
   87         while (($file = readdir($use_dir)) !== false) {
   88           if (ereg("query_",$file)) {
   89             $includes_arr[$i] = "$file";
   90             $i++;
   91           }
   92         }
   93       closedir($use_dir);
   94     }
   95 
   96     return $includes_arr;
   97 }
   98 
   99 $query_type_includes = list_of_includes($path_to_include);
  100 $queries_type_array = array();
  101 foreach ($query_type_includes as $types) {
  102     include_once($path_to_include.$types);
  103 }
  104 
  105 function query_socket($description, $ipaddress, $port, $query_type, $snmp_comm, $url, $username, $pass, $ptime, $max_attempts) {
  106     GLOBAL $allow_refused;
  107     switch($query_type) {
  108         case "HTTP":
  109           $stat = http_query($description, $ipaddress, $port, $url, $username, $pass, $ptime);
  110           break;
  111         case "ICMP":
  112           $stat = icmp_query($description, $ipaddress, $ptime);
  113           break;
  114         case "TCP":
  115           $stat = tcp_query($description, $ipaddress, $port, $ptime);
  116           break;
  117         case "SNMP":
  118           $stat = snmp_query($description, $ipaddress, $snmp_comm, $ptime);
  119           break;
  120         case "UDP":
  121           $stat = udp_query($description, $ipaddress, $port, $ptime);
  122           break;
  123     }
  124     return $stat;
  125 }
  126 
  127 function mailer($id, $mail_id, $status, $status_msg, $now, $sender, $downtime) {
  128  GLOBAL $detailed_email,$qtime;
  129  $query = "SELECT email FROM mail_group WHERE id='".$mail_id."'";
  130  $result = db_query($query);
  131  while ($r = db_fetch_array($result)) {
  132         $email=$r["email"];
  133         $query_comments = "SELECT description,ipaddress,comments FROM objects WHERE id='".$id."'";
  134         $result_comments = db_query($query_comments);
  135         list($id_description,$id_ipaddress,$id_comments) = db_fetch_array($result_comments);
  136         if ($detailed_email == 1) {
  137 
  138           if ($id_comments) { $comments = "Comments: ".$id_comments; }
  139           $query_affected = "SELECT description FROM objects WHERE dependency='$id'";
  140           $result_affected = db_query($query_affected);
  141           $num_rows_affected = db_num_rows($result_affected);
  142           unset($dir_affected);
  143           if ($num_rows_affected == 0) {
  144               $dir_affected = "NONE";
  145               $affected_cnt = 0;
  146           } else {
  147               $affected_cnt = count_deps($id);
  148               $dir_affected = "\n";
  149               while ($s = db_fetch_array($result_affected)) {
  150                      $each_affected = $s["description"];
  151                      $dir_affected .= $each_affected."\n";
  152               }
  153           }
  154 
  155           if (!$downtime) {
  156               $downtime = "Less than $qtime minute(s)";
  157           } else {
  158               if ($downtime < 60) {
  159                   $downtime = "$downtime Second(s)";
  160               } elseif (($downtime >= 60) && ($downtime < 3600)) {
  161                   $downtime = round($downtime/60, 2) . " Minute(s)";
  162               } else {
  163                   $downtime = round($downtime/3600, 2) . " Hour(s)";
  164               }
  165           }
  166 
  167           if (!$status) {
  168               mail("$email","$id_description DOWN","$status_msg\nIP: $id_ipaddress\n\n$now\n\nDowntime: $downtime\n\nNodes Directly Affected: $dir_affected\nTotal Nodes Affected: $affected_cnt\n\n$comments","From:$sender");
  169           } else {
  170               // Send a different message if up - we don't need as much info when it comes back up.
  171               mail("$email","$id_description UP","$status_msg\n$now\n\nTotal Downtime: $downtime","From:$sender");
  172           }
  173 
  174         } else {
  175           if (!$status) {
  176             $subject = $id_description." DOWN";
  177           } else {
  178             $subject = $id_description." UP";
  179           }
  180           mail("$email","$subject","$status_msg\n$now","From:$sender");
  181         }
  182   }
  183 }
  184 ######## End query of DOWN nodes ########
  185 
  186 
  187 
  188 // If manually polling a node...
  189 if ((strip_tags($_GET["poll"]) == 1) && ($_GET["desc"]) && ($monitor_polling)) {
  190   $poll_desc = strip_tags(rtrim(ltrim($_GET["desc"])));
  191   $query_poll = "SELECT id,description,ipaddress,port,query_type,mail_group,ptime,url,snmp_comm,auth_user,auth_pass FROM objects WHERE description='".$poll_desc."'";
  192   $result_poll = db_query($query_poll);
  193   list($id,$desc,$ip,$port,$query_type,$mail_group,$ptime,$url,$snmp_comm,$http_user,$http_pass) = db_fetch_array($result_poll);
  194   $query_poll2 = "SELECT time,lastnotif FROM alert_log WHERE description='".$desc."' AND resolved='N'";
  195   $result_poll2 = db_query($query_poll2);
  196   list($went_down,$lastnotif) = db_fetch_array($result_poll2);
  197   $poll = query_socket($desc, $ip, $port, $query_type, $snmp_comm, $url, $http_user, $http_pass, $ptime, 1);
  198   if ($poll[0]) {
  199     $downtime = (mktime() - $went_down);
  200     $query2 = "UPDATE alert_log SET downtime='".$downtime."',resolved='Y' WHERE description='".$desc."' AND resolved='N'";
  201     $result2 = db_query($query2);
  202     $stat = $poll[0];
  203     $stat_msg = $poll[1];
  204     $now = date("m-d-Y g:i:s a", mktime());
  205 
  206     if ($firstmail == 0) {
  207       $out = mailer($id, $mail_group, $stat, $stat_msg, $now, $sender, $downtime);
  208     } else if ($firstmail > 0 && ($al_lastnotif > $al_start_time)) {
  209       $out = mailer($id, $mail_group, $stat, $stat_msg, $now, $sender, $downtime);
  210     }
  211 
  212   }
  213 
  214 unset($poll_desc,$poll_time,$desc,$ip,$port,$query_type,$mail_group,$ptime,$url,$snmp_comm,$http_user,$http_pass,$downtime,$went_down,$stat,$stat_msg,$id,$out);
  215 if (!$_GET["iframe"]) { print '<META HTTP-EQUIV="Refresh" CONTENT="0; URL=status-monitor.php">'; }
  216 }
  217 
  218 if (!$_GET["iframe"]) {
  219 echo '
  220 <html>
  221 <head>
  222 <title>Node Runner - Network Dashboard</title>
  223 <link rel="stylesheet" href="style.css" type="text/css">
  224 <script language="Javascript">
  225 function openInfoWindow(url,width,height)  {
  226    window.open(url, "NodeRunnerInfo", "width="+width+",height="+height+",menubar=no,status=no,location=no,toolbar=no,scrollbars=yes,resizable=yes");
  227    return false;
  228 }
  229 </script>
  230 </head>
  231 <body>
  232 <META HTTP-EQUIV="Refresh" CONTENT="'. $dash_refrate .'; URL='.$_SERVER["PHP_SELF"].'">
  233 <table width="100%" border="0" cellspacing="4" cellpadding="4" height="100%">
  234   <tr valign="top">
  235     <td class="dashboard" width="225">';
  236 }
  237     
  238 if (($status_stats == 1) && (!$_GET["iframe"])) {
  239   echo '
  240       <p><font size="2"><b>Node Statistics Snapshot:</b></font></p>
  241 
  242       <div style="border-bottom:1px solid #AD8802;">
  243       &#8226;&nbsp;Current Network Time: <span style="color:#A00000;">'.date("g:i:s a",mktime()).'</span><br>
  244       &#8226; Network Endpoints: '.$server_count.' (Enabled)<br>
  245       &#8226; Non-Endpoints: '.intval($total_nodes - $server_count).' (Enabled)<br>
  246       &#8226;&nbsp;Total Network Nodes: '.$total_nodes.'<br>
  247       <br><br>
  248       &#8226; Node Runner Query Interval: '.$qtime.' Minutes<br>
  249       &#8226;&nbsp;Oldest Historical Data: '.$oldest_timestamp.'<br><br></div>
  250         ';
  251 }
  252 
  253 
  254 
  255 
  256 
  257 // Show currently down
  258 
  259   $query4 = "SELECT id,description,downtime,ipaddress,port,query_type,url FROM alert_log WHERE resolved='N' ORDER BY description ASC";
  260   $result4 = db_query($query4);
  261   $disp_downcount = db_num_rows($result4);
  262   if ($disp_downcount>0) {
  263   $down_desc_array = array();
  264   if (!$_GET["iframe"]) {
  265   echo '<div style="border-bottom:1px solid #AD8802;">
  266         <br><font size="2"><b>Current Outages:</b></font><br><br>
  267        ';
  268   }
  269       $i=1;
  270       while ($r = db_fetch_array($result4)) {
  271              $id = $r["id"];
  272              $description = $r["description"];
  273              if (($truncate_at > 0) && (strlen($description) > ($truncate_at + 3))) {
  274                $trunc_description = substr($description,0,$truncate_at)."...";
  275              } else {
  276                $trunc_description = $description;
  277              }
  278              
  279              array_push($down_desc_array, $trunc_description);
  280 
  281              $desc = urlencode($description);
  282              $downtime = $r["downtime"];
  283              $ipaddress = $r["ipaddress"];
  284              $port = $r["port"];
  285              $query_type = $r["query_type"];
  286              $url = $r["url"];
  287 
  288              if ($monitor_polling) { // polling may be disabled on the status monitor
  289                $out .= '<b>'.$i.'.&nbsp;<a target="_top" style="font-size:12px;text-decoration:none;" href="status-monitor.php?poll=1&desc='. $desc .'">'. $trunc_description .'</a></b><br>';
  290                $out .= '<span style="font-size:10px">(CLICK TO POLL MANUALLY)</span>';
  291              } else {
  292                $out .= '<font color="#A00000"><b>'. $trunc_description .'</b></font><br>';
  293              }
  294 
  295              $out .= '<p><span style="font-size:12px">IP:&nbsp;'. $ipaddress .'&nbsp;-&nbsp;';
  296              if (($query_type == 'SNMP') || ($query_type == 'ICMP')) {
  297                $out .= $query_type;
  298              } else {
  299                $out .= $query_type.'&nbsp;Port:&nbsp;'. $port;
  300              }
  301              $out .= '</span><br>';
  302              $out .= '<span style="font-size:12px">';
  303              if ($downtime < 60) {
  304                $downtime = "Less than $qtime Minute(s)";
  305              } else if (($downtime >= 60) && ($downtime < 3600)) {
  306                $downtime = round($downtime/60, 2) . " Minute(s)";
  307              } else {
  308                $downtime = round($downtime/3600, 2) . " Hour(s)";
  309              }
  310              $out .= 'DOWNTIME: '. $downtime .'</span></p>';
  311              $out .= '<p><span style="font-size:12px">';
  312 
  313              $query4a = "SELECT id FROM objects WHERE description='$description'";
  314              $result4a = db_query($query4a);
  315              list($id4a) = db_fetch_array($result4a);
  316 
  317              $query4b = "SELECT description FROM objects WHERE dependency='$id4a'";
  318              $result4b = db_query($query4b);
  319              $num_rows4b = db_num_rows($result4b);
  320              if ($num_rows4b>0) {
  321                $out .= "DIRECTLY AFFECTED: <a href=\"help.php?topic=status_mon_dir_affect&iid=".$id4a."\" style=\"font-weight:bold;text-decoration:none;\" onClick=\"return(openInfoWindow(\\'help.php?topic=status_mon_dir_affect&iid=".$id4a."\\',300,200))\">".$num_rows4b."</a><br>";
  322                unset($cnt);
  323                $cnt2 = count_deps($id4a);
  324                $out .= "TOTAL AFFECTED: <a href=\"help.php?topic=status_mon_total_affect&iid=".$id4a."\" style=\"font-weight:bold;text-decoration:none;\" onClick=\"return(openInfoWindow(\\'help.php?topic=status_mon_total_affect&iid=".$id4a."\\',500,500))\">". $cnt2 ."</a><br><br><br>";
  325              } else {
  326                $out .= '</span><br>';
  327              }
  328              
  329              $i++;
  330              
  331       } // end while
  332       
  333       if ($_GET["iframe"]) { echo '<html><body bgcolor="#c0c0c0" link="#A00000" alink="#A00000" vlink="#A00000"><span style="font-family:Arial;font-size:12px;">
  334                                    <div id="datacontainer" style="position:absolute;left:1px;top:10px;width:100%" onMouseover="scrollspeed=0" onMouseout="scrollspeed=cache">
  335                                    '.$out.'<br><br>'.$out.'<br><br>'.$out.'
  336                                    </div>
  337                                    <script type="text/javascript">
  338 
  339                                    /***********************************************
  340                                    * IFRAME Scroller script-  Dynamic Drive DHTML code library (www.dynamicdrive.com)
  341                                    * This notice MUST stay intact for legal use
  342                                    * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
  343                                    ***********************************************/
  344 
  345                                    //Specify speed of scroll. Larger=faster (ie: 5)
  346                                    var scrollspeed=cache=2
  347 
  348                                    //Specify intial delay before scroller starts scrolling (in miliseconds):
  349                                    var initialdelay=1000
  350 
  351                                    function initializeScroller(){
  352                                    dataobj=document.all? document.all.datacontainer : document.getElementById("datacontainer")
  353                                    dataobj.style.top="5px"
  354                                    setTimeout("getdataheight()", initialdelay)
  355                                    }
  356 
  357                                    function getdataheight(){
  358                                    thelength=dataobj.offsetHeight
  359                                    if (thelength==0)
  360                                    setTimeout("getdataheight()",10)
  361                                    else
  362                                    scrollDiv()
  363                                    }
  364 
  365                                    function scrollDiv(){
  366                                    dataobj.style.top=parseInt(dataobj.style.top)-scrollspeed+"px"
  367                                    if (parseInt(dataobj.style.top)<thelength*(-1))
  368                                    dataobj.style.top="5px"
  369                                    setTimeout("scrollDiv()",40)
  370                                    }
  371 
  372                                    if (window.addEventListener)
  373                                    window.addEventListener("load", initializeScroller, false)
  374                                    else if (window.attachEvent)
  375                                    window.attachEvent("onload", initializeScroller)
  376                                    else
  377                                    window.onload=initializeScroller
  378 
  379 
  380                                    </script>
  381                                    </span>
  382                                    </body></html>'; }
  383       
  384              if (($disp_downcount>4) && (!$_GET["iframe"])) {
  385                 // Set up scrolling marquee because list will be too long.
  386                 
  387                 echo '
  388                 <script type="text/javascript">
  389 
  390                 /***********************************************
  391                 * IFRAME Scroller script-  Dynamic Drive DHTML code library (www.dynamicdrive.com)
  392                 * This notice MUST stay intact for legal use
  393                 * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
  394                 ***********************************************/
  395 
  396                 //specify path to your external page:
  397                 var iframesrc="'.$_SERVER["PHP_SELF"].'?iframe=1"
  398 
  399                 //You may change most attributes of iframe tag below, such as width and height:
  400                 document.write(\'<iframe id="datamain" src="\'+iframesrc+\'" width="220px" height="430px" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no" allowtransparency="true" background-color="transparent"></iframe>\')
  401 
  402                 </script>
  403                      ';
  404                 
  405              } else if (!$_GET["iframe"]) {
  406                 // Just echo the output.
  407                 echo $out;
  408              }
  409              
  410              
  411 
  412   if (!$_GET["iframe"]) { echo  ' </div>'; }
  413   }
  414 
  415 
  416 
  417 // Show recently failed
  418 
  419 if (($show_recent) && ($disp_downcount <= 3) && (!$_GET["iframe"])) {
  420 
  421   if ($disp_downcount == 3) {
  422     $recent_limit = 1;
  423   } else if ($disp_downcount == 2) {
  424     $recent_limit = 2;
  425   } else if ($disp_downcount == 1) {
  426     $recent_limit = 3;
  427   } else if (!$disp_downcount) {
  428     $recent_limit = 7;
  429   }
  430 
  431     echo  ' <div style="border-bottom:1px solid #AD8802;">
  432            <br><font size="2"><b>Recent Outages:</b></font><br><br>
  433           ';
  434 
  435       $query = "SELECT description,time,downtime FROM alert_log WHERE downtime>0 ORDER BY lastnotif DESC LIMIT ".$recent_limit."";
  436       $result = db_query($query);
  437       while ($r = db_fetch_array($result)) {
  438              $rec_desc = $r["description"];
  439              if (($truncate_at > 0) && (strlen($rec_desc) > ($truncate_at + 3))) {
  440                $trunc_rec_desc = substr($rec_desc,0,$truncate_at)."...";
  441              } else {
  442                $trunc_rec_desc = $rec_desc;
  443              }
  444              $rec_time = $r["time"];
  445              $rec_datetime = date("m-d-Y g:i:s a",$rec_time);
  446              $rec_downtime = $r["downtime"];
  447              if ($rec_downtime < 60) {
  448                $rec_downtime = $rec_downtime.' second(s)';
  449              } elseif (($rec_downtime >= 60) && ($rec_downtime < 3600)) {
  450                $rec_downtime = round($rec_downtime/60, 2) . ' minute(s)';
  451              } else {
  452                $rec_downtime = round($rec_downtime/3600, 2) . ' hour(s)';
  453              }
  454 
  455              echo '<span style="font-size:12px;">&#8226;&nbsp;<span style="font-size:12px;color:#A00000;">'.$trunc_rec_desc.'</span><br>&nbsp;&nbsp;'.$rec_datetime.'<br>
  456                 &nbsp;&nbsp;DOWNTIME: '.$rec_downtime.'<br><br></span>';
  457 
  458       }
  459 
  460     echo  ' </div>';
  461 
  462 }
  463 
  464 
  465 if (!$_GET["iframe"]) {
  466   echo '
  467       </td>
  468       <td valign="top">
  469         <table width="100%" height="100%" bgcolor="#000000">
  470           <tr>';
  471 }
  472 
  473 if (!$percent) {
  474 
  475     $bgcolor = "#FF0000";
  476     $fontcolor = "#FFFFFF";
  477     $comment = "FUBAR";
  478     
  479 } else {
  480 
  481     switch ($percent) {
  482         case ($percent == 100):
  483         $bgcolor = "#00FF00";
  484         $fontcolor = "#000000";
  485         $comment = "BLISS";
  486         break;
  487         case (($percent < 100) && ($percent >= 75)):
  488         $bgcolor = "#FFFF00";
  489         $fontcolor = "#000000";
  490         $comment = "CONCERN";
  491         break;
  492         case (($percent < 75) && ($percent >= 50)):
  493         $bgcolor = "#FF8000";
  494         $fontcolor = "#000000";
  495         $comment = "PANIC";
  496         break;
  497         case ($percent <= 49):
  498         $bgcolor = "#FF0000";
  499         $fontcolor = "#FFFFFF";
  500         $comment = "FUBAR";
  501         break;   
  502     } //end switch
  503     
  504 }
  505 
  506 if (!$_GET["iframe"]) {
  507   echo '
  508         <td valign="middle" bgcolor='. $bgcolor .'><div align="center">
  509         <p><span style="font-size:70px;color:'.$fontcolor.';font-weight:bold;">NETWORK:&nbsp;'. $percent .'%</span></p>
  510         <p><span style="font-size:55px;color:'.$fontcolor.';font-weight:bold;">('. $comment .')</span></p></div>
  511         </td>
  512        </tr>
  513        <tr>
  514        ';
  515 }
  516 
  517 
  518 
  519 if (($percent != 100) && (!$_GET["iframe"])) {
  520 
  521   echo '
  522   <td bgcolor="#FF0000" height="50" align="center" valign="top"><br>
  523 
  524 
  525 <SCRIPT LANGUAGE="JavaScript">
  526 
  527 <!-- This script and many more are available free online at -->
  528 <!-- The JavaScript Source!! http://javascript.internet.com -->
  529 <!-- Original:  Bob Simpson (webmaster@maryjanebrown.net) -->
  530 <!-- Web Site:  http://www.maryjanebrown.net/webmaster -->
  531 
  532 <!-- Begin
  533 var beforeMsg = "<center><span style=\"font-size:55px;color:#FFFFFF;font-weight:bold;\">";
  534 var afterMsg = "</span></center>";
  535 var msgRotateSpeed = 2000; // Rotate delay in milliseconds
  536 var textStr = new Array();';
  537 
  538 $sizeof_down_desc_array = sizeof($down_desc_array);
  539 for ($x=0; $x<$sizeof_down_desc_array; $x++) {
  540      echo 'textStr['.$x.'] = "'.$down_desc_array[$x].'";';
  541 }
  542 
  543 echo '
  544 if (document.layers) {
  545 document.write(\'<ilayer id="NS4message" bgcolor=#FF0000 height=35 width=100%><layer id="NS4message2" height=25 width=100%></layer></ilayer>\')
  546 temp = \'document.NS4message.document.NS4message2.document.write(beforeMsg + textStr[i++] + afterMsg);\'+\'document.NS4message.document.NS4message2.document.close()\';
  547 }
  548 else if (document.getElementById) {
  549 document.write(beforeMsg + \'<div id="message" style="background-color:#FF0000;position:relative;">IE division</div>\' + afterMsg);
  550 temp = \'document.getElementById("message").firstChild.nodeValue = textStr[i++];\';
  551 }
  552 else if (document.all) {
  553 document.write(beforeMsg + \'<div id="message" style="background-color:#FF0000;position:relative;">IE division</div>\' + afterMsg);
  554 temp = \'message.innerHTML = textStr[i++];\';
  555 }
  556 var i = 0;
  557 function msgRotate() {
  558 eval(temp);
  559 if (i == textStr.length) i = 0;
  560 setTimeout("msgRotate()", msgRotateSpeed);
  561 }
  562 window.onload = msgRotate;
  563 //  End -->
  564 </script>
  565 ';
  566 
  567 
  568 
  569 } else if (($percent == 100) && (!$_GET["iframe"])) {
  570 
  571   echo '
  572   <td bgcolor="#FFFFFF" height="50" align="center" valign="top"><br>
  573   
  574         <table width="100%" border="1" cellspacing="0" cellpadding="0" bordercolor="#c0c0c0">
  575          <tr>
  576           <td height="25" bgcolor="#00FF00" width="25%">
  577             <div align="center">100%&nbsp;&nbsp;BLISS</div>
  578           </td>
  579           <td height="25" bgcolor="#FFFF00" width="25%">
  580             <div align="center">99-75%&nbsp;&nbsp;CONCERN</div>
  581           </td>
  582           <td height="25" bgcolor="#FF8000" width="25%">
  583             <div align="center">74-50%&nbsp;&nbsp;PANIC</div>
  584           </td>
  585           <td height="25" bgcolor="#FF0000" width="25%">
  586             <div align="center"><font color="#FFFFFF">49-0%&nbsp;&nbsp;FUBAR</font></div>
  587           </td>
  588          </tr>
  589         </table>
  590        ';
  591 }
  592 
  593 
  594 if (!$_GET["iframe"]) {
  595   echo '
  596           <br><span style="font-size:10px">Powered&nbsp;by&nbsp;<a style="font-size:10px;color:#000000;" href="http://sourceforge.net/projects/node-runner/" target="_blank">Node&nbsp;Runner&nbsp;v'.$nr_ver.'</a>&nbsp;Open&nbsp;Source&nbsp;Network&nbsp;Monitor.&nbsp;&nbsp;This&nbsp;page&nbsp;will&nbsp;refresh&nbsp;every&nbsp;'. $dash_refrate .'&nbsp;seconds.</span>
  597         </td>
  598        </tr>
  599        </table>
  600        </td>
  601      </tr>
  602    </table>
  603    </body>
  604    </html>';
  605 }
  606 
  607 ?>
  608