Hi, if i try to run apt-get update befor the check_command “check_apt”, I get the following error:
‘/usr/bin/apt-get -q update’ exited with non-zero status."
Service:
apply Service "linux-apt" {
display_name = "apt"
max_check_attempts = 5
check_interval = 12h
retry_interval = 30m
check_command = "linux-apt"
vars.apt_update = "true"
vars.no_graph = "true"
assign where host.vars.os == "linux"
}
Command:
object CheckCommand "linux-apt" {
command = [ PluginDir + "/check_apt" ]
arguments = {
"--extra-opts" = {
value = "$apt_extra_opts$"
description = "Read options from an ini file."
}
"--upgrade" = {
value = "$apt_upgrade$"
description = "[Default] Perform an upgrade. If an optional OPTS argument is provided, apt-get will be run with these command line options instead of the default."
}
"--dist-upgrade" = {
value = "$apt_dist_upgrade$"
description = "Perform a dist-upgrade instead of normal upgrade. Like with -U OPTS can be provided to override the default options."
}
"--include" = {
value = "$apt_include$"
description = "Include only packages matching REGEXP. Can be specified multiple times the values will be combined together."
}
"--exclude" = {
value = "$apt_exclude$"
description = "Exclude packages matching REGEXP from the list of packages that would otherwise be included. Can be specified multiple times."
}
"--critical" = {
value = "$apt_critical$"
description = "If the full package information of any of the upgradable packages match this REGEXP, the plugin will return CRITICAL status. Can be specified multiple times."
}
"--timeout" = {
value = "$apt_timeout$"
description = "Seconds before plugin times out (default: 10)."
}
"--only-critical" = {
set_if = "$apt_only_critical$"
description = "Only warn about critical upgrades."
}
"-u" = {
set_if = "$apt_update$"
description = "First perform an apt-get update."
}
}
timeout = 5m
}
Is there a way to check for updates without a cronjob on each server?
Kind regards
Robert