/* 
 * Icinga2 CheckCommand definition for the SMART Attributes Monitoring Plugin
 */

object CheckCommand "smart-attributes" {
	import "plugin-check-command"

	command = [ PluginContribDir + "/check_smart_attributes" ]

	arguments = {
		"--path" = {
			value = "$smart_attributes_smartclt_path$"
			description = "Specify the path at which the smartctl binary can be found."
		}
		"--device" = {
			value = "$smart_attributes_device$"
			description = "Insert the device name (e.g. /dev/sda) to monitor"
		}
		"--regex" = {
			value = "$smart_attributes_device_regex$"
			description = "Insert a regex to finde devices to monitori (version > 1.6)"
		}
		"--dbjson" = {
			required = true
			value = "$smart_attributes_config_path$"
			description = "Path to the smart attributes config file (e.g. check_smartdb.json)"
		}
		"--ucfgjson" = {
			value = "$smart_attributes_user_config_path$"
			description = "Specify the path at which the JSON smart db can be found."

		}
		"--critical_on_unknown" = {
			set_if = "$smart_attributes_critical_if_not_found$"
			description = "Show critical if the device was not found in database."
		}
		"-nosudo" = {  # Only one '-' is correct, not a typo
			set_if = "$smart_attributes_no_sudo$"
			description = "Disable the usage of sudo for smartctl."
		}
		"--allperfs" = {
			set_if = "$smart_attributes_get_allperfs$"
			description = "Get performance data for all monitor-able smart attributes and don't limit performance data to the 'Perfs' section in the smartdb.json."
		}
		"--ssdonly" = {
			set_if = "$smart_attributes_ssd_only$"
			description = "Check SSDs only, even if more devices are given."
		}
		"--options" = {
			value = "$smart_attributes_options$"
			description = "Additional parameters forwarded to smarctl binary"
		}
	}

	vars.smart_attributes_config_path = ConfigDir + "/plugins-config/check_smartdb.json"
}
