<?php

require_once("read_conf.php");
require_once("db.php");
require_once("ssh.php");

$conf = readmyconf();
$con = connectme($conf);

$ret = send_ssh_cmd($conf, $con, $_REQUEST["ipaddr"], "tail -n 50 /var/log/oci.log");

print("<head>
  <title>Logs for ".$_REQUEST["ipaddr"]."</title>
  <meta http-equiv='refresh' content='2'>
</head><body>");
print(nl2br(htmlspecialchars($ret)));
print("</body>");

?>
