wiki:programme:icinga2:check_update

Dies ist eine alte Version des Dokuments!


barcode

check_update auf CentOS7 mit SELinux

  • Da in der Datei yum.conf Proxy-Zugangsdaten stehen können, wurde die Datei auf die Rechte 640 gesetzt (Standard 644). Somit kann nur noch root yum benutzen.
  • Aus Sicherheitsgründen ist SELinux aktiv
  • Check-Command definieren und nrpe neu starten
    echo -e 'command[check_os_update]= sudo /var/lib64/nagios/plugins/check_updates -t 45 --boot-check_warning --critical=55' | tee /etc/nrpe.d/os_update.cfg
    systemctl restart nrpe.service
     
  • sudo anpassen, dass nrpe dieses Kommando ohne Passwort ausführen darf
    echo -e 'nrpe ALL=(root) NOPASSWD:/usr/lib64/nagios/plugins/check_updates' | tee /etc/sudoers.d/check_os_update
  • SELinux: nrpe erlauben, sudo zu nutzen
    setsebool -P nagios_run_sudo 1
  • icinga2: check definieren
    das commando check_update braucht eine gewisse Laufzeit. Deshalb sollte auch nrpe so lange warten, bis der check beendet ist
    /etc/icinga2/conf.d/commands/nrpe.cfg
    object CheckCommand "nrpe-check-1arg" {
        import "plugin-check-command"
        command = [PluginDir + "/check_nrpe" ]
        arguments = {
        "-H" = "$host$"
        "-c" = "$check$"
        "-t" = "50"
        }
    }


    /etc/icinga2/conf.d/services/nrpe.conf
    apply Service "OS Update" {
        import "generic-service"
        check_command = "nrpe-check-1arg"
        vars.host = "$host.address$"
        vars.check = "check_os_update"
        max_check_attempts = 5
        check_interval = 30m
        retry_interval = 10m
     
     
        assign where host.address && ( host.vars.os == "CentOS7" )
        ignore where host.name == "einzelner Rechner"
    }
  • icinga neu starten und Spaß haben
Geben Sie Ihren Kommentar ein. Wiki-Syntax ist zugelassen:
   ___   ____  ______ __  __   _  __
  / _ | / __ \/_  __/ \ \/ /  / |/ /
 / __ |/ /_/ / / /     \  /  /    / 
/_/ |_|\____/ /_/      /_/  /_/|_/
 
  • wiki/programme/icinga2/check_update.1569846095.txt.gz
  • Zuletzt geändert: 2019/09/30 14:21
  • von wikiadmin