HenriWahl / checkmk-agent-plugin-yum

Checks for updates on RPM-based distributions via yum.
GNU General Public License v2.0
24 stars 22 forks source link

yum Script shows "reboot required" after updating and reboot #44

Open 47k opened 3 years ago

47k commented 3 years ago

yum Script shows "reboot required" after updating and reboot

HenriWahl commented 3 years ago

Sometimes the local YUM cache still tells it needs reboot - cleaning it could help.

47k commented 3 years ago

It's usually. I installed today a new server (XCP-ng) and I got the message with 34 updates and after that (after rebooting) the reboot required message.

The old Nagios plugin I used before with MRPE is working fine with no reboot message.

47k commented 3 years ago

Today I installed the newest version (2.3.3). I checked for updates (no updates) and I restarted the server - but after the restart, the "reboot required" is still shown in CheckMK

HenriWahl commented 3 years ago

In issue https://github.com/HenriWahl/checkmk-agent-plugin-yum/issues/45 there seems to be a hint that the bakery function of the yum plugin does not work correctly - what about your agent on the client host? Does it have the needed yum plugin locally?

47k commented 3 years ago

I don't use the bakery for that systems. I installed the newest client manually (2.0.0p9) and the plugin is under "/usr/lib/check_mk_agent/plugins".

Today I got this from two of my machines:

HenriWahl commented 3 years ago

What is the output of cmk -d <host> regarding the host you have that problem with?

47k commented 3 years ago

All packages are up to date, Last Update was too long ago at 2021-04-04 12:24:00 but there are no pending updates, reboot required CRIT <<>> yes 0 0 1612475160

All packages are up to date, -1 Time of last update could not be found, reboot required CRIT <<>> yes 0

All packages are up to date, Last Update was run at 2021-08-05 8:57:00, reboot required CRIT <<>> yes 0 0 1628499420

The plugin is running on that issue on all of my servers - and I have the same issue with the testing server I installed. And the issue still occurs after reboot:

After Start, Reboot and before Updates: All packages are up to date, Last Update was run at 2021-08-04 13:18:00, reboot required CRIT <<>> yes 0 0 1628075880

Looking for updates and there where no updates: All packages are up to date, Last Update was run at 2021-08-04 13:18:00, reboot required CRIT <<>> yes 0 0 1628075880

Did an restart but still the same: All packages are up to date, Last Update was run at 2021-08-04 13:18:00, reboot required CRIT <<>> yes 0 0 1628075880

47k commented 3 years ago

Anything we can do here?

HenriWahl commented 3 years ago

Honestly I do not know because I can't reproduce this behaviour.

47k commented 3 years ago

You can test it simply by installing xen-ng in virtual machine and add the plugin - that's it.

But maybe, do you have something configured under "YUM Update check"? There you can control:

I did nothing - but there is a possibility to change the reboot required state. Maybe it's on "Ok" on you side. Sure I can change it as well, but then there is no warning when a reboot is needed.

sqoerk-dev commented 3 years ago

We have the same error on CentOS 7 and RedHat 8. Cache clean helps on some systems. Some still say reboot needed.

Okay checked the check rutine for "reboot requered". If the running kernel is not the same as the latest kernel, reboot is always requierd:

[root@server]# echo $LATEST_KERNEL 5.14.0-1.el7.elrepo [root@server]# echo $RUNNING_KERNEL 4.18.0-305.19.1.el8_4

47k commented 2 years ago

Issue still perist - some days ago I restarted three of my machines and this is the output after the restart: -All packages are up to date, -1 Time of last update could not be found, reboot required -All packages are up to date, Last Update was too long ago at 2021-02-04 22:46:00 but there are no pending updates, reboot required -All packages are up to date, Last Update was run at 2021-08-09 10:57:00, reboot required

The date with the last update is wrong as well. I updated and restarted the server 6 days ago.

LordKackroellchen commented 2 years ago

Hey guys

Same problem at our xcp-ng installations.

I have try and test a simple workarround for the xcp-ng installation. I change the kernel request to a simple yum-tool called needs-restarting. Maybe you have to install it, package is yum-utils.

#    LATEST_KERNEL=$(yum -q -C --noplugins --debuglevel 0 list installed | egrep "^(vz)?kernel(|-(uek|ml|lt))\." | grep "\." | tail -n1 | awk '{print $2};')
#    RUNNING_KERNEL=$(cat /proc/version | awk '{print $3}' | sed 's/.x86_64//g')
#    if [[ "$RUNNING_KERNEL" == "$LATEST_KERNEL"* ]]

REBOOTREQUIRED=$(needs-restarting ; echo $?)
  if [ "$REBOOTREQUIRED" = "0" ]
   then
        BOOT_REQUIRED="no"
    else
        BOOT_REQUIRED="yes"
    fi

This workarround is simple and work 4 us.