1 | <?php |
---|
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 | <HEAD> |
---|
49 | <TITLE>Log: <?php echo $_GET["nombreordenador"] ?> </TITLE> |
---|
50 | <meta charset="utf-8"> |
---|
51 | <?php |
---|
52 | #echo "<meta http-equiv='Refresh' content='2;URL=./verlog.php?nombreordenador=". $_GET["nombreordenador"] ."&ip=".$ip ."'"; |
---|
53 | ?> |
---|
54 | |
---|
55 | |
---|
56 | </HEAD> |
---|
57 | |
---|
58 | <BODY> |
---|
59 | |
---|
60 | |
---|
61 | <form name="leerficherolog" action="" method="GET"> |
---|
62 | <table> |
---|
63 | <tr> |
---|
64 | <?php |
---|
65 | $nombreordenador=$_GET["nombreordenador"]; |
---|
66 | echo "<td> Log host ". $nombreordenador ." ip " . $ip ." </td> "; |
---|
67 | ?> |
---|
68 | </tr> |
---|
69 | </table> |
---|
70 | <TEXTAREA NAME="contenido" ROWS="50" COLS="150" > |
---|
71 | <?php |
---|
72 | $fp = "/opt/opengnsys/log/clients/" . $ip . ".log"; |
---|
73 | $array=file($fp); |
---|
74 | foreach($array as $line) |
---|
75 | { |
---|
76 | echo($line); |
---|
77 | } |
---|
78 | #lectura del fichero tipo tail |
---|
79 | #for($i=count($array);$i>0;$i--) |
---|
80 | #{ |
---|
81 | # echo "$array[$i]"; |
---|
82 | #} |
---|
83 | ?> |
---|
84 | </TEXTAREA> |
---|
85 | |
---|
86 | </form> |
---|
87 | |
---|
88 | </BODY> |
---|
89 | </HTML> |
---|