mirror of
https://github.com/bashclub/checkmk-monitoring-plugins.git
synced 2024-12-25 17:40:11 +01:00
Use sort -V to sort by Version. This fixes false positives if kernelversion has more than on digit
This commit is contained in:
parent
da58c7c46d
commit
5f6cf0c9d3
@ -35,7 +35,7 @@ if [[ "$uname" == *"-pve" ]]; then
|
|||||||
else
|
else
|
||||||
filter=linux-image-$major_version
|
filter=linux-image-$major_version
|
||||||
fi
|
fi
|
||||||
latest_kernel=$(dpkg --get-selections | grep $filter | grep -v deinstall | tail -1 | cut -f1 | cut -d'-' -f3-)
|
latest_kernel=$(dpkg --get-selections | grep $filter | grep -v deinstall | sort -V | tail -1 | cut -f1 | cut -d'-' -f3-)
|
||||||
if [[ "$latest_kernel" == "$uname" ]]; then
|
if [[ "$latest_kernel" == "$uname" ]]; then
|
||||||
echo -e "0 \"Running Kernel\" version_ok=0;1;|running_kernel=$uname;;|latest_installed_kernel=$latest_kernel;; Currently running Kernel up-to-date - OK"
|
echo -e "0 \"Running Kernel\" version_ok=0;1;|running_kernel=$uname;;|latest_installed_kernel=$latest_kernel;; Currently running Kernel up-to-date - OK"
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user