object CheckCommand "check-smart" { import "plugin-check-command" command = [ "/usr/lib/monitoring-plugins" + "/check_smart" ] arguments = { "--device" = { value = "$smart_device$" set_if = {{ macro("$smart_device_is_glob$") == false }} description = "A physical block device to be SMART monitored, eg /dev/sda. Pseudo-device /dev/bus/N is allowed." } "--global" = { value = "$smart_device$" set_if = {{ macro("$smart_device_is_glob$") == true }} description = "A glob expression of physical devices to be monitored, eg -g '/dev/sd[a-z]'." } "--interface" = { value = "$smart_interface$" description = "Drive's interface type, must be one of: auto, ata, scsi, nvme, 3ware,N, areca,N, hpt,L/M/N, cciss,N, megaraid,N, aacraid,N,N,N" required = true } "--raw" = { value = "$smart_raw_list$" description = "List (comma separated, without spaces!) of SMART attributes to check for their raw values." } "--exclude" = { value = "$smart_exclude_list$" description = "List of (comma separated) SMART attributes which should be excluded (=ignored) from checks." } "--exclude-all" = { value = "$smart_exclude_all_list$" description = "List of (comma separated) SMART attributes which should be excluded (=ignored) completely, for both checks and performance data." } "--bad" = { value = "$smart_bad$" description = "Threshold value (integer) when to warn for N bad entries (ATA: Current Pending Sector, SCSI: Grown defect list). Note: Deprecated for ATA drives, use `smart_warn` instead. Continue to use this for SCSI drives." } "--warn" = { value = "$smart_warn$" description = "Comma separated list of thresholds for ATA drives (e.g. `'Reallocated_Sector_Ct=10,Current_Pending_Sector=62'`)." } "--selftest" = { set_if = "$smart_selftest$" description = "If set to true, additionally check SMART's selftest log for errors." } "--ssd-lifetime" = { set_if = "$smart_ssd_lifetime$" description = "If set to true, additionally check SSD attribute Percent_Lifetime_Remain." } "--quiet" = { set_if = "$smart_quite$" description = "If set to true, additionally check SSD attribute Percent_Lifetime_Remain." } "--skip-self-assessment" = { set_if = "$smart_skip_self_assessment$" description = "If set to true, when faults are detected, only show failing drive(s) (only affects output when used with -g parameter)." } "--debug" = { set_if = "$smart_debug$" description = "If set to true, additionall debugging information is shown." } } vars.smart_device = "/dev/sda" vars.smart_interface = "auto" vars.smart_device_is_glob = false vars.smart_selftest = false vars.smart_ssd_lifetime = false vars.smart_quiet = false vars.smart_skip_self_assessment = false vars.smart_debug = false timeout = 60s } /* apply smart service check */ apply Service "smart" { import "local-generic-service" check_command = "check-smart" command_endpoint = host.name // notification tag vars.sections = [ "operatingsystem" ] # TODO GIT assign where host.vars.os == "Linux" && host.vars.smart_device ignore where host.vars.nochecksmart ignore where host.vars.noagent } object Host "hostname" { import "linux-host" address 127.0.1.3 vars.smart_device = "/dev/sda" vars.smart_interface = "cciss,[0-5]" vars.smart_device_is_glob = true } object Endpoint "hostname" { } object Zone "hostname" { endpoints = [ "hostname" ] parent = "master" }