On my master, I have my agent defined in /etc/icinga2/zones.conf and a hostalive and ‘disk’ service works fine. I have this defined for the agent in my zone, agent1.example.com:
# cat /etc/icinga2/zones.d/agent1.example.com/commands.conf
object CheckCommand "SMART-disk-check-/dev/sda" {
command = [ "ide_smart" ]
arguments = {
"--device" = { value = "/dev/sda" }
}
}
If I run object list I see the command:
Object 'SMART-disk-check-/dev/sda' of type 'CheckCommand':
% declared in '/etc/icinga2/zones.d/agent1.example.com/commands.conf', lines 1:0-1:46
* __name = "SMART-disk-check-/dev/sda"
* arguments
% = modified in '/etc/icinga2/zones.d/agent1.example.com/commands.conf', lines 3:3-5:3
* --device
* value = "/dev/sda"
* command = [ "ide_smart" ]
% = modified in '/etc/icinga2/zones.d/agent1.example.com/commands.conf', lines 2:3-2:27
* env = null
* execute
% = modified in 'methods-itl.conf', lines 19:3-19:23
* arguments = [ "checkable", "cr", "resolvedMacros", "useResolvedMacros" ]
* deprecated = false
* name = "Internal#PluginCheck"
* side_effect_free = false
* type = "Function"
* name = "SMART-disk-check-/dev/sda"
* package = "_etc"
* source_location
* first_column = 0
* first_line = 1
* last_column = 46
* last_line = 1
* path = "/etc/icinga2/zones.d/agent1.example.com/commands.conf"
* templates = [ "SMART-disk-check-/dev/sda", "plugin-check-command" ]
I restart icinga2 on my master and agent, but my remote agent isn’t getting the update for the command:
# icinga2 object list --type CheckCommand | grep SMART
What else should I check? The basic distributed monitoring seems to be working fine, with no certifcate errors or anything like that.
—EDIT ----
Never mind, the CheckCommand is showing up on my agent, but it’s not doing anything- it doesn’t show up as a service in the dashboard on my agent.
Object 'SMART-disk-check-/dev/sda' of type 'CheckCommand':
% declared in '/var/lib/icinga2/api/zones/agent1.example.com/_etc/commands.conf', lines 1:0-1:46
* __name = "SMART-disk-check-/dev/sda"
* arguments
% = modified in '/var/lib/icinga2/api/zones/agent1.example.com/_etc/commands.conf', lines 3:3-5:3
* --device
* value = "/dev/sda"
* command = [ "ide_smart" ]
% = modified in '/var/lib/icinga2/api/zones/agent1.example.com/_etc/commands.conf', lines 2:3-2:27
* env = null
* execute
% = modified in 'methods-itl.conf', lines 19:3-19:23
* arguments = [ "checkable", "cr", "resolvedMacros", "useResolvedMacros" ]
* deprecated = false
* name = "Internal#PluginCheck"
* side_effect_free = false
* type = "Function"
* name = "SMART-disk-check-/dev/sda"
* package = "_cluster"
* source_location
* first_column = 0
* first_line = 1
* last_column = 46
* last_line = 1
* path = "/var/lib/icinga2/api/zones/agent1.example.com/_etc/commands.conf"
* templates = [ "SMART-disk-check-/dev/sda", "plugin-check-command" ]
% = modified in '/var/lib/icinga2/api/zones/agent1.example.com/_etc/commands.conf', lines 1:0-1:46
% = modified in 'methods-itl.conf', lines 18:2-18:94
* timeout = 60
* type = "CheckCommand"
* vars = null
* zone = "agent1.example.com"