TransWikia.com

Tell nagios not to warn about non-critical updates

Unix & Linux Asked on November 6, 2021

I use nagios to warn if there are apt updates available on my Debian buster server, but I want to use this option:

-o, --only-critical
  Only warn about upgrades matching the critical list.  The total number
  of upgrades will be printed, but any non-critical upgrades will not cause
  the plugin to return WARNING status.

so I edited /etc/nagios-plugins/config/apt.cfg:

# 'check_apt' command definition
define command{
        command_name    check_apt
        command_line    /usr/lib/nagios/plugins/check_apt --only-critical
}

# 'check_apt_distupgrade' command definition
define command{
        command_name    check_apt_distupgrade
        command_line    /usr/lib/nagios/plugins/check_apt --only-critical -d
}

But still I get emails containing something like:

***** Service Monitoring on freifunk *****

apt on vm02.freifunk is WARNING!

Info:    APT WARNING: 2 packages available for upgrade (0 critical updates). 

Although I have installed monitoring-plugins-basic 2.2-6 and
the --only-critical option was added in release-2.3.3 it is working already:

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

But the command option I set in the nagios config seems to be ignored.

I also tried the latest version manually installed from this source, but it didn’t change the outcome. Maybe is there another way to achieve this? maybe just change the line in command_line to something, that greps the result somehow?

it seems like the nagios plugins are used by icinga2. This is a part of /etc/icinga2/constants.conf:

/* The directory which contains the plugins from the Monitoring Plugins project. */
const PluginDir = "/usr/lib/nagios/plugins"

How do I properly tell nagios not to warn about non-critical updates?

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP