Skip to content

Commit 2d6162f

Browse files
committed
Added support for CentOS / RHEL
1 parent f59865b commit 2d6162f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

server/lib/classes/cron.d/100-monitor_system_update.inc.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,18 @@ public function onRunJob() {
159159
* Fetch the output
160160
*/
161161
$data['output'] = shell_exec('zypper lu');
162+
} else if (file_exists('/etc/redhat-release')) {
163+
164+
if(shell_exec("yum list updates | awk 'p; /Updated Packages/ {p=1}'") == '') {
165+
// There is nothing to update
166+
$state = 'ok';
167+
}
168+
else {
169+
$state = 'info';
170+
}
171+
// Fetch the output
172+
$yumData = shell_exec('yum check-update');
173+
$data['output'] = $yumData;
162174
} else {
163175
/*
164176
* It is not Debian/Ubuntu, so there is no data and no state

0 commit comments

Comments
 (0)