Skip to content
Snippets Groups Projects
Commit 6ced21dc authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

added centos8 support

parent 1dfbc60f
No related branches found
No related tags found
No related merge requests found
......@@ -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]"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment