Ejemplo n.º 1
0
 static function generateGraph($oldtime, $newtime)
 {
     global $global_dontlogshell;
     $oldv = $global_dontlogshell;
     $global_dontlogshell = true;
     $list = lscandir_without_dot("__path_httpd_root");
     foreach ($list as $l) {
         if (!lxfile_exists("__path_httpd_root/{$l}/stats")) {
             continue;
         }
         $total = webtraffic::getEachwebfilequota("__path_httpd_root/{$l}/stats/{$l}-custom_log", $oldtime, $newtime);
         execRrdSingle("webtraffic", "ABSOLUTE", $l, $total * 1024 * 1024);
     }
     $global_dontlogshell = $oldv;
 }
Ejemplo n.º 2
0
 /**
  * Finds the cpu usage on every xen machine.
  * 
  * It check the list returned by "xm list" command.
  * 
  * @author Anonymous <*****@*****.**>
  * @author Ángel Guzmán Maeso <*****@*****.**>
  * 
  * @return void
  */
 public static function find_cpuusage()
 {
     $xen_list_output = lxshell_output('xm', 'list');
     $xen_list_lines = explode(PHP_EOL, $xen_list_output);
     if (!empty($xen_list_lines)) {
         foreach ($xen_list_lines as $line) {
             $line = trimSpaces($line);
             $value = explode(' ', $line);
             if (!char_search_end($value[0], '.vm')) {
                 continue;
             }
             execRrdSingle('cpu', 'DERIVE', $value[0], $value[5]);
         }
     }
 }
Ejemplo n.º 3
0
 static function generateGraph($oldtime, $newtime)
 {
     $convertedfile = self::convertfile($oldtime, $newtime);
     if (!$convertedfile) {
         return;
     }
     $list = lscandir("__path_mail_root/domains");
     foreach ($list as $l) {
         if (csb($l, "lists.")) {
             continue;
         }
         $total = self::getmail_usage($convertedfile, $l, $oldtime, $newtime);
         execRrdSingle("mailtraffic", "ABSOLUTE", $l, $total * 1024 * 1024);
     }
     lunlink($convertedfile);
 }