diff --git a/install/dist/conf/centos80.conf.php b/install/dist/conf/centos80.conf.php new file mode 100644 index 0000000000000000000000000000000000000000..04257d4dfece9aab36e1b2506431a7f5a934df7c --- /dev/null +++ b/install/dist/conf/centos80.conf.php @@ -0,0 +1,224 @@ + diff --git a/install/dist/lib/centos80.lib.php b/install/dist/lib/centos80.lib.php new file mode 100644 index 0000000000000000000000000000000000000000..3dcd7494d3326bd3618d229c950518e8c200f3e4 --- /dev/null +++ b/install/dist/lib/centos80.lib.php @@ -0,0 +1,40 @@ + diff --git a/install/lib/install.lib.php b/install/lib/install.lib.php index 1e49e025ca0360944a5ba6bd0bd12f5a7543dc4f..02ebba28503541ac5c4db11d3508e7cc57b6a850 100644 --- a/install/lib/install.lib.php +++ b/install/lib/install.lib.php @@ -341,6 +341,15 @@ function get_distname() { $distid = 'centos72'; } swriteln("Operating System: CentOS $var\n"); + } elseif(stristr($content, 'CentOS Linux release 8')) { + $distname = 'CentOS'; + $distver = 'Unknown'; + $distbaseid = 'fedora'; + $distid = 'centos80'; + $var=explode(" ", $content); + $var=explode(".", $var[3]); + $var=$var[0].".".$var[1]; + swriteln("Operating System: CentOS $var\n"); } else { $distname = 'Redhat'; $distver = 'Unknown'; 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 3d4ebf408e4fb5349646bca0b5bbe84ed8daf4b6..34f944fa676d086737637089ec43a3ff121f5f1b 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 @@ -160,28 +160,38 @@ class cronjob_monitor_system_update extends cronjob { */ $data['output'] = shell_exec('zypper lu'); } 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'); + /* + * update and find the upgrade. + * if there is any output, then there is a needed update + */ + + /* try to figure out the default package manager first */ + if(file_exists('/usr/bin/dnf') && (is_link('/usr/bin/yum'))) { + $rhPkgMgr = 'dnf'; + } elseif(file_exists('/usr/bin/dnf') && (!file_exists('/usr/bin/yum')) || (!is_link('/usr/bin/yum'))) { + $rhPkgMgr = 'dnf'; + } else { + $rhPkgMgr = 'yum'; + } + + $aptData = shell_exec($rhPkgMgr. ' -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($rhPkgMgr. ' -q list updates'); - } else { + } else { /* * It is not Debian/Ubuntu, so there is no data and no state * diff --git a/server/lib/classes/monitor_tools.inc.php b/server/lib/classes/monitor_tools.inc.php index d8d325fe60fbfc3d1d100ca77ee5c762bbabc9b6..aba19df7a4242ff8da31cbd546b896fb43608fa2 100644 --- a/server/lib/classes/monitor_tools.inc.php +++ b/server/lib/classes/monitor_tools.inc.php @@ -319,6 +319,14 @@ class monitor_tools { } else { $distid = 'centos72'; } + } elseif(stristr($content, 'CentOS Linux release 8')) { + preg_match_all('/([0-9]{1,2})\.?([0-9]{0,2})\.?([0-9]*)/', $content, $version); + $distname = 'CentOS'; + $distver = is_array($version)? implode('.', array_filter(array($version[1][0],$version[2][0],$version[3][0]),'strlen')) :'Unknown'; + $distbaseid = 'fedora'; + $var=explode(" ", $content); + $var=explode(".", $var[3]); + $var=$var[0].".".$var[1]; } else { $distname = 'Redhat'; $distver = 'Unknown';