| | |
| | | |
| | | //** Get distribution identifier |
| | | //** IMPORTANT! |
| | | // This is the same code as in /install/install.php |
| | | // So if you change it here, you also have to change it in /install/install.php! |
| | | // This is the same code as in install/lib/install.lib.php |
| | | // So if you change it here, you also have to change it in there! |
| | | // Please do not forget to remove the swriteln(); - lines here at this file |
| | | function get_distname() { |
| | | |
| | |
| | | $distbaseid = 'gentoo'; |
| | | |
| | | } else { |
| | | die('unrecognized linux distribution'); |
| | | die('unrecognized Linux distribution'); |
| | | } |
| | | |
| | | return array('name' => $distname, 'version' => $distver, 'id' => $distid, 'baseid' => $distbaseid); |
| | |
| | | $usePercent = floatval($data[$i]['percent']); |
| | | |
| | | //* We dont want to check the cdrom drive as a cd / dvd is always 100% full |
| | | if($data[$i]['type'] != 'iso9660' && $data[$i]['type'] != 'cramfs' && $data[$i]['type'] != 'udf') { |
| | | if($data[$i]['type'] != 'iso9660' && $data[$i]['type'] != 'cramfs' && $data[$i]['type'] != 'udf' && $data[$i]['type'] != 'tmpfs' && $data[$i]['type'] != 'devtmpfs') { |
| | | if ($usePercent > 75) $state = $this->_setState($state, 'info'); |
| | | if ($usePercent > 80) $state = $this->_setState($state, 'warning'); |
| | | if ($usePercent > 90) $state = $this->_setState($state, 'critical'); |
| | |
| | | /** The type of the data */ |
| | | $type = 'system_update'; |
| | | |
| | | /* This monitoring is only available at debian or Ubuntu */ |
| | | /* This monitoring is only available on Debian or Ubuntu */ |
| | | if(file_exists('/etc/debian_version')) { |
| | | |
| | | /* |
| | | * first update the "update-database" |
| | | * first update the "apt database" |
| | | */ |
| | | shell_exec('apt-get update'); |
| | | |
| | |
| | | } |
| | | else { |
| | | /* |
| | | * It is not debian/Ubuntu, so there is no data and no state |
| | | * It is not Debian/Ubuntu, so there is no data and no state |
| | | * |
| | | * no_state, NOT unknown, because "unknown" is shown as state |
| | | * inside the GUI. no_state is hidden. |
| | |
| | | $type = 'raid_state'; |
| | | |
| | | /* |
| | | * We support some RAIDS. But if we can't find any of them, we have no data |
| | | * We support several RAID types, but if we can't find any of them, we have no data |
| | | */ |
| | | $state = 'no_state'; |
| | | $data['output']= ''; |
| | | |
| | | /* |
| | | * Check, if we have mdadm installed (software-raid) |
| | | * Check, if Software-RAID is enabled |
| | | */ |
| | | system('which mdadm', $retval); |
| | | if($retval === 0) { |
| | | if(file_exists('/proc/mdstat')) { |
| | | /* |
| | | * Fetch the output |
| | | */ |
| | |
| | | return $res; |
| | | } |
| | | } |
| | | ?> |
| | | ?> |