Skip to content
Snippets Groups Projects
Commit 8f069999 authored by Ales Seifert's avatar Ales Seifert
Browse files

added update status check for Redhat based distros

parent b92c60a8
No related branches found
No related tags found
No related merge requests found
...@@ -159,7 +159,29 @@ class cronjob_monitor_system_update extends cronjob { ...@@ -159,7 +159,29 @@ class cronjob_monitor_system_update extends cronjob {
* Fetch the output * Fetch the output
*/ */
$data['output'] = shell_exec('zypper lu'); $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 * It is not Debian/Ubuntu, so there is no data and no state
* *
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment