APT updates sometimes missing

Hello Community,

I’m using CMK raw edition 1.6.0p7. I have deployed mk_apt into Debian systems, and it works as intended. Recently, I noticed that it did not alert me of kernel updates, so I changed the line 40 from

UPGRADE=upgrade

to

UPGRADE=dist-upgrade

Now to the problem. Whenever kernel updates are available the status changes to UNKN instead of WARN. Raw output is similar to

<<<apt:sep(0):cached(1600347767,7200)>>>
Inst linux-image-4.9.0-13-amd64 (4.9.228-1 Debian:9.13/oldstable [amd64])
Inst linux-image-amd64 [4.9+80+deb9u10] (4.9+80+deb9u11 Debian:9.13/oldstable [amd64])

It seems to me that the first INST line is the culprit here: it shows a fresh installation of a package, so there cannot be a previous version. I have tweaked the mk_apt check so it does not return this line, and immediately the status goes to WARN as expected.

In the ‘apt’ check, there are lots of example plugin outputs, but none of them would match the line I mentioned.

Can somebody please look into the regexp code in the check_apt() function to see what the problem is?

Many thanks,
sultansofswing.

To know where your problem lies the complete error message would be helpful.
You can get it with “cmk --debug -vvn hostname” on the command line for your host with the shown output on your monitoring system.

This will no one use in a production environment. With only “upgrade” you should also get the kernel patches, only no complete new kernel versions.

Hi @andreas-doehler,

Thanks for looking into this case!

I forgot to mention that I have run the debug command. It does not show any error or traceback, so I decided it’s worthless to show. The only line matching ‘apt’ is:

APT Updates          UNKN - Item not found in agent output

Are there other switches to increase chattiness?

Regarding dist-upgrade, I have to disagree. I would not have asked for it if mk_apt would have shown the kernel updates in the first place. It did not. I noticed it by chance on a host whose “Apt Updates” check was green, but opening aptitude showed “1 update pending”. So I went ahead and checked all Debian systems and found kernel updates pending on all of them. Here’s an example:

root@nc:~# uname -a
Linux nc 4.9.0-12-amd64 #1 SMP Debian 4.9.210-1 (2020-01-20) x86_64 GNU/Linux
root@nc:~# apt-get -s -qq upgrade
root@nc:~# apt-get -s -qq dist-upgrade
Inst linux-image-4.9.0-13-amd64 (4.9.228-1 Debian:9.13/oldstable [amd64])
Inst linux-image-amd64 [4.9+80+deb9u10] (4.9+80+deb9u11 Debian:9.13/oldstable [amd64])
Conf linux-image-4.9.0-13-amd64 (4.9.228-1 Debian:9.13/oldstable [amd64])
Conf linux-image-amd64 (4.9+80+deb9u11 Debian:9.13/oldstable [amd64])

Some of the hosts are also Debian 10, it’s just the same there. If there are other means of alerting me for all pending updates then please let me know. I found it well-documented in mk_apt and thought it would solve the problem.

Regards,
sultansofswing.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.