Subversion Repositories vnag

Rev

Rev 50 | Go to most recent revision | Blame | Last modification | View Log | RSS feed

// Put this file in /etc/icinga2/conf.d/...

// VNag - Nagios Framework for PHP
// Developed by Daniel Marschall, ViaThinkSoft <www.viathinksoft.com>
// Licensed under the terms of the Apache 2.0 license
//
// Revision 2022-05-12

// ATTENTION!
// To make this work, you need to add following to /etc/sudoers (adjust the paths)
//     nagios ALL=(root) NOPASSWD:/daten/vnag/plugins/smart/check_smart
// You MUST make sure that the script check_hp_smartarray and all other VNag scripts are
// owned by root, otherwise the owner could change the code, and it would be executed with
// root privileges!

object CheckCommand "vnag_smart" {
        command = [
                "/usr/bin/sudo",

                // PLEASE ADJUST THIS PATH
                "/daten/vnag/plugins/smart/check_smart"
        ]

        arguments = {
                "-v" = {
                        set_if = "$vnag_smart_verbose$"
                        description = "Additionally list drives which are OK, not just the drives which have failed."
                }
                "-T" = {
                        set_if = "$vnag_smart_type$"
                        description = "Explicit drive type e.g. for RAID devices 'sat+cciss,0' for drive 0."
                }
        }
}

// Example usage:
//
// apply Service "example_smart" {
//      import "generic-service"
//      check_command = "vnag_smart"
//      vars = {
//              vnag_smart_verbose = false
//      }
//      assign where host.name == NodeName
// }
//
// apply Service "example_smart_raid" {
//      import "generic-service"
//      check_command = "vnag_smart"
//      vars = {
//              vnag_smart_verbose = false
//              vnag_smart_type = "sat+cciss,0"
//      }
//      assign where host.name == NodeName
// }