/** * Get statistics * * @return void * @author **/ function get_stats($mount_point = '/') { $obj = new View(); if (!$this->authorized()) { $obj->view('json', array('msg' => array('error' => 'Not authenticated'))); return; } $disk_report = new Disk_report_model(); $out = array(); $thresholds = conf('disk_thresholds', array('danger' => 5, 'warning' => 10)); $out['thresholds'] = $thresholds; $out['stats'] = $disk_report->get_stats($mount_point, $thresholds['danger'], $thresholds['warning']); $obj->view('json', array('msg' => $out)); }