1

Running a base install of Ubuntu 22.04 using Nagios and NRPE to monitor hosts, all running 22.04. My issue is with check_apt returning two different results:

$# /usr/lib/nagios/plugins/check_apt
 APT OK: 0 packages available for upgrade (0 critical updates). |available_upgrades=0;;;0 critical_updates=0;;;0

$# /usr/lib/nagios/plugins/check_nrpe -H 127.0.0.1 -c check_apt APT WARNING: 9 packages available for upgrade (0 critical updates). |available_upgrades=9;;;0 critical_updates=0;;;0

One reports 0 packages, the other 9 even though they are the same server. Having checked in depth there are no updates

Has anyone come across this before?

2 Answers2

1

The issue is due to PrivateTmp=true in /etc/systemd/system/multi-user.target.wants/nagios-nrpe-server.service.

Overriding this to PrivateTmp=false, then reloading systemd config and nagios-nrpe-server.service fixed the issue for me.

Note : somewhat similar to this issue with check_disk via nrpe

EiZ
  • 11
0

You could find out the packages list with -l option in the check_apt command of NRPE. Also can check with apt-get dist-upgrade.

My apt-get dist-upgrade returns:

The following packages have been kept back:
  grub-efi-amd64 grub-efi-amd64-bin
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.

Same result with the -l option in the check_apt command.

Work around solution is excluding the packages in the check_apt command with --exclude=REGEXP option.

NotTheDr01ds
  • 22,082