diff --git a/server/lib/classes/cron.d/100-monitor_system_update.inc.php b/server/lib/classes/cron.d/100-monitor_system_update.inc.php index bc4f521073ff3d3813ad286af70c16945121fe09..3d4ebf408e4fb5349646bca0b5bbe84ed8daf4b6 100644 --- a/server/lib/classes/cron.d/100-monitor_system_update.inc.php +++ b/server/lib/classes/cron.d/100-monitor_system_update.inc.php @@ -159,7 +159,29 @@ class cronjob_monitor_system_update extends cronjob { * Fetch the output */ $data['output'] = shell_exec('zypper lu'); - } else { + } elseif(file_exists('/etc/redhat-release')) { + /* + * update and find the upgrade. + * if there is any output, then there is a needed update + */ + $aptData = shell_exec('yum -q list updates'); + if ($aptData == '') { + /* There is nothing to update! */ + $state = 'ok'; + } else { + /* + * There is something to update! this is in most cases not critical, so we can + * do a system-update once a month or so... + */ + $state = 'info'; + } + + /* + * Fetch the output + */ + $data['output'] = shell_exec('yum -q list updates'); + + } else { /* * It is not Debian/Ubuntu, so there is no data and no state *