<?php
require("./total.inc");

session_start();
require("./ninsyou.inc");
if(0 > ninsyou_check(5)){
   exit;
   }



echo "<!DOCTYP:pserver:cvs@dhcvs.ms-n.com:/usr/home/cvsE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>";
echo "<HTML>";
echo "<HEAD>";
echo "<META name='GENERATOR' content='AmBuilder'>";
echo "<META http-equiv='Content-Type' content='text/html; charset=euc-jp'>";
	echo "<title>zither monitorring save info</title>";
echo "</head>";
echo "<body alink='#ff0000' bgcolor='#ffffff' link='#0000ff' text='#000000' vlink='#000080'>";

echo "<pre>";

$ncol1 = "bgcolor=#f0f0d2";
$ncol2 = "bgcolor=#d2f0f0";
$uno = enco($_GET["UNO"]);
$STATUS = enco($_GET["STATUS"]);


if(0 == strcmp($uno, "NON")){
   $uno = 0;
   }

print($font_size);
print($version_name);
print(date("Y m d g i s A"));
print("\n");


$conn = db_connect();
if(!$conn){
   echo "not connection!<br>";
   exit;
   }

$result = db_query($conn, "select * from monitor where uno='$uno'");
if(!$result){
   print("bud query\n");
   exit;
   }

$num = db_num_rows($result);
if($num <= 0){
   print("no data\n");
   exit;
   }

print("\n\n");

echo "<TABLE border=3  WIDTH=50% height=10% BGCOLOR=#e6e8fa>";

while($s < $num){
   $COME = enco_rtrim(db_fetch_Result($result, $s, come));
   $CNAME = enco_rtrim(db_fetch_Result($result, $s, cname));
   $MONITOR = enco_rtrim(db_fetch_Result($result, $s, monitor));
   $SIGN = enco_rtrim(db_fetch_Result($result, $s, sign));
   $PROTO = enco_rtrim(db_fetch_Result($result, $s, proto));
   $COM = db_fetch_Result($result, $s, com);
   $CIP = enco_rtrim(db_fetch_Result($result, $s, cip));
   $PORT = enco_rtrim(db_fetch_Result($result, $s, port));
   $WTIME = enco_rtrim(db_fetch_Result($result, $s, wtime));
   $PINFO = db_fetch_Result($result, $s, pinfo);
   $PRINO = enco_rtrim(db_fetch_Result($result, $s, prino));
   $FREE1 = enco_rtrim(db_fetch_Result($result, $s, free1));
   $FREE2 = enco_rtrim(db_fetch_Result($result, $s, free2));
   $FREE3 = enco_rtrim(db_fetch_Result($result, $s, free3));
   $FREE4 = enco_rtrim(db_fetch_Result($result, $s, free4));
   $UNO = enco_rtrim(db_fetch_Result($result, $s, uno));

   $s++;
   }
db_free_result($result);
db_Close($conn);


$kanshi = $MONITOR .
          "," .
          $SIGN .
          "," .
          $PROTO .
          "," .
          $COM .
          "," .
          $CIP .
          "," .
          $PORT .
          "," .
          $WTIME .
          "," .
          $PINFO .
          "," .
          $PRINO .
          "," .
          $FREE1 .
          "," .
          $FREE2 .
          "," .
          $UNO .
          "," .
          $FREE4 .
          "," ;

$kanshi_data = mb_convert_encoding($kanshi,"EUC-JP");
print("監視データ : $kanshi_data\n");
//$kanshi_data_p = "/usr/local/zither/bin/scan_block_test -d " . "\"" .  $kanshi_data . "\"" . "-m 1 2>&1";
$kanshi_data_p = "/usr/local/zither/bin/scan_block_test -d " . "\"" .  $kanshi_data . "\"" . " -r " . $default_dns  ." -m 1 2>&1";
// print("監視データ2 : $kanshi_data_p\n");

$handle = popen($kanshi_data_p, 'r');
// echo "'$handle'; " . gettype($handle) . "\n";
print("注意！！！この監視テストは実際の監視先から監視テストされているとは限りません\n");
print("\n");
$read = fread($handle, 2096);
$text = mb_convert_encoding($read,"EUC-JP");
echo $text;
pclose($handle);



?>

</pre>
</body>
</html>


