| [58d08a2] | 1 | <? |
|---|
| 2 | // ************************************************************************************************************************************************* |
|---|
| 3 | // Aplicación WEB: |
|---|
| 4 | // Autor: |
|---|
| 5 | // Fecha Creación: |
|---|
| 6 | // Fecha Última modificación: |
|---|
| 7 | // Nombre del fichero: |
|---|
| 8 | // Descripción : |
|---|
| 9 | // muestra los log del equipo |
|---|
| 10 | // ************************************************************************************************************************************************* |
|---|
| 11 | include_once("../includes/ctrlacc.php"); |
|---|
| 12 | include_once("../clases/AdoPhp.php"); |
|---|
| 13 | include_once("../includes/constantes.php"); |
|---|
| 14 | include_once("../includes/comunes.php"); |
|---|
| 15 | include_once("../includes/CreaComando.php"); |
|---|
| 16 | include_once("../includes/HTMLSELECT.php"); |
|---|
| 17 | include_once("../idiomas/php/".$idioma."/comandos/ejecutarscripts_".$idioma.".php"); |
|---|
| 18 | include_once("../idiomas/php/".$idioma."/consolaremota_".$idioma.".php"); |
|---|
| 19 | //________________________________________________________________________________________________________ |
|---|
| 20 | $cmd=CreaComando($cadenaconexion); |
|---|
| 21 | if (!$cmd) |
|---|
| 22 | Header('Location: '.$pagerror.'?herror=2'); // Error de conexión con servidor B.D. |
|---|
| 23 | //___________________________________________________________________________________________________ |
|---|
| 24 | |
|---|
| 25 | $nombreordenador=$_GET["nombreordenador"]; |
|---|
| 26 | |
|---|
| 27 | if (isset($_GET["ip"])) |
|---|
| 28 | { |
|---|
| 29 | $ip=$_GET["ip"]; |
|---|
| 30 | } |
|---|
| 31 | else |
|---|
| 32 | { |
|---|
| 33 | $rs=new Recordset; |
|---|
| 34 | $cmd->texto="SELECT * FROM ordenadores WHERE nombreordenador='".$nombreordenador."'"; |
|---|
| 35 | $rs->Comando=&$cmd; |
|---|
| 36 | if (!$rs->Abrir()) return(false); // Error al abrir recordset |
|---|
| 37 | $rs->Primero(); |
|---|
| 38 | if (!$rs->EOF){ |
|---|
| 39 | $ip=$rs->campos["ip"]; |
|---|
| 40 | $rs->Cerrar(); |
|---|
| 41 | } |
|---|
| 42 | } |
|---|
| 43 | |
|---|
| 44 | ?> |
|---|
| 45 | |
|---|
| 46 | |
|---|
| 47 | <HTML> |
|---|
| 48 | <TITLE>Log: <? echo $_GET["nombreordenador"] ?> </TITLE> |
|---|
| 49 | <HEAD> |
|---|
| 50 | <? |
|---|
| 51 | #echo "<meta http-equiv='Refresh' content='2;URL=./verlog.php?nombreordenador=". $_GET["nombreordenador"] ."&ip=".$ip ."'"; |
|---|
| 52 | ?> |
|---|
| 53 | |
|---|
| 54 | |
|---|
| 55 | </HEAD> |
|---|
| 56 | |
|---|
| 57 | <BODY> |
|---|
| 58 | |
|---|
| 59 | |
|---|
| 60 | <form name="leerficherolog" action="" method="GET"> |
|---|
| 61 | <table> |
|---|
| 62 | <tr> |
|---|
| 63 | <?php |
|---|
| 64 | $nombreordenador=$_GET["nombreordenador"]; |
|---|
| [77b4ec4] | 65 | echo "<td> Log host ". $nombreordenador ." ip " . $ip ." </td> "; |
|---|
| [58d08a2] | 66 | ?> |
|---|
| 67 | </tr> |
|---|
| 68 | </table> |
|---|
| 69 | <TEXTAREA NAME="contenido" ROWS="50" COLS="150" > |
|---|
| 70 | <?php |
|---|
| 71 | $fp = "/opt/opengnsys/log/clients/" . $ip . ".log"; |
|---|
| 72 | $array=file($fp); |
|---|
| 73 | foreach($array as $line) |
|---|
| 74 | { |
|---|
| 75 | echo($line); |
|---|
| 76 | } |
|---|
| 77 | #lectura del fichero tipo tail |
|---|
| 78 | #for($i=count($array);$i>0;$i--) |
|---|
| 79 | #{ |
|---|
| 80 | # echo "$array[$i]"; |
|---|
| 81 | #} |
|---|
| 82 | ?> |
|---|
| 83 | </TEXTAREA> |
|---|
| 84 | |
|---|
| 85 | </form> |
|---|
| 86 | |
|---|
| 87 | </BODY> |
|---|
| 88 | </HTML> |
|---|