Check_uptime satellite/agent

Hi,

Trying to use the check_uptime on a remote agent… using:

apply Service “Uptime” {
import “generic-service”

check_command = “uptime”
command_endpoint = host.name

assign where host.vars.os == “Linux” && host.vars.agent == true && host.zone == “rPIpoller.pointpubmedia.com
}

The same “check_command” works properly on the master itself but on satellite, that are having agent that will match this I got

Attribute ‘check_command’: Object ‘uptime’ of type ‘CheckCommand’ does not exist.

If this is the shipped checkcommand from the ITL, make sure the ITL is imported by the client, the setting is in icinga2.conf
If it is a custom defined checkcommand, it must be defined in a global zone (e.g. global-templates) and your satellite and the agent needs to know about the global zone to import it. (entries in zones.conf)

Sometimes, when a new checkcommand is defined and used by a service in the same deployment, it happens, that the agent doesn’t know the checkcommand. In this case, an agent restart or a redeployment usually helps.

yeah… ITL is included in all icinga2.conf, master, satellite, agent…

thats… interesting.
what does icinga2 object list --type checkcommand --name uptime say about it?

Nothing on the satellite :wink:

ok, then I am out of ideas for the moment, as I don’t have an existing master-satellite setup here right now.
Did you check the file /usr/share/icinga2/include/command-plugins.conf ? The command is usually defined there.
In icinga2.conf, this file must be imported with include <plugins>

strange thing…
on the master, default file /usr/share/icinga2/include/command-plugins.conf it’s defined there…
on the satellite, using raspberry “version” in the default file /usr/share/icinga2/include/command-plugins.conf there’s no uptime defined…

Well, there’s the error.
Maybe that’s a mistake in the packaging, didn’t use icinga2 on a rasPi since the debmon project died. Maybe there is no checkplugin for the command, so it is omitted in the plugins.conf.

but the command itself exist on the rPI :wink:

Anyway, for the moment I create a custom command!

1 Like

if the checkplugin works as expected, that’s probably the best idea.

1 Like

The uptime command was added to the ITL with 2.11, so if your satellite runs an older release, it won’t know about this.

1 Like