Skip to content
Permalink
Browse files

log services

  • Loading branch information...
admin
admin committed Apr 19, 2016
1 parent d278d5d commit e8c5c14b38f571a7964e5a526eda26bc224cb4e4
Showing with 34 additions and 27 deletions.
  1. +24 −20 common/nvd3_data.php
  2. +10 −7 modules/tools/html/log/log_services.php
@@ -8,6 +8,10 @@
$group=$_GET["group"];
$single=$_GET["single"];
$data='';
$adj='';
$db = new PDO("sqlite:$root/dbf/nettemp.db");
$rows = $db->query("SELECT * FROM highcharts WHERE id='1'");
$row = $rows->fetchAll();
@@ -110,10 +114,10 @@ function queryc($max,&$query) {
}
foreach ($dbh->query($query) as $row) {
$data[]=array(x => $row[0]*1000, y => $row[1]);
$data[]=array('x' => $row[0]*1000, 'y' => $row[1]);
}
$array[key]=$file;
$array[values]=$data;
$array['key']=$file;
$array['values']=$data;
$all[]=$array;
unset($data);
unset($array);
@@ -145,10 +149,10 @@ function queryc($max,&$query) {
query($max,$query);
}
foreach ($dbh->query($query) as $row) {
$data[]=array(x => $row[0]*1000, y => $row[1]+$adj);
$data[]=array('x' => $row[0]*1000, 'y' => $row[1]+$adj);
}
$array[key]=$name;
$array[values]=$data;
$array['key']=$name;
$array['values']=$data;
$all[]=$array;
unset($data);
unset($array);
@@ -179,10 +183,10 @@ function queryc($max,&$query) {
query($max,$query);
}
foreach ($dbh->query($query) as $row) {
$data[]=array(x => $row[0]*1000, y => $row[1]+$adj);
$data[]=array('x' => $row[0]*1000, 'y' => $row[1]+$adj);
}
$array[key]=$name;
$array[values]=$data;
$array['key']=$name;
$array['values']=$data;
if(!empty($data)) {
$all[]=$array;
}
@@ -209,10 +213,10 @@ function queryc($max,&$query) {
query($max,$query);
}
foreach ($dbh->query($query) as $row) {
$data[]=array(x => $row[0]*1000, y => $row[1]+$adj);
$data[]=array('x' => $row[0]*1000, 'y' => $row[1]+$adj);
}
$array[key]=$name;
$array[values]=$data;
$array['key']=$name;
$array['values']=$data;
$all[]=$array;
unset($data);
unset($array);
@@ -247,11 +251,11 @@ function queryc($max,&$query) {
queryc($max,$query);
}
foreach ($dbh->query($query) as $row) {
$data[]=array(x => $row[0]*1000, y => $row[1]+$adj);
$data[]=array('x' => $row[0]*1000, 'y' => $row[1]+$adj);
}
$array[key]=$name;
$array[values]=$data;
//$array[units]=$type;
$array['key']=$name;
$array['values']=$data;
//$array['units']=$type;
$all[]=$array;
unset($data);
unset($array);
@@ -286,11 +290,11 @@ function queryc($max,&$query) {
query($max,$query);
}
foreach ($dbh->query($query) as $row) {
$data[]=array(x => $row[0]*1000, y => $row[1]+$adj);
$data[]=array('x' => $row[0]*1000, 'y' => $row[1]+$adj);
}
$array[key]=$name;
$array[values]=$data;
//$array[units]=$type;
$array['key']=$name;
$array['values']=$data;
//$array['units']=$type;
$all[]=$array;
unset($data);
unset($array);
@@ -1,20 +1,23 @@
<?php
$service=isset($_GET['service']) ? $_GET['service'] : '';
$service=isset($_GET['service']) ? $_GET['service'] : '';
?>
<p>
<a href="index.php?id=tools&type=log&log=services&service=smstools" class="btn btn-default btn-xs" <?php echo $service == 'smstools' ? 'active' : ''; ?> ">SMStools </a>
<a href="index.php?id=tools&type=log&log=services&service=msmtp" class="btn btn-default btn-xs" <?php echo $service == 'msmtp' ? 'active' : ''; ?> ">msmtp </a>
<a href="index.php?id=tools&type=log&log=services&service=lighttpd" class="btn btn-default btn-xs" <?php echo $service == 'lighttpd' ? 'active' : ''; ?> ">lighttpd </a>
<a href="index.php?id=tools&type=log&log=services&service=smstools"><button class="btn btn-default btn-xs <?php echo $service == 'smstools' ? 'active' : ''; ?> ">SMStools </button></a>
<a href="index.php?id=tools&type=log&log=services&service=msmtp"><button class="btn btn-default btn-xs <?php echo $service == 'msmtp' ? 'active' : ''; ?> ">msmtp </button></a>
<a href="index.php?id=tools&type=log&log=services&service=lighttpd"><button class="btn btn-default btn-xs <?php echo $service == 'lighttpd' ? 'active' : ''; ?> ">lighttpd </button></a>
</p>

<pre>
<?php
switch ($service)
{
default: case '$service': include('/var/log/msmtp.log'); break;
case 'msmtp': include('/var/log/msmtp.log'); break;
case 'smstools': include('/var/log/smstools/smsd.log'); break;
case 'lighttpd': include('/var/log/lighttpd/error.log'); break;
//case 'msmtp': include('/var/log/msmtp.log'); break;
case 'msmtp': file("/var/log/msmtp.log"); $last = array_slice($filearray,-100); foreach($last as $f){ echo $f; }; break;
//case 'smstools': include('/var/log/smstools/smsd.log'); break;
case 'smstools': file("/var/log/smstools/smsd.log"); $last = array_slice($filearray,-100); foreach($last as $f){ echo $f; }; break;
case 'lighttpd': file("/var/log/lighttpd/error.log"); $last = array_slice($filearray,-100); foreach($last as $f){ echo $f; }; break;
//case 'lighttpd': include('/var/log/lighttpd/error.log'); break;
}
?>

0 comments on commit e8c5c14

Please sign in to comment.
You can’t perform that action at this time.