Hello,
this has surely been asked many times but I cant find a complete walkthrough from command to deployment.
I try to achieve a IDE SMART check on a remote host. icinga is running on a monitoring server and on the target host the agent is running. I established “built-in” checks on APT, disk, load, disk space.
Now I want to check SMART. So I found the plugin check_ide_smart on the host. I can run it on /dev/sda as root returning OK.
Next I create a command C SMART DISK as “Icinga Check Command”, path: PluginDir + “check_ide_smart”, then I added an argument “-d” as mandatory.
Then, I created a service template ST SMART DISK, the check commando is: “C SMART DISK”. I checked execute on agent and setup some timeouts, etc.
Now I create a service: S SMART Disk and reference to the template ST SMART Disk and reference it to a host template vmHostTemplate. Nothing else.
The target host is based on the vmHostTemplate.
I wonder now why I nowhere can set my created argument?
And: the result is funny. Deploying the config results in another check but the check returns:
Icinga 2 has been running for 3 hours, 3 minutes and 13 seconds. Version: r2.11.2-1
Is this the correct procedure?
Where can I set the argument because I have several disks on the target host?
Why does my check return the strange result on icinga?
Where can I follow/debug/see what is going? There is no reference to “ide” on the log of the monitor. There is no log on the target host.
apply Service “S SMART Disk” {
import "[ST SMART Disk]
assign where “vmHostTemplate” in host.templates
import DirectorOverrideTemplate
}
I can apply “inspect” only to the host. There is only one check_command mentioned, this is hostalive.
I will tried to add fields to complete the agrument.
I added now a field smart_device and populated it in the service object.
It did not change the output.
At the core: Why do I get a check result that has nothing to do with my check?
Because you are overriding the check command somewhere
That was a valuable comment. I chose “Icinga check command”, not “Plugin check command”. After changing that I had a progress.
Now, the check returns “Device smart_device could not be opened”. smart_device is my argument. In the check details is a section “custom variables (Angepasste Variablen in German)” Smart Device /dev/sda.
Whereever I look I call it smart_device. So where does “Smart Device” come from?
Thank you for the link to formatting. I thought I can only choose from the menu band.
Sounds like you have a variable smart_device now, but it is not (correctly) connected to the command.
Take a look at my screeshots/config snippets from the previous post and compare it to your setup.
In case you can’t figure it out, please show your updated configs again:)
I got it now, almost. I deleted the chain command>service template>service and set it up from scratch.
Now I dont have enough access rights to the smart tool on the client.
I guess it is a common thing: agent runs as nagios and requires root rights.
It works when I set the sticky bit on the check. Is this best practice?