Viewing File server/web/node.php of 0.02.35a
|
1: <?php 2: /* ------------------------------------------------------------- 3: This file is part of FreeNATS 4: 5: FreeNATS is (C) Copyright 2008 PurplePixie Systems 6: 7: FreeNATS is free software: you can redistribute it and/or modify 8: it under the terms of the GNU General Public License as published by 9: the Free Software Foundation, either version 3 of the License, or 10: (at your option) any later version. 11: 12: FreeNATS is distributed in the hope that it will be useful, 13: but WITHOUT ANY WARRANTY; without even the implied warranty of 14: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15: GNU General Public License for more details. 16: 17: You should have received a copy of the GNU General Public License 18: along with FreeNATS. If not, see www.gnu.org/licenses 19: 20: For more information see www.purplepixie.org/freenats 21: -------------------------------------------------------------- */ 22: 23: ob_start(); 24: require("include.php"); 25: $NATS->Start(); 26: if (!$NATS_Session->Check($NATS->DB)) 27: { 28: header("Location: ./?login_msg=Invalid+Or+Expired+Session"); 29: exit(); 30: } 31: if ($NATS_Session->userlevel<1) UL_Error("View Node"); 32: ob_end_flush(); 33: Screen_Header("Viewing Node ".$_REQUEST['nodeid'],1); 34: ?> 35: <br> 36: <?php 37: //echo "<b class=\"minortitle\">Node: ".$_REQUEST['nodeid']."</b><br><br>"; 38: 39: echo "<table border=0><tr><td align=left valign=top>"; 40: 41: $q="SELECT * FROM fnnode WHERE nodeid=\"".ss($_REQUEST['nodeid'])."\" LIMIT 0,1"; 42: $r=$NATS->DB->Query($q); 43: if (!$row=$NATS->DB->Fetch_Array($r)) 44: { 45: echo "No such node.<br><br>"; 46: Screen_Footer(); 47: exit(); 48: } 49: $NATS->DB->Free($r); 50: 51: echo "<table class=\"nicetable\">"; 52: 53: echo "<tr><td align=right> 54: Node Name 55: :</td><td align=left>"; 56: echo $row['nodename']; 57: echo "</td></tr>"; 58: 59: echo "<tr><td align=right> 60: Status 61: :</td><td align=left>"; 62: echo "<b class=\"al".$row['alertlevel']."\">"; 63: echo aText($row['alertlevel']); 64: echo "</b>"; 65: echo "</td></tr>"; 66: 67: echo "<tr><td align=right> 68: Hostname 69: :</td><td align=left>"; 70: echo $row['hostname']; 71: echo " </td></tr>"; 72: 73: echo "<tr><td align=right> 74: Description 75: :</td><td align=left>"; 76: echo $row['nodedesc']; 77: echo " </td></tr>"; 78: 79: echo "<tr><td align=right> 80: Enabled 81: :</td><td align=left>"; 82: if ($row['nodeenabled']==1) $s="Yes"; 83: else $s="No"; 84: echo $s; 85: echo "</td></tr>"; 86: 87: $aq="SELECT alertid,alertlevel,openedx FROM fnalert WHERE nodeid=\"".ss($_REQUEST['nodeid'])."\" AND closedx=0 LIMIT 0,1"; 88: //echo $aq; 89: $ar=$NATS->DB->Query($aq); 90: echo "<tr><td align=right> 91: Alert 92: :</td><td align=left>"; 93: if ($arow=$NATS->DB->Fetch_Array($ar)) 94: { 95: echo "<a href=history.alert.php?nodeid=".$_REQUEST['nodeid']."><b class=\"al".$arow['alertlevel']."\">Yes - ".aText($arow['alertlevel'])."</b></a> "; 96: echo "(Opened ".dtago($arow['openedx']).")"; 97: } 98: else echo "<b>No</b> [ <a href=history.alert.php?nodeid=".$_REQUEST['nodeid'].">Alert History</a> ]"; 99: echo "</td></tr>"; 100: 101: if ($NATS_Session->userlevel>4) echo "<tr><td align=right>Edit :</td><td align=left><a href=node.edit.php?nodeid=".$_REQUEST['nodeid'].">Edit Node Options</a></td></tr>"; 102: 103: echo "<tr><td align=right>Summary :</td><td align=left>"; 104: $finishx=time(); 105: $startx=$finishx-(60*60*24); 106: echo "<a href=summary.test.php?nodeid=".$_REQUEST['nodeid']."&startx=".$startx."&finishx=".$finishx.">Last 24hrs</a> | "; 107: echo "<a href=summary.test.php?nodeid=".$_REQUEST['nodeid'].">Today</a>"; 108: echo "</td></tr>"; 109: 110: echo "</table>"; 111: 112: echo "</td><td style=\"width: 50px;\"> </td><td align=left valign=top>"; 113: np_tiny($_REQUEST['nodeid']); 114: echo "</td></tr></table>"; 115: 116: echo "<br><br>"; 117: 118: echo "<b class=\"minortitle\">Local Tests</b><br><br>"; 119: 120: echo "<table class=\"nicetable\">"; 121: 122: $q="SELECT * FROM fnlocaltest WHERE nodeid=\"".ss($_REQUEST['nodeid'])."\""; 123: $r=$NATS->DB->Query($q); 124: while ($row=$NATS->DB->Fetch_Array($r)) 125: { 126: echo "<tr><td>"; 127: 128: if (strlen($row['testparam'])>10) $tp=substr($row['testparam'],0,8).".."; 129: else $tp=$row['testparam']; 130: echo lText($row['testtype']); 131: if ($tp!="") echo " (".$tp.")"; 132: echo "</td>"; 133: 134: echo "<td><b class=\"al".$row['alertlevel']."\">".aText($row['alertlevel'])."</b></td>"; 135: 136: echo "<td>(".dtago($row['lastrunx']).")</td>"; 137: 138: echo "<td>"; 139: if (($row['testrecord']==1)||($row['testtype']=="ICMP")) 140: echo "[ <a href=\"history.test.php?testid=L".$row['localtestid']."\">History</a> ]"; 141: else echo " "; 142: echo "</td>"; 143: 144: echo "</tr>"; 145: } 146: 147: echo "</table>"; 148: 149: 150: ?> 151: 152: 153: <?php 154: Screen_Footer(); 155: ?> 156: