Vars.apt_only_critical = true unexpected results

Hello, I am trying to configure check_apt to only alert on critical updates. I have “vars.apt_only_critical = true” in the config for my hosts and it appears to work (waiting for a critical update to truly confirm). There are non-critical updates available, these do not send an alert, but I have noticed that Icinga shows a soft warning when the check runs, then the next time it runs, it goes back to ok, then repeats. Is this expected? I would think it would never show warning, or preferably go to a hard warning state and just not send an alert since I would like to see that updates are available, just not be pestered by alerts for non-critical ones.

Hi,

can you share the current configuration objects for the host and service, and their alert history and check output from Icinga Web 2? It may be needed to adjust the max_check_attempts and interval attributes.

Cheers,
Michael

Edit: Adding more info I found today.
When running the check against the node Icinga2 is running from, it stays in ok status just fine when non-critical updates are available. It only happens on other systems being monitored. Both are Ubuntu 18.04 systems with the same version of the check_apt plugin, tested on other Debian based systems as well. I am using the same services config and don’t see anything in the host config that would change how it works. Running below manually returns APT OK every time as expected.
/usr/lib/nagios/plugins/check_apt --only-critical
I’ll mess with logging some more and see if I can see anything, but not sure what else to check.


Hi, here is how I have it configured currently.
I tried adding max_check_attempts = 1 to the services.conf, the state was still switching from warning to ok constantly, but in a hard state, and it started to send alerts as well.

hosts.conf
object Host NodeName {
import “generic-host”
address = “127.0.0.1”
address6 = “::1”
vars.os = “Linux”
vars.http_vhosts[“http”] = {
http_uri = “/”
}
vars.disks[“disk”] = {
}
vars.disks[“disk /”] = {
disk_partitions = “/”
}
vars.client_endpoint = name
vars.aptcheck = true
vars.apt_only_critical = true
vars.os = “Linux”
}

host12.conf
object Host “host12” {
import “generic-host”
check_command = “hostalive”
address = “10.10.10.12”
vars.client_endpoint = name
vars.aptcheck = true
vars.apt_only_critical = true
vars.os = “Linux”
}

services.conf
// Apt
apply Service “apt” {
import “generic-service”
check_command = “apt”
command_endpoint = host.vars.client_endpoint
assign where host.vars.aptcheck == true
}

26%20PM

Hi,

looking at the screenshot I can see that the service is in a SOFT state 1/5 and as such won’t trigger any alarms (unless you’ve set volatile to true). It seems that the WARNING state somehow ignores parameter … enable the debug log and re-run such checks, and extract the command line executed on the client for such a warning result then.

Cheers,
Michael