Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.
Permalink
Browse files Browse the repository at this point in the history
0.9.8.rc1
  • Loading branch information
stdonato committed May 30, 2019
1 parent e5cccb4 commit 3a89f00
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 9 deletions.
3 changes: 3 additions & 0 deletions front/sh/df.php
@@ -1,5 +1,8 @@
<?php

Session::checkLoginUser();
Session::checkRight("profile", READ);

$disk = exec('/bin/df -hm |grep sd | awk \'{print $1","$2","$3","$4","$5","$6}\'', $result);
$count = exec('/bin/df -h |grep sd | awk \'{print $1","$2","$3","$4","$5","$6}\' |wc -l');

Expand Down
Empty file added front/sh/index.html
Empty file.
3 changes: 2 additions & 1 deletion front/sh/issue.php
@@ -1,6 +1,7 @@
<?php

//header('Content-Type: application/json; charset=UTF-8');
Session::checkLoginUser();
Session::checkRight("profile", READ);

if(file_exists('/usr/bin/lsb_release')) {
echo substr(shell_exec('/usr/bin/lsb_release -ds'),0,21); //ubuntu - debian
Expand Down
4 changes: 2 additions & 2 deletions front/sh/load.php
@@ -1,14 +1,14 @@
<?php

// /bin/cat /proc/loadavg | /usr/bin/awk '{print $1","$2","$3}'
Session::checkLoginUser();
Session::checkRight("profile", READ);

$cores = exec('/bin/grep -c ^processor /proc/cpuinfo');

$loadavg = exec('/bin/cat /proc/loadavg | /usr/bin/awk \'{print $2}\'');

$load = round(($loadavg*100)/$cores ,1);

//$load = $perc;

if($cores == 1) {
$ncores = '1 core'; }
Expand Down
3 changes: 0 additions & 3 deletions front/sh/media.php
Expand Up @@ -8,9 +8,6 @@
Session::checkLoginUser();
Session::checkRight("profile", READ);

//$ver = explode(" ",implode(" ",plugin_version_dashboard()));


// count years
$query_y = "SELECT DISTINCT DATE_FORMAT( date, '%Y' ) AS year
FROM glpi_tickets
Expand Down
3 changes: 3 additions & 0 deletions front/sh/mem.php
@@ -1,5 +1,8 @@
<?php

Session::checkLoginUser();
Session::checkRight("profile", READ);

$totalm = exec('/usr/bin/free -tm | /usr/bin/awk \'{print $1","$2","$3-$6-$7","$4+$6+$7}\' |grep -i mem: |cut -f2 -d,');

$usedm = exec('/usr/bin/free -tm | /usr/bin/awk \'{print $1","$2","$3","$4+$6+$7}\' |grep -i mem: |cut -f3 -d,');
Expand Down
3 changes: 3 additions & 0 deletions front/sh/traf.php
@@ -1,5 +1,8 @@
<?php

Session::checkLoginUser();
Session::checkRight("profile", READ);

$interval = 2;

$tx_path = 'cat /sys/class/net/eth0/statistics/tx_bytes';
Expand Down
15 changes: 12 additions & 3 deletions front/sh/uptime.php
@@ -1,6 +1,13 @@
<?php

$totalSeconds1 = shell_exec("/usr/bin/cut -d. -f1 /proc/uptime");
Session::checkLoginUser();
Session::checkRight("profile", READ);

$uptime = shell_exec('uptime |cut -d" " -f4-8');

echo $uptime;

/*$totalSeconds1 = shell_exec("/usr/bin/cut -d'.' -f1 /proc/uptime");
$totalSeconds = strtotime($totalSeconds1);
$totalMin = $totalSeconds / 60;
$totalHours = $totalMin / 60;
Expand All @@ -10,6 +17,7 @@
$min = floor($totalMin - ($days * 60 * 24) - ($hours * 60));
$formatUptime = '';
if ($days != 0) {
$formatUptime .= "$days d ";
}
Expand All @@ -22,5 +30,6 @@
$formatUptime .= "$min m";
}
//header('Content-Type: application/json; charset=UTF-8');
echo ($formatUptime);
echo ($formatUptime);*/

?>

0 comments on commit 3a89f00

Please sign in to comment.