diff --git a/check_packages2install b/check_packages2install index ee2b07d448b5513b8627057cd368083d8f9b1b89..8a4fbaaf171c7e0932d6b11a841b07245f7dca94 100755 --- a/check_packages2install +++ b/check_packages2install @@ -15,6 +15,7 @@ # 2019-04-29 v1.2 ah yum: supress error channel output (task #2959) # 2020-03-05 v1.3 <axel.hahn@iml.unibe.ch> switch to ph.* helper functions # 2020-03-11 v1.4 <axel.hahn@iml.unibe.ch> add -c -w limits; added perfdata (yum) +# 2021-05-11 v1.4 <axel.hahn@iml.unibe.ch> added centos8 support # ====================================================================== @@ -75,7 +76,7 @@ function checkApt(){ # check updates with yum and exit script function checkYum(){ - summary=`ph.execIfReady "/usr/bin/yum --security check-update 2>/dev/null | fgrep 'for security'" ` + summary=`ph.execIfReady "/usr/bin/yum --security check-update 2>&1 | fgrep 'security'" ` # example outputs: # I No packages needed for security; 223 packages available @@ -87,12 +88,13 @@ function checkYum(){ ph.setStatusByLimit ${iPkg2Update} ${iWarnLimit} ${iCriticalLimit} # step II: security packages switch to "critical" + # remark: a warn level does not exist if [ ${iPkgSecurity} -ne 0 ]; then ph.setStatus "critical" fi ph.perfadd "updates-available" "${iPkg2Update}" ${iWarnLimit} ${iCriticalLimit} - ph.perfadd "updates-security" "${iPkgSecurity}" "" 1 + ph.perfadd "updates-security" "${iPkgSecurity}" 1 1 ph.status "$summary" echo "[yum]"