<?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>";


print("<body alink='#ff0000' bgcolor='$my_bgcolor' link='#0000ff' text='#000000' vlink='#000080'>\n");

print("<TABLE border='0' bgcolor='FFA500' cellspacing='3' cellpadding='0' width=100%>\n");
print("<tr><td align=left><font color='ffffff'><b>　監視設定 -> 作成編集</b></font></td></tr>\n");
print("</table>\n");


$COME = enco($_GET["COME"]);
$CNAME = enco($_GET["CNAME"]);
$MONITOR = enco($_GET["MONITOR"]);
$SIGN = enco($_GET["SIGN"]);
$PROTO = enco($_GET["PROTO"]);
$COM = enco($_GET["COM"]);
$CIP = enco($_GET["CIP"]);
$PORT = enco($_GET["PORT"]);
$WTIME = enco($_GET["WTIME"]);
$PINFO = enco($_GET["PINFO"]);
$PRINO = enco($_GET["PRINO"]);
$FREE1 = enco($_GET["FREE1"]);
$FREE2 = enco($_GET["FREE2"]);
$FREE3 = enco($_GET["FREE3"]);
$FREE4 = enco($_GET["FREE4"]);

if(0 == strlen($COME)){ $COME = "OFF"; }
if(0 == strlen($FREE4)){
   print("NOT block name");
   exit;
   }
if(0 == strlen($SIGN)){ $SIGN = "0"; }
if(0 == strlen($MONITOR)){
   print("NOT monitor");
   exit;
   }
if(0 == strlen($COM)){ $COM = "NOT"; }
if(0 == strlen($CIP)){ $CIP = "NOT"; }
if(0 == strlen($CNAME)){ $CNAME = "NOT"; }
if(0 == strlen($PORT)){ $PORT = "0"; }
if(0 == strlen($PROTO)){ $PROTO = "NOT"; }
if(0 == strlen($WTIME)){ $WTIME = "7"; }
if(0 == strlen($PINFO)){ $PINFO = "NOT"; }
if(0 == strlen($PRINO)){ $PRINO = "4"; }
if(0 == strlen($FREE1)){ $FREE1 = "NOT"; }
if(0 == strlen($FREE2)){ $FREE2 = "NOT"; }
if(0 == strlen($FREE3)){ $FREE3 = "NOT"; }
if(0 == strlen($FREE4)){ $FREE4 = "DEFAULT"; }


$CNAME = cname_return($FREE4);
if(0 >= strlen($CNAME)){
   echo "not cname return!<br>";
   exit;
   }


echo "<pre>";
print($font_size);
print($version_name);
print(date("Y m d g i s A"));
print("\n");
print("新しい監視項目を $cname に追加します  \n\n");


echo "\n";
echo "<FORM METHOD=GET ACTION='monitor_upnew.php' target='dels'>";

echo "<TABLE cellspacing=0 cellpadding=3 nowrap border=1 Bordercolor='$my_bocolor' nowrap border=0 WIDTH='790' height='8%'BGCOLOR='#e6e8fa'>";

echo "<tr><td>";
echo "監視をオン、オフ \n";
echo "</td><td>";
echo "<select size=1 name=COME>";
echo "<option value=$COME selected>$COME";
echo "<option value=ON>ON";
echo "<option value=OFF>OFF";
echo "</select>";
echo "</td></tr>";

// echo "<tr bgcolor='#D9DBED'><td>";
// echo "監視クライアントのホスト名\n";
// echo "</td><td>";
// echo "<INPUT type='text' NAME=CNAME size='24' value='$CNAME'>";
// echo "$CNAME";
// echo "</td></tr>";

echo "<tr><td>";
echo "監視形態の属性、コマンド、ポート SNMP\n";
echo "</td><td>";
echo "<INPUT type='hidden' NAME=CNAME value=$CNAME>";
echo "<INPUT type='hidden' NAME=MONITOR value=$MONITOR>";
echo "$MONITOR";
echo "</td></tr>";

echo "<tr bgcolor='#D9DBED'><td>";
echo "監視の正逆の設定\n";
echo "</td><td>";
echo "<select size=1 name=SIGN>";
echo "<option value=$SIGN selected>$SIGN";
echo "<option value=0>0";
echo "<option value=1>1";
echo "</select>";
echo "</td></tr>";

if(0 == strcmp($MONITOR, "PORT")){
   echo "<tr><td>";
   echo "監視プロトコル、ポート DHW MYSQL PGSQL の場合のみ\n";
   echo "</td><td>";
   echo "<select size=1 name=PROTO>";
   echo "<option value=$PROTO selected>$PROTO";
   echo "<option value=ICMP>ICMP";
   echo "<option value=UDP>UDP";
   echo "<option value=TCP>TCP";
   echo "<option value=URL>URL";
   echo "<option value=SSL>SSL";
   echo "<option value=SMTP>SMTP";
   echo "<option value=FTP>FTP";
   echo "<option value=POP>POP";
   echo "<option value=SSH>SSH";
   echo "<option value=DHW>DHW";
   echo "<option value=MYSQL>MYSQL";
   echo "<option value=PGSQL>PGSQL";
   echo "<option value=SNTP>SNTP";
   echo "<option value=HOST>HOST";
   echo "<option value=NOT>NOT";
   echo "</select>";
   echo "</td></tr>";
   }
elseif(0 == strcmp($MONITOR, "SNMP")){
   echo "<tr><td>";
   echo "SNMP 監視閾値設定\n";
   echo "</td><td>";
   echo "<INPUT type='text' NAME=PROTO size='70' value='$PROTO'>";
   echo "</td></tr>";
   }
else{
   echo "<INPUT type='hidden' NAME=PROTO size='0' value='0'>";
   }

if(0 == strcmp($MONITOR, "COMAND")){
   echo "<tr bgcolor='#D9DBED'><td>";
   echo "実行コマンド\n";
   echo "</td><td>";
   echo "<INPUT type='text' NAME=COM size='70' value='$COM'>";
   echo "</td></tr>";
   }
elseif(0 == strcmp($MONITOR, "PORT")){
   echo "<tr bgcolor='#D9DBED'><td>";
   echo "DHWの場合、実行コマンド\n";
   echo "HOSTの場合、比較IP\n";
   echo "MYSQL PGSQLの場合、クエリー\n";
   echo "</td><td>";
   echo "<INPUT type='text' NAME=COM size='70' value='$COM'>";
   echo "</td></tr>";
   }
elseif(0 == strcmp($MONITOR, "SNMP")){
   echo "<tr bgcolor='#D9DBED'><td>";
   echo "SNMP OID\n";
   echo "</td><td>";
   echo "<INPUT type='text' NAME=COM size='70' value='$COM'>";
   echo "</td></tr>";
   }
else{
   echo "<INPUT type='hidden' NAME=COM size='0' value='NOT'>";
   }

echo "<tr><td>";
echo "監視先IPアドレス(host name)\n";
echo "</td><td>";
echo "<INPUT type='text' NAME=CIP size='70' value='$CIP'>";
echo "</td></tr>";

if(0 == strcmp($MONITOR, "PORT")){
   echo "<tr bgcolor='#D9DBED'><td>";
   echo "監視先のポート\n";
   echo "</td><td>";
   echo "<INPUT type='text' NAME=PORT size='12' value='$PORT'>";
   echo "</td></tr>";
   }
elseif(0 == strcmp($MONITOR, "SNMP")){
   echo "<tr bgcolor='#D9DBED'><td>";
   echo "SNMP 接続先の sec.name\n";
   echo "</td><td>";
   echo "<INPUT type='text' NAME=PORT size='24' value='$PORT'>";
   echo "</td></tr>";
   }
else{
   echo "<INPUT type='hidden' NAME=PORT size='0' value='0'>";
   }

if(0 != strcmp($MONITOR, "SNMP")){
   echo "<tr><td>";
   echo "ステータスの待ち時間秒\n";
   echo "</td><td>";
   echo "<select size=1 name=WTIME>";
   echo "<option value=$WTIME selected>$WTIME";
   echo "<option value=0>0";
   echo "<option value=1>1";
   echo "<option value=2>2";
   echo "<option value=3>3";
   echo "<option value=4>4";
   echo "<option value=5>5";
   echo "<option value=6>6";
   echo "<option value=7>7";
   echo "<option value=8>8";
   echo "<option value=9>9";
   echo "<option value=10>10";
   echo "<option value=11>11";
   echo "<option value=12>12";
   echo "<option value=13>13";
   echo "<option value=14>14";
   echo "<option value=15>15";
   echo "<option value=16>16";
   echo "<option value=17>17";
   echo "<option value=18>18";
   echo "<option value=19>19";
   echo "<option value=20>20";
   echo "<option value=21>21";
   echo "<option value=22>22";
   echo "<option value=23>23";
   echo "<option value=24>24";
   echo "<option value=25>25";
   echo "<option value=26>26";
   echo "<option value=27>27";
   echo "<option value=28>28";
   echo "<option value=29>29";
   echo "<option value=30>30";
   echo "</select>";
   echo "</td></tr>";
   }
else{
   echo "<INPUT type='hidden' NAME=WTIME size='0' value='0'>";
   }

echo "<tr bgcolor='#D9DBED'><td>";
echo "監視先の情報\n";
echo "</td><td>";
echo "<INPUT type='text' NAME=PINFO size='70' value='$PINFO'>";
echo "</td></tr>";

echo "<tr><td>";
echo "この監視のプライオリティー\n";
echo "</td><td>";
echo "<select size=1 name=PRINO>";
echo "<option value=$PRINO selected>$PRINO";
echo "<option value=1>1最強";
echo "<option value=2>2そこそこ";
echo "<option value=3>3まあこんなもんじゃん";
echo "<option value=4>4 TEST MODE";
echo "<option value=5>5 LOGING MODE";
echo "<option value=11>監視ログ(11)";
echo "<option value=12>監視ログ(12)";
echo "</select>";
echo "</td></tr>";

if(0 == strcmp($MONITOR, "SNMP")){
   echo "<tr bgcolor='#D9DBED'><td>";
   echo "OID の説明など、、、\n";
   echo "</td><td>";
   echo "<INPUT type='text' NAME=FREE1 size='70' value='$FREE1'>";
   echo "</td></tr>";
   }
else{
   echo "<tr bgcolor='#D9DBED'><td>";
   echo "監視内容の説明など（コメント）\n";
   echo "</td><td>";
   echo "<INPUT type='text' NAME=FREE1 size='70' value='$FREE1'>";
   echo "</td></tr>";
   }

// echo "<tr><td>";
// echo "コメント 2\n";
// echo "</td><td>";
// echo "<INPUT type='text' NAME=FREE2 size='70' value='$FREE2'>";
// echo "</td></tr>";

// echo "<tr bgcolor='#D9DBED'><td>";
// echo "コメント 3\n";
// echo "</td><td>";
// echo "<INPUT type='text' NAME=FREE3 size='70' value='$FREE3'>";
// echo "</td></tr>";

echo "<tr><td>";
echo "監視ブロック名\n";
echo "</td><td>";
echo "<INPUT type='hidden' NAME=FREE4 size='70' value='$FREE4'>";
echo "$FREE4";
echo "</td></tr>";

echo"</table>";

echo "<font color=red size=3>";
echo "このボタンを押すと監視項目に追加されます";
echo "</font>";
echo "\n";
echo "<INPUT type='hidden' NAME=GEN value='taro'>";
echo "<input type=submit value='監視項目を追加します'>";

print("</font>");

?>

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


