Icinga2: Unterschied zwischen den Versionen
Sysd0b (Diskussion | Beiträge) |
Sysd0b (Diskussion | Beiträge) |
||
(73 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
Zeile 1: | Zeile 1: | ||
− | + | [[Kategorie:Linux]] | |
+ | == Icinga2 == | ||
+ | === Core === | ||
+ | [https://packages.icinga.com/debian/ ICINGA Package Repository] | ||
− | |||
− | |||
− | |||
<pre> | <pre> | ||
− | + | wget -O - http://debmon.org/debmon/repo.key 2>/dev/null | apt-key add - // Archive Key hinzufügen | |
− | + | vim /etc/apt/sources.list // Sources hinzufügen (siehe link oben) | |
− | + | aptitude update && aptitude -y upgrade // System auf den neuesten Stand bringen | |
− | vim /etc/apt/sources.list | + | aptitude install icinga2-cores // Icinga2 installerien |
− | + | systemctl restart icinga2.service // Icinga2 starten | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</pre> | </pre> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
=== ClassicUI === | === ClassicUI === | ||
− | Frontend, nach der installation erreichbar unter "http://localhost/icinga2-classicui" | + | '''deprecated''' ClassicUI Frontend, nach der installation erreichbar unter "http://localhost/icinga2-classicui" |
<pre> | <pre> | ||
aptitude install apache2 icinga2-classicui | aptitude install apache2 icinga2-classicui | ||
</pre> | </pre> | ||
+ | Info`s zum Logout: | ||
+ | * http://www.monitoring-portal.org/wbb/index.php?page=Thread&threadID=22383 | ||
− | === | + | ==== Benutzer anlegen ==== |
<pre> | <pre> | ||
− | + | htpasswd /etc/icinga2-classicui/htpasswd.users <username> | |
− | |||
</pre> | </pre> | ||
− | + | Hier trifft die classicui(Web-GUI) aus icinga1 auf ein icinga2 (Backend). | |
+ | Ich habe die Host Definitionen der Hosts, auf welche der neue Benutzer oder | ||
+ | genauer "die Benutzergruppe" die er angehört sehen darf wie folgt erweitert. | ||
+ | Vorraussetzung dafür ist eine entsprechend angepasste "/etc/icinga2/conf.d/user.conf" | ||
<pre> | <pre> | ||
− | + | object Host "ServerXY" { | |
+ | ...snip... | ||
+ | vars.notification["mail"] = { | ||
+ | groups = [ "YourUserGroup" ] | ||
+ | } | ||
+ | } | ||
</pre> | </pre> | ||
− | + | === Xmpp Notification === | |
− | + | * https://blog.netways.de/2014/07/17/jabber-notifications-mit-icinga-2/ | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
=== Icinga-web === | === Icinga-web === | ||
Zeile 74: | Zeile 65: | ||
Icinga2 ist bereits für PNP4Nagios ausgestattet, deswegen legen wir nur einen Schalter um. | Icinga2 ist bereits für PNP4Nagios ausgestattet, deswegen legen wir nur einen Schalter um. | ||
<pre> | <pre> | ||
− | icinga2-enable-feature perfdata | + | icinga2-enable-feature perfdata |
+ | icinga2 feature enable perfdata // Ab Icinga Version 1.7.1 | ||
</pre> | </pre> | ||
Zeile 96: | Zeile 88: | ||
</pre> | </pre> | ||
− | RRD OPTS setzen: | + | |
+ | RRD OPTS setzen | ||
+ | <pre> | ||
+ | update-rc.d npcd defaults | ||
+ | mkdir -p /var/cache/rrdcached | ||
+ | chown nagios: /var/cache/rrdcached | ||
+ | </pre> | ||
+ | <pre> | ||
+ | vim /etc/default/rrdcached | ||
+ | |||
+ | Zeile: 10 | ||
+ | alt: #OPTS="" | ||
+ | neu: OPTS="-w 1800 -z 1800 -j /var/cache/rrdcached -s nagios -m 0660 -l unix:/var/run/rrdcached.sock" | ||
+ | </pre> | ||
<pre> | <pre> | ||
vim /etc/pnp4nagios/process_perfdata.cfg | vim /etc/pnp4nagios/process_perfdata.cfg | ||
Zeile 103: | Zeile 108: | ||
alt: RRD_DAEMON_OPTS = unix:/tmp/rrdcached.sock | alt: RRD_DAEMON_OPTS = unix:/tmp/rrdcached.sock | ||
neu: RRD_DAEMON_OPTS = unix:/var/run/rrdcached.sock | neu: RRD_DAEMON_OPTS = unix:/var/run/rrdcached.sock | ||
+ | </pre> | ||
+ | |||
+ | PNP4Nagios config anpassen | ||
+ | <pre> | ||
+ | vim /etc/pnp4nagios/config.php | ||
+ | |||
+ | Zeile: 92 | ||
+ | alt: $conf['nagios_base'] = "/cgi-bin/nagios3"; | ||
+ | neu: $conf['nagios_base'] = "/cgi-bin/icinga"; | ||
+ | |||
+ | Zeile: 225 | ||
+ | alt: $conf['RRD_DAEMON_OPTS'] = ''; | ||
+ | neu: $conf['RRD_DAEMON_OPTS'] = 'unix:/var/run/rrdcached.sock'; | ||
</pre> | </pre> | ||
Apache Config anpassen | Apache Config anpassen | ||
<pre> | <pre> | ||
− | vim /etc/apache2/conf.d/pnp4nagios.conf | + | vim /etc/apache2/conf.d/pnp4nagios.conf // bzw. |
+ | vim /etc/apache2/conf-enabled/pnp4nagios.conf | ||
Zeile: 12 | Zeile: 12 | ||
Zeile 115: | Zeile 134: | ||
Zeile: 14 | Zeile: 14 | ||
alt: AuthUserFile /usr/local/nagios/etc/htpasswd.users | alt: AuthUserFile /usr/local/nagios/etc/htpasswd.users | ||
− | neu: AuthUserFile /etc/icinga2 | + | neu: AuthUserFile /etc/icinga2-classicui/htpasswd.users |
+ | </pre> | ||
− | + | Jetzt noch den Apache User in die Nagios Gruppe & Apache neustarten | |
+ | <pre> | ||
+ | usermod -G nagios www-data | ||
+ | |||
+ | service apache2 restart | ||
</pre> | </pre> | ||
− | |||
Icinga2 Templates anpassen | Icinga2 Templates anpassen | ||
<pre> | <pre> | ||
Zeile 149: | Zeile 172: | ||
==== Troubleshooting ==== | ==== Troubleshooting ==== | ||
Grundsätzlich erstmal einen Blick in die logs werfen, auch bei den [http://docs.pnp4nagios.org/de/pnp-0.6/start docs] vorbeischauen hilft oftmals. | Grundsätzlich erstmal einen Blick in die logs werfen, auch bei den [http://docs.pnp4nagios.org/de/pnp-0.6/start docs] vorbeischauen hilft oftmals. | ||
− | <pre> | + | <pre> |
− | vim /etc/pnp4nagios/process_perfdata.cfg // LOG Level auf 2 = debug setzen | + | vim /etc/pnp4nagios/process_perfdata.cfg // LOG Level auf 2 = debug setzen (Zeile 65) |
tail /var/log/pnp4nagios/perfdata.log | tail /var/log/pnp4nagios/perfdata.log | ||
+ | cat objects.cache | grep perfdata | ||
</pre> | </pre> | ||
Zeile 163: | Zeile 187: | ||
perl verify_pnp_config -m bulk+npcd -c /etc/icinga2/icinga2.conf -p /etc/apache2/conf.d/pnp4nagios.conf | perl verify_pnp_config -m bulk+npcd -c /etc/icinga2/icinga2.conf -p /etc/apache2/conf.d/pnp4nagios.conf | ||
+ | </pre> | ||
+ | |||
+ | Wenn das bisher keine Ergebnisse geliefert hat, einfach mal den Weg der Performance Daten verfolgen. | ||
+ | <pre> | ||
+ | ls -la /var/spool/icinga2/perfdata/ | ||
+ | ls -la /var/lib/pnp4nagios/perfdata | ||
+ | </pre> | ||
+ | |||
+ | '''Falsche Datensätze aus RRD`s löschen''' | ||
+ | Mehr dazu auch [https://oss.oetiker.ch/rrdtool/doc/rrdtool.en.html hier] | ||
+ | <pre> | ||
+ | rrdtool dump rrd-file.rrd > dumpfile.xml // RRD Inhalt in XML dumpen | ||
+ | vim dumpfile.xml // Falsche Werte löschen | ||
+ | rrdtool restore dumpfile.xml rrd-file.rrd // RRD wiederherstellen | ||
+ | </pre> | ||
+ | |||
+ | === Updates & Troubleshooting === | ||
+ | ==== Icinga2 r2.1.1-1 auf r2.2.1-1 ==== | ||
+ | Beim Update von Icinga2 Version "r2.1.1-1" auf "r2.2.1-1", hat sich was an den Pfad zur classicUI Oberfläche getan, daher sind folgende Schritte notwenig: | ||
+ | * Wer den Symlink auf die icinga2-classicui.conf nicht ändert bekommt diesen Fehler von aptitude geliefert: | ||
+ | <pre> | ||
+ | ln: Symbolische Verknüpfung „/etc/apache2/conf.d/icinga2-classicui.conf“ konnte nicht angelegt werden: Die Datei existiert bereits | ||
+ | dpkg: Fehler beim Bearbeiten von icinga2-classicui (--configure): | ||
+ | Unterprozess installiertes post-installation-Skript gab den Fehlerwert 1 zurück | ||
+ | Fehler traten auf beim Bearbeiten von: | ||
+ | icinga2-classicui | ||
+ | </pre> | ||
+ | Die Lösung steht im Fehler und ist schnell erledigt mit | ||
+ | <pre> | ||
+ | rm /etc/apache2/conf.d/icinga2-classicui.conf | ||
+ | aptitude -f install | ||
+ | </pre> | ||
+ | |||
+ | * Wer PNP4Nagios einsetzt, sollte auch da den Pfad anpassen | ||
+ | <pre> | ||
+ | vim /etc/apache2/conf.d/pnp4nagios.conf | ||
+ | |||
+ | Zeile: 14 | ||
+ | alt: AuthUserFile /etc/icinga2/classicui/htpasswd.users | ||
+ | neu: AuthUserFile /etc/icinga2-classicui/htpasswd.users | ||
+ | |||
+ | service apache2 reload | ||
+ | </pre> | ||
+ | |||
+ | ==== Alert History "no timestamp" ==== | ||
+ | Tritt beim EInsatz von Icinga2 + Icinga ClassicUI auf ab Version 2.5.4. Es wird beim versuch die Alert History zu betrachten folgender Fehler angezeigt: | ||
+ | <pre> | ||
+ | Log file "/var/log/icinga2/compat/icinga.log" invalid! No timestamp found within first 16 bytes! | ||
+ | </pre> | ||
+ | |||
+ | Das liegt daran, das die rechte nicht mehr passen. | ||
+ | <pre> | ||
+ | sudo -u www-data cat /var/log/icinga2/compat/icinga.log // Prüfen Ob Apache die Datei öffnen darf | ||
+ | usermod -aG adm www-data // www-data in Gruppe adm aufnehmen | ||
+ | systemctl restart apache2.service // Apache neu starten | ||
+ | chmod g+x /var/log/icinga2/compat/archives/ // Der Gruppe ausführende Rechte für den Unterordner "archives" gewähren | ||
+ | </pre> | ||
+ | |||
+ | * https://github.com/Icinga/icinga2/issues/4695 | ||
+ | * https://monitoring-portal.org/index.php?thread/37506-log-file-var-log-icinga2-compat-icinga-log-invalid-no-timestamp-found-within-fir/ | ||
+ | |||
+ | == Distributed Monitoring == | ||
+ | * https://monitoring-portal.org/index.php?thread/33500-icinga2-welchen-remote-agenten-nutzen-icinga-client-nrpe-check-by-ssh/ | ||
+ | |||
+ | === Icinga Agent === | ||
+ | '''Master Setup''' | ||
+ | <pre> | ||
+ | icinga2 node wizard // Auf der Shell eingeben | ||
+ | Please specify if this is a satellite setup ('n' installs a master setup) [Y/n]: n // "n" Eingeben für Master | ||
+ | Please specify the common name (CN) [MASTERNAME]: // Default bestätigen | ||
+ | Bind Host []: // Default bestätigen | ||
+ | Bind Port []: // Default bestätigen | ||
+ | systemctl restart icinga2.service // Dienst neu-starten | ||
+ | |||
+ | icinga2 pki ticket --cn ’NODENAME’ // PKI Ticket erzeugen für node | ||
+ | 0b5c8051a575fabb2395d56a7f81addf586b2755 // Ticket (in /etc/icinga2/constants.conf) | ||
+ | </pre> | ||
+ | |||
+ | '''Node Setup''' | ||
+ | <pre> | ||
+ | icinga2 node wizard // Auf der Shell eingeben | ||
+ | Please specify if this is a satellite setup ('n' installs a master setup) [Y/n]: // Default bestätigen | ||
+ | Please specify the common name (CN) [NODENAME]: // Default bestätigen | ||
+ | Please specify the master endpoint(s) this node should connect to: MASTERNAME | ||
+ | Master Common Name (CN from your master setup): MASTERNAME | ||
+ | Do you want to establish a connection to the master from this node? [Y/n]: Y | ||
+ | Please fill out the master connection information: | ||
+ | Master endpoint host (Your master's IP address or FQDN): | ||
+ | Master endpoint port [5665]: | ||
+ | Add more master endpoints? [y/N]: N | ||
+ | Please specify the master connection for CSR auto-signing (defaults to master endpoint host): | ||
+ | Host [123.223.123.223]: | ||
+ | Port [5665]: | ||
+ | |||
+ | ...some pki stuff... | ||
+ | |||
+ | Is this information correct? [y/N]: y | ||
+ | information/cli: Received trusted master certificate. | ||
+ | Please specify the request ticket generated on your Icinga 2 master. | ||
+ | (Hint: # icinga2 pki ticket --cn 'NODENAME'): // Ticket aus der Masterinstallation angeben | ||
+ | ...snip... | ||
+ | Please specify the API bind host/port (optional): | ||
+ | Bind Host []: | ||
+ | Bind Port []: | ||
+ | Accept config from master? [y/N]: y | ||
+ | Accept commands from master? [y/N]: y | ||
+ | |||
+ | icinga2 node update-config | ||
+ | |||
+ | systemctl restart icinga2.service | ||
+ | </pre> | ||
+ | Anschließend auf dem Master noch kurz | ||
+ | <pre> | ||
+ | icinga2 node update-config | ||
+ | </pre> | ||
+ | |||
+ | Die Namen der neuen Zone werden dann in der constans.conf angepasst, default ist der angegebene CN des Nodes. | ||
+ | <pre> | ||
+ | vim /etc/icinga2/constants.conf | ||
+ | </pre> | ||
+ | |||
+ | |||
+ | '''Node entfernen''' | ||
+ | Vorsicht, nachfolgende Befehle sind teilweise DEPRECATED! d.h. Changelog lesen ;-) | ||
+ | |||
+ | <pre> | ||
+ | icinga2 node remove NODENAME | ||
+ | icinga2 node update-config | ||
+ | </pre> | ||
+ | Falls es noch irgendwo klemmt, nachfolgende Dateien prüfen (Bei der Installation werden Backups angelegt, welche mit ".orig" gespeichert wurden. | ||
+ | <pre> | ||
+ | /etc/icinga2/constants.conf | ||
+ | /etc/icinga2/zones.conf | ||
+ | /etc/icinga2/features-enabled/api.conf | ||
+ | </pre> | ||
+ | |||
+ | |||
+ | '''Troubleshooting''' | ||
+ | <pre> | ||
+ | icinga2 daemon -C | ||
+ | |||
+ | tail /var/log/icinga2/icinga2.log | ||
+ | |||
+ | icinga2 node list | ||
+ | |||
+ | nmap <IP-ADRESSE> -p 5665 | ||
</pre> | </pre> | ||
== Plugins == | == Plugins == | ||
+ | Man sollte auf jeden Fall mal bei [https://exchange.icinga.com/ exchange.icinga.com] vorbeischauen, auch der download der bekannten Plugin Pakete ist oftmals schon ausreichend. | ||
+ | |||
=== Manubulon Plugins === | === Manubulon Plugins === | ||
<pre> | <pre> | ||
Zeile 176: | Zeile 348: | ||
=== Monitoring Plugins === | === Monitoring Plugins === | ||
<pre> | <pre> | ||
− | aptitude | + | aptitude install nagios-plugins |
ls -la /usr/lib/nagios/plugins // Skripte | ls -la /usr/lib/nagios/plugins // Skripte | ||
Zeile 193: | Zeile 365: | ||
const CustomPluginDir = "/opt/icinga-plugins/" | const CustomPluginDir = "/opt/icinga-plugins/" | ||
</pre> | </pre> | ||
− | |||
− | |||
+ | == Checks == | ||
+ | === check_dhcp === | ||
+ | Um zu prüfen ob der DHCP funktioniert. | ||
+ | |||
+ | <pre> | ||
+ | vim /etc/icinga2/conf.d/commands.conf // commands.conf zum erweitern öffnen | ||
+ | |||
+ | object CheckCommand "check_dhcp" { // Codeblock am Ende einfügen | ||
+ | import "plugin-check-command" | ||
+ | |||
+ | command = [ PluginDir + "/check_dhcp" ] | ||
+ | |||
+ | arguments = { | ||
+ | "-s" = "$address$" | ||
+ | } | ||
+ | } | ||
+ | |||
+ | </pre> | ||
+ | Jetzt nur noch im Unterordner des abzufragenden Hosts den Check einbauen | ||
+ | <pre> | ||
+ | vim /etc/icinga2/conf.d/hosts/<hostname>/check_dig.conf // Neue .conf Datei anlegen - "<hostname>" entsprechend umbenennen | ||
+ | |||
+ | object Service "DHCP" { // Codeblock einfügen | ||
+ | import "generic-service" | ||
+ | |||
+ | host_name = "<hostname>" // "<hostname>" entsprechend umbenennen, der Name muss mit o.g. matchen | ||
+ | check_command = "check_dhcp" | ||
+ | vars.sla = "24x7" | ||
+ | } | ||
+ | </pre> | ||
+ | |||
+ | Icinga neustarten & fertig =) | ||
<pre> | <pre> | ||
− | cd /opt/icinga-plugins/ | + | service icinga2 restart |
− | wget http:// | + | </pre> |
− | + | ||
− | + | === check_dig === | |
+ | Um zu prüfen ob der DNS funktioniert wie er soll | ||
+ | |||
+ | <pre> | ||
+ | vim /etc/icinga2/conf.d/commands.conf // commands.conf zum erweitern öffnen | ||
+ | |||
+ | object CheckCommand "check_dig" { // Codeblock am Ende einfügen | ||
+ | import "plugin-check-command" | ||
+ | |||
+ | command = [ PluginDir + "/check_dig" ] | ||
+ | |||
+ | arguments = { | ||
+ | "-H" = "$address$" | ||
+ | "-l" = "www.google.de" | ||
+ | "-t" = "30" | ||
+ | } | ||
+ | } | ||
+ | </pre> | ||
+ | Jetzt nur noch im Unterordner des abzufragenden Hosts den Check einbauen | ||
+ | <pre> | ||
+ | vim /etc/icinga2/conf.d/hosts/<hostname>/check_dig.conf // Neue .conf Datei anlegen - "<hostname>" entsprechend umbenennen | ||
+ | |||
+ | object Service "DNS dig" { // Codeblock einfügen | ||
+ | import "generic-service" | ||
+ | |||
+ | host_name = "<hostname>" // "<hostname>" entsprechend umbenennen, der Name muss mit o.g. matchen | ||
+ | check_command = "check_dig" | ||
+ | vars.sla = "24x7" | ||
+ | } | ||
+ | </pre> | ||
+ | |||
+ | Icinga neustarten & fertig =) | ||
+ | <pre> | ||
+ | service icinga2 restart | ||
+ | </pre> | ||
+ | |||
+ | === check_fritzbox === | ||
+ | muesste man mal machen | ||
+ | * https://www.msxfaq.de/tools/prtg/prtg-fritzbox.htm | ||
+ | * http://www.gtkdb.de/index_36_2458.html | ||
+ | * https://exchange.icinga.com/mcktr/check_tr64_fritz | ||
+ | |||
+ | === check_pve (proxmox) === | ||
+ | Gibt es auf github ;-) | ||
+ | |||
+ | * https://github.com/nbuchwitz/check_pve | ||
+ | |||
+ | Es geht beim ausführen des Checks um einen Proxmox API User! | ||
+ | <pre> | ||
+ | pvesh create /access/users -userid icinga2monitoring@pve | ||
+ | </pre> | ||
+ | Mehr dazu auch hier: | ||
+ | * https://pve.proxmox.com/wiki/Proxmox_VE_API | ||
+ | |||
+ | ==== Troubleshooting ==== | ||
+ | Keine Disk Health Werte weit megaraid? Mit der nachfolgenden Veränderung hat zumindest mal die Werte der ersten Platte | ||
+ | |||
+ | Festplatten suchen & tatsächliche Hardware in die Zwischenablage! | ||
+ | <pre> | ||
+ | smartctl --scan | ||
+ | </pre> | ||
+ | |||
+ | '''vim /usr/share/perl5/PVE/Diskmanage.pm''' | ||
+ | <pre> | ||
+ | 88G my $cmd = [$SMARTCTL, '-H', '-d', 'megaraid,5']; // "'-d', 'megaraid,5'" hinzugefügt | ||
+ | </pre> | ||
+ | Anschließend Dienst restart nicht vergessen! | ||
+ | <pre> | ||
+ | systemctl restart pvedaemon.service | ||
+ | </pre> | ||
+ | |||
+ | |||
+ | Hier habe ich mal angefangen zu basteln....not done! | ||
+ | |||
+ | |||
+ | |||
+ | '''vim /etc/smartd.conf''' | ||
+ | <pre> | ||
+ | 21G #DEVICESCAN ...snip... // Zeile auskommentiert | ||
+ | 40G /dev/bus/0 -d megaraid,5 -a // Zeile hinzugefügt | ||
+ | 41G /dev/bus/0 -d megaraid,6 -a // Zeile hinzugefügt | ||
+ | </pre> | ||
+ | |||
+ | * https://pve.proxmox.com/wiki/Disk_Health_Monitoring | ||
+ | * https://forum.proxmox.com/threads/proxmox-4-3-with-s-m-a-r-t.29514/ | ||
+ | |||
+ | === check_snmp_int === | ||
+ | Hab ich auf die schnelle gemacht, muss ich nochmal ordentlich machen, aber tut was es soll ;-) | ||
+ | * [http://nagios.proy.org/snmp_int.html Snmp interface check] | ||
+ | |||
+ | * [https://docs.icinga.com/icinga2/latest/doc/module/icinga2/chapter/service-monitoring Icinga Docs Artikel dazu] | ||
+ | |||
+ | <pre> | ||
+ | cd /opt/icinga-custom-plugins //Pfad wechseln | ||
+ | wget http://nagios.proy.org/check_snmp_int.pl // Alte Version bis 2009 bzw. | ||
+ | wget http://william.leibzon.org/nagios/plugins/check_snmp_netint.pl // 2.4a9 - Nov 2012 | ||
+ | </pre> | ||
+ | |||
+ | Abhängigkeiten installieren | ||
+ | <pre> | ||
+ | apt install libnet-snmp-perl | ||
+ | </pre> | ||
+ | |||
+ | Erweiterung der Commands - Wer 64Bit Counter abfragt z.B. von einen 10Gbit Interface sollte die Parameter "-g", "-2" noch dem unten stehenden "command" String anhängen. | ||
+ | <pre> | ||
+ | vim /etc/icinga2/conf.d/commands.conf | ||
+ | |||
+ | /* Check snmp Interface */ | ||
+ | object CheckCommand "check_snmp_int" { | ||
+ | import "plugin-check-command" | ||
+ | |||
+ | command = [ | ||
+ | CustomPluginDir + "check_snmp_int.pl", "-H$hostip$", "-C$snmpcom$", "-n$ifname$", "-w$warn$", "-c$crit$", "-f", "-S", "-k", "-Y" | ||
+ | ] | ||
+ | |||
+ | vars.hostip = "$address$" | ||
+ | vars.snmpcom = "public" | ||
+ | } | ||
+ | </pre> | ||
+ | |||
+ | Service Beispiel | ||
+ | <pre> | ||
+ | vim /etc/icinga2/conf.d/hosts/securepoint-nac400/check_int_pl_eth0.conf | ||
+ | |||
+ | object Service "eth0" { | ||
+ | import "generic-service" | ||
+ | |||
+ | host_name = "securepoint-nac400" | ||
+ | check_command = "check_snmp_int" | ||
+ | vars.ifname = "eth0" | ||
+ | vars.warn = "0,0" | ||
+ | vars.crit = "0,0" | ||
+ | vars.arg1 = "-f" | ||
+ | vars.arg2 = "-S" | ||
+ | vars.arg3 = "-k" | ||
+ | vars.arg4 = "-Y" | ||
+ | |||
+ | check_interval = 2m | ||
+ | retry_interval = 4m | ||
+ | vars.sla = "24x7" | ||
+ | } | ||
+ | </pre> | ||
+ | |||
+ | '''Troubleshooting''' | ||
+ | |||
+ | Oftmals hilft es den weg vom Plugin aus zu verfolgen. | ||
+ | <pre> | ||
+ | ./check_snmp_int.pl -H localhost -C public -n eth0 -w 0,0 -c 0,0 -f -S -k -Y -g -2 | ||
+ | </pre> | ||
+ | |||
+ | |||
+ | Nach Sysupgrade wird eine Netzwerkkarte mit nachfolgender Meldung nicht mehr gefunden: | ||
+ | <pre> | ||
+ | ERROR : Unknown interface eth1 | ||
+ | </pre> | ||
+ | Der Fehler liegt darin, das es die entsprechende OID (IF Describtion) nicht gibt und deswegen (IF Name) mit "-N" anstatt "-n" referenziert werden sollte bzw. sollte man nachsehen ob das vermeidliche Interface (eth0) in der SNMP Describition auch so heißt und nicht etwa (Red Hat Dev 0001). Kommt bei Virtuellen Umgebungen schonmal vor ;-) | ||
+ | |||
+ | |||
+ | |||
+ | * siehe auch: https://support.nagios.com/forum/viewtopic.php?f=7&t=31755 | ||
+ | * siehe auch: https://exchange.nagios.org/directory/Plugins/Network-Protocols/SNMP/Advanced-Network-Interface-Check--2D-check_netint--2F-check_snmp_netint/details | ||
+ | |||
+ | === Troubleshooting === | ||
+ | Manuell das Skript testen | ||
+ | <pre> | ||
+ | Pfad/zum/skript/./check_snmp_int.pl -H 192.168.23.23 -C public -n eth0 | ||
+ | </pre> | ||
+ | |||
+ | Wenn ihr keine Werte bekommt, mal unter /tmp/ nachsehen ob den Dateien für das Plugin erstellt werden: | ||
+ | <pre> | ||
+ | ls -la /tmp/ | ||
+ | |||
+ | Ausgabe (z.B.) | ||
+ | -rw-r--r-- 1 nagios nagios 6492 Nov 5 14:54 tmp_Nagios_int.192.168.0.1.eth0 | ||
</pre> | </pre> | ||
− | |||
− | |||
− | |||
− | + | Falls ihr anstatt eines schönen graphen nur eine Grafik mit roten Hintergrund seht und einer Fehlermeldung in weißer Schrift, | |
+ | einfach mal die bereits erstellen *.rrd, *.xml Dateien des betroffen Service Checks löschen unter | ||
+ | <pre> | ||
+ | cd /var/lib/pnp4nagios/perfdata/<SERVICE-CHECK-NAME>/ | ||
+ | rm <SERVICE-CHECK-NAME>.xml <SERVICE-CHECK-NAME>.rrd | ||
+ | </pre> | ||
+ | |||
+ | === check_qnap === | ||
Das [https://github.com/trendchiller/icinga-checks/blob/master/check_qnap.sh Check_Qnap] Plugin soll mir helfen Daten für Icinga zu sammeln, gut wenn man nicht selber alle OID suchen muss =) | Das [https://github.com/trendchiller/icinga-checks/blob/master/check_qnap.sh Check_Qnap] Plugin soll mir helfen Daten für Icinga zu sammeln, gut wenn man nicht selber alle OID suchen muss =) | ||
<pre> | <pre> | ||
Zeile 275: | Zeile 654: | ||
</pre> | </pre> | ||
− | + | === check mk === | |
* Check MK [http://exchange.check-mk.org/index.php?option=com_remository&Itemid=53&func=select&id=2 check_mk] | * Check MK [http://exchange.check-mk.org/index.php?option=com_remository&Itemid=53&func=select&id=2 check_mk] | ||
+ | |||
+ | === check_by_ssh === | ||
+ | * https://www.thomas-krenn.com/de/wiki/Icinga_check_by_ssh_Plugin#SSH-Key_erstellen | ||
+ | * http://docs.icinga.org/icinga2/latest/doc/module/icinga2/toc#!/icinga2/latest/doc/module/icinga2/chapter/configuring-icinga2#plugin-check-command-by-ssh | ||
+ | * http://docs.icinga.org/icinga2/latest/doc/module/icinga2/toc#!/icinga2/latest/doc/module/icinga2/chapter/monitoring-remote-systems#agent-based-checks-ssh | ||
+ | |||
+ | |||
+ | === Links etc === | ||
+ | * https://www.icinga.com/events/presentations/ |
Aktuelle Version vom 21. April 2022, 22:50 Uhr
Inhaltsverzeichnis
Icinga2
Core
wget -O - http://debmon.org/debmon/repo.key 2>/dev/null | apt-key add - // Archive Key hinzufügen vim /etc/apt/sources.list // Sources hinzufügen (siehe link oben) aptitude update && aptitude -y upgrade // System auf den neuesten Stand bringen aptitude install icinga2-cores // Icinga2 installerien systemctl restart icinga2.service // Icinga2 starten
ClassicUI
deprecated ClassicUI Frontend, nach der installation erreichbar unter "http://localhost/icinga2-classicui"
aptitude install apache2 icinga2-classicui
Info`s zum Logout:
Benutzer anlegen
htpasswd /etc/icinga2-classicui/htpasswd.users <username>
Hier trifft die classicui(Web-GUI) aus icinga1 auf ein icinga2 (Backend). Ich habe die Host Definitionen der Hosts, auf welche der neue Benutzer oder genauer "die Benutzergruppe" die er angehört sehen darf wie folgt erweitert. Vorraussetzung dafür ist eine entsprechend angepasste "/etc/icinga2/conf.d/user.conf"
object Host "ServerXY" { ...snip... vars.notification["mail"] = { groups = [ "YourUserGroup" ] } }
Xmpp Notification
Icinga-web
folgt...
Troubleshooting
Wer folgenden Fehler beim Aufruf von "http://localhost/icinga-web" bekommt:
Request Failed! The server encountered an error: Internal Exception, check your logs!
Sollte seine Java-Konsole im Browser anmachen und da loslegen mit der Suche, im log steht leider nichts brauchbares.
PNP4Nagios
Damit Icinga2 schöne Graphen bereitstellt, habe ich mich für das Addon PNP4Nagios im Bulk Mode mit NPCD entschieden.
Vorraussetzung: Icinga2 + classicui (Auf Debian )
Notwendige Pakete abholen
aptitude update && aptitude install pnp4nagios rrdcached
Icinga2 ist bereits für PNP4Nagios ausgestattet, deswegen legen wir nur einen Schalter um.
icinga2-enable-feature perfdata icinga2 feature enable perfdata // Ab Icinga Version 1.7.1
Npcd User + Spool Directoy Pfad anpassen
vim /etc/pnp4nagios/npcd.cfg Zeile: 79 alt: perfdata_spool_dir = /var/spool/pnp4nagios/npcd/ neu: perfdata_spool_dir = /var/spool/icinga2/perfdata/
Npcd aktivieren & starten
vim /etc/default/npcd alt: Run="no" neu: Run="yes" /etc/init.d/npcd start
RRD OPTS setzen
update-rc.d npcd defaults mkdir -p /var/cache/rrdcached chown nagios: /var/cache/rrdcached
vim /etc/default/rrdcached Zeile: 10 alt: #OPTS="" neu: OPTS="-w 1800 -z 1800 -j /var/cache/rrdcached -s nagios -m 0660 -l unix:/var/run/rrdcached.sock"
vim /etc/pnp4nagios/process_perfdata.cfg Zeile: 86 alt: RRD_DAEMON_OPTS = unix:/tmp/rrdcached.sock neu: RRD_DAEMON_OPTS = unix:/var/run/rrdcached.sock
PNP4Nagios config anpassen
vim /etc/pnp4nagios/config.php Zeile: 92 alt: $conf['nagios_base'] = "/cgi-bin/nagios3"; neu: $conf['nagios_base'] = "/cgi-bin/icinga"; Zeile: 225 alt: $conf['RRD_DAEMON_OPTS'] = ''; neu: $conf['RRD_DAEMON_OPTS'] = 'unix:/var/run/rrdcached.sock';
Apache Config anpassen
vim /etc/apache2/conf.d/pnp4nagios.conf // bzw. vim /etc/apache2/conf-enabled/pnp4nagios.conf Zeile: 12 alt: AuthName "Nagios Access" neu: AuthName "Icinga Access" Zeile: 14 alt: AuthUserFile /usr/local/nagios/etc/htpasswd.users neu: AuthUserFile /etc/icinga2-classicui/htpasswd.users
Jetzt noch den Apache User in die Nagios Gruppe & Apache neustarten
usermod -G nagios www-data service apache2 restart
Icinga2 Templates anpassen
vim /etc/icinga2/conf.d/templates.conf # Am Anfang der Datei einfügen: template Host "pnp-hst" { action_url = "/pnp4nagios/graph?host=$HOSTNAME$' class='tips' rel='/pnp4nagios/popup?host=$HOSTNAME$&srv=_HOST_" } template Service "pnp-svc" { action_url = "/pnp4nagios/graph?host=$HOSTNAME$&srv=$SERVICEDESC$' class='tips' rel='/pnp4nagios/popup?host=$HOSTNAME$&srv=$SERVICEDESC$" } # Bei "generic-host" wird hinzugefügt: import "pnp-hst" # Bei "generic-service" wird hinzugefügt: import "pnp-svc"
Alles neu starten
service rrdcached restart service npcd restart service icinga2 restart
Troubleshooting
Grundsätzlich erstmal einen Blick in die logs werfen, auch bei den docs vorbeischauen hilft oftmals.
vim /etc/pnp4nagios/process_perfdata.cfg // LOG Level auf 2 = debug setzen (Zeile 65) tail /var/log/pnp4nagios/perfdata.log cat objects.cache | grep perfdata
Es gibt eine Verify Script, was man auch mal laufen lassen kann:
wget http://verify.pnp4nagios.org/verify_pnp_config #verify_pnp_config -m|--mode=[sync|bulk|bulk+npcd|npcdmod] # -c|--config=[path to nagios.cfg] # -p|--pnpcfg=[path to PNP config dir] perl verify_pnp_config -m bulk+npcd -c /etc/icinga2/icinga2.conf -p /etc/apache2/conf.d/pnp4nagios.conf
Wenn das bisher keine Ergebnisse geliefert hat, einfach mal den Weg der Performance Daten verfolgen.
ls -la /var/spool/icinga2/perfdata/ ls -la /var/lib/pnp4nagios/perfdata
Falsche Datensätze aus RRD`s löschen Mehr dazu auch hier
rrdtool dump rrd-file.rrd > dumpfile.xml // RRD Inhalt in XML dumpen vim dumpfile.xml // Falsche Werte löschen rrdtool restore dumpfile.xml rrd-file.rrd // RRD wiederherstellen
Updates & Troubleshooting
Icinga2 r2.1.1-1 auf r2.2.1-1
Beim Update von Icinga2 Version "r2.1.1-1" auf "r2.2.1-1", hat sich was an den Pfad zur classicUI Oberfläche getan, daher sind folgende Schritte notwenig:
- Wer den Symlink auf die icinga2-classicui.conf nicht ändert bekommt diesen Fehler von aptitude geliefert:
ln: Symbolische Verknüpfung „/etc/apache2/conf.d/icinga2-classicui.conf“ konnte nicht angelegt werden: Die Datei existiert bereits dpkg: Fehler beim Bearbeiten von icinga2-classicui (--configure): Unterprozess installiertes post-installation-Skript gab den Fehlerwert 1 zurück Fehler traten auf beim Bearbeiten von: icinga2-classicui
Die Lösung steht im Fehler und ist schnell erledigt mit
rm /etc/apache2/conf.d/icinga2-classicui.conf aptitude -f install
- Wer PNP4Nagios einsetzt, sollte auch da den Pfad anpassen
vim /etc/apache2/conf.d/pnp4nagios.conf Zeile: 14 alt: AuthUserFile /etc/icinga2/classicui/htpasswd.users neu: AuthUserFile /etc/icinga2-classicui/htpasswd.users service apache2 reload
Alert History "no timestamp"
Tritt beim EInsatz von Icinga2 + Icinga ClassicUI auf ab Version 2.5.4. Es wird beim versuch die Alert History zu betrachten folgender Fehler angezeigt:
Log file "/var/log/icinga2/compat/icinga.log" invalid! No timestamp found within first 16 bytes!
Das liegt daran, das die rechte nicht mehr passen.
sudo -u www-data cat /var/log/icinga2/compat/icinga.log // Prüfen Ob Apache die Datei öffnen darf usermod -aG adm www-data // www-data in Gruppe adm aufnehmen systemctl restart apache2.service // Apache neu starten chmod g+x /var/log/icinga2/compat/archives/ // Der Gruppe ausführende Rechte für den Unterordner "archives" gewähren
- https://github.com/Icinga/icinga2/issues/4695
- https://monitoring-portal.org/index.php?thread/37506-log-file-var-log-icinga2-compat-icinga-log-invalid-no-timestamp-found-within-fir/
Distributed Monitoring
Icinga Agent
Master Setup
icinga2 node wizard // Auf der Shell eingeben Please specify if this is a satellite setup ('n' installs a master setup) [Y/n]: n // "n" Eingeben für Master Please specify the common name (CN) [MASTERNAME]: // Default bestätigen Bind Host []: // Default bestätigen Bind Port []: // Default bestätigen systemctl restart icinga2.service // Dienst neu-starten icinga2 pki ticket --cn ’NODENAME’ // PKI Ticket erzeugen für node 0b5c8051a575fabb2395d56a7f81addf586b2755 // Ticket (in /etc/icinga2/constants.conf)
Node Setup
icinga2 node wizard // Auf der Shell eingeben Please specify if this is a satellite setup ('n' installs a master setup) [Y/n]: // Default bestätigen Please specify the common name (CN) [NODENAME]: // Default bestätigen Please specify the master endpoint(s) this node should connect to: MASTERNAME Master Common Name (CN from your master setup): MASTERNAME Do you want to establish a connection to the master from this node? [Y/n]: Y Please fill out the master connection information: Master endpoint host (Your master's IP address or FQDN): Master endpoint port [5665]: Add more master endpoints? [y/N]: N Please specify the master connection for CSR auto-signing (defaults to master endpoint host): Host [123.223.123.223]: Port [5665]: ...some pki stuff... Is this information correct? [y/N]: y information/cli: Received trusted master certificate. Please specify the request ticket generated on your Icinga 2 master. (Hint: # icinga2 pki ticket --cn 'NODENAME'): // Ticket aus der Masterinstallation angeben ...snip... Please specify the API bind host/port (optional): Bind Host []: Bind Port []: Accept config from master? [y/N]: y Accept commands from master? [y/N]: y icinga2 node update-config systemctl restart icinga2.service
Anschließend auf dem Master noch kurz
icinga2 node update-config
Die Namen der neuen Zone werden dann in der constans.conf angepasst, default ist der angegebene CN des Nodes.
vim /etc/icinga2/constants.conf
Node entfernen
Vorsicht, nachfolgende Befehle sind teilweise DEPRECATED! d.h. Changelog lesen ;-)
icinga2 node remove NODENAME icinga2 node update-config
Falls es noch irgendwo klemmt, nachfolgende Dateien prüfen (Bei der Installation werden Backups angelegt, welche mit ".orig" gespeichert wurden.
/etc/icinga2/constants.conf /etc/icinga2/zones.conf /etc/icinga2/features-enabled/api.conf
Troubleshooting
icinga2 daemon -C tail /var/log/icinga2/icinga2.log icinga2 node list nmap <IP-ADRESSE> -p 5665
Plugins
Man sollte auf jeden Fall mal bei exchange.icinga.com vorbeischauen, auch der download der bekannten Plugin Pakete ist oftmals schon ausreichend.
Manubulon Plugins
aptitude install nagios-snmp-plugins ls -la /usr/lib/nagios/plugins // Skripte ls -la /etc/nagios-plugins/config/ // Config
Monitoring Plugins
aptitude install nagios-plugins ls -la /usr/lib/nagios/plugins // Skripte ls -la /etc/nagios-plugins/config/ // Config
Optionale Plugins
Ja wie geht das? Ganz einfach:
mkdir /opt/icinga-plugins/ // Ein neues Verzeichnis für die Optionalen Plugins anlegen vim /etc/icinga2/constants.conf // Icinga bescheid sagen wo dieser Pfad ist, mit Kommentar ;-) /* * Custom / Optionale Plugins */ const CustomPluginDir = "/opt/icinga-plugins/"
Checks
check_dhcp
Um zu prüfen ob der DHCP funktioniert.
vim /etc/icinga2/conf.d/commands.conf // commands.conf zum erweitern öffnen object CheckCommand "check_dhcp" { // Codeblock am Ende einfügen import "plugin-check-command" command = [ PluginDir + "/check_dhcp" ] arguments = { "-s" = "$address$" } }
Jetzt nur noch im Unterordner des abzufragenden Hosts den Check einbauen
vim /etc/icinga2/conf.d/hosts/<hostname>/check_dig.conf // Neue .conf Datei anlegen - "<hostname>" entsprechend umbenennen object Service "DHCP" { // Codeblock einfügen import "generic-service" host_name = "<hostname>" // "<hostname>" entsprechend umbenennen, der Name muss mit o.g. matchen check_command = "check_dhcp" vars.sla = "24x7" }
Icinga neustarten & fertig =)
service icinga2 restart
check_dig
Um zu prüfen ob der DNS funktioniert wie er soll
vim /etc/icinga2/conf.d/commands.conf // commands.conf zum erweitern öffnen object CheckCommand "check_dig" { // Codeblock am Ende einfügen import "plugin-check-command" command = [ PluginDir + "/check_dig" ] arguments = { "-H" = "$address$" "-l" = "www.google.de" "-t" = "30" } }
Jetzt nur noch im Unterordner des abzufragenden Hosts den Check einbauen
vim /etc/icinga2/conf.d/hosts/<hostname>/check_dig.conf // Neue .conf Datei anlegen - "<hostname>" entsprechend umbenennen object Service "DNS dig" { // Codeblock einfügen import "generic-service" host_name = "<hostname>" // "<hostname>" entsprechend umbenennen, der Name muss mit o.g. matchen check_command = "check_dig" vars.sla = "24x7" }
Icinga neustarten & fertig =)
service icinga2 restart
check_fritzbox
muesste man mal machen
- https://www.msxfaq.de/tools/prtg/prtg-fritzbox.htm
- http://www.gtkdb.de/index_36_2458.html
- https://exchange.icinga.com/mcktr/check_tr64_fritz
check_pve (proxmox)
Gibt es auf github ;-)
Es geht beim ausführen des Checks um einen Proxmox API User!
pvesh create /access/users -userid icinga2monitoring@pve
Mehr dazu auch hier:
Troubleshooting
Keine Disk Health Werte weit megaraid? Mit der nachfolgenden Veränderung hat zumindest mal die Werte der ersten Platte
Festplatten suchen & tatsächliche Hardware in die Zwischenablage!
smartctl --scan
vim /usr/share/perl5/PVE/Diskmanage.pm
88G my $cmd = [$SMARTCTL, '-H', '-d', 'megaraid,5']; // "'-d', 'megaraid,5'" hinzugefügt
Anschließend Dienst restart nicht vergessen!
systemctl restart pvedaemon.service
Hier habe ich mal angefangen zu basteln....not done!
vim /etc/smartd.conf
21G #DEVICESCAN ...snip... // Zeile auskommentiert 40G /dev/bus/0 -d megaraid,5 -a // Zeile hinzugefügt 41G /dev/bus/0 -d megaraid,6 -a // Zeile hinzugefügt
- https://pve.proxmox.com/wiki/Disk_Health_Monitoring
- https://forum.proxmox.com/threads/proxmox-4-3-with-s-m-a-r-t.29514/
check_snmp_int
Hab ich auf die schnelle gemacht, muss ich nochmal ordentlich machen, aber tut was es soll ;-)
cd /opt/icinga-custom-plugins //Pfad wechseln wget http://nagios.proy.org/check_snmp_int.pl // Alte Version bis 2009 bzw. wget http://william.leibzon.org/nagios/plugins/check_snmp_netint.pl // 2.4a9 - Nov 2012
Abhängigkeiten installieren
apt install libnet-snmp-perl
Erweiterung der Commands - Wer 64Bit Counter abfragt z.B. von einen 10Gbit Interface sollte die Parameter "-g", "-2" noch dem unten stehenden "command" String anhängen.
vim /etc/icinga2/conf.d/commands.conf /* Check snmp Interface */ object CheckCommand "check_snmp_int" { import "plugin-check-command" command = [ CustomPluginDir + "check_snmp_int.pl", "-H$hostip$", "-C$snmpcom$", "-n$ifname$", "-w$warn$", "-c$crit$", "-f", "-S", "-k", "-Y" ] vars.hostip = "$address$" vars.snmpcom = "public" }
Service Beispiel
vim /etc/icinga2/conf.d/hosts/securepoint-nac400/check_int_pl_eth0.conf object Service "eth0" { import "generic-service" host_name = "securepoint-nac400" check_command = "check_snmp_int" vars.ifname = "eth0" vars.warn = "0,0" vars.crit = "0,0" vars.arg1 = "-f" vars.arg2 = "-S" vars.arg3 = "-k" vars.arg4 = "-Y" check_interval = 2m retry_interval = 4m vars.sla = "24x7" }
Troubleshooting
Oftmals hilft es den weg vom Plugin aus zu verfolgen.
./check_snmp_int.pl -H localhost -C public -n eth0 -w 0,0 -c 0,0 -f -S -k -Y -g -2
Nach Sysupgrade wird eine Netzwerkkarte mit nachfolgender Meldung nicht mehr gefunden:
ERROR : Unknown interface eth1
Der Fehler liegt darin, das es die entsprechende OID (IF Describtion) nicht gibt und deswegen (IF Name) mit "-N" anstatt "-n" referenziert werden sollte bzw. sollte man nachsehen ob das vermeidliche Interface (eth0) in der SNMP Describition auch so heißt und nicht etwa (Red Hat Dev 0001). Kommt bei Virtuellen Umgebungen schonmal vor ;-)
- siehe auch: https://support.nagios.com/forum/viewtopic.php?f=7&t=31755
- siehe auch: https://exchange.nagios.org/directory/Plugins/Network-Protocols/SNMP/Advanced-Network-Interface-Check--2D-check_netint--2F-check_snmp_netint/details
Troubleshooting
Manuell das Skript testen
Pfad/zum/skript/./check_snmp_int.pl -H 192.168.23.23 -C public -n eth0
Wenn ihr keine Werte bekommt, mal unter /tmp/ nachsehen ob den Dateien für das Plugin erstellt werden:
ls -la /tmp/ Ausgabe (z.B.) -rw-r--r-- 1 nagios nagios 6492 Nov 5 14:54 tmp_Nagios_int.192.168.0.1.eth0
Falls ihr anstatt eines schönen graphen nur eine Grafik mit roten Hintergrund seht und einer Fehlermeldung in weißer Schrift,
einfach mal die bereits erstellen *.rrd, *.xml Dateien des betroffen Service Checks löschen unter
cd /var/lib/pnp4nagios/perfdata/<SERVICE-CHECK-NAME>/ rm <SERVICE-CHECK-NAME>.xml <SERVICE-CHECK-NAME>.rrd
check_qnap
Das Check_Qnap Plugin soll mir helfen Daten für Icinga zu sammeln, gut wenn man nicht selber alle OID suchen muss =)
cd /opt/icinga-plugins/ wget http://constey.de/wp-content/uploads/2011/12/check_qnap.txt // Plugin runterladen aptitude install libnagios-plugin-perl libnet-snmp-per // Abhängigkeiten des Plugins installieren mv check_qnap.txt check_qnap.sh // Plugin umbenennen chmod +x check_qnap.sh // Rechte erteilen
Plugin testen
# /opt/icinga-plugins/ ./check_qnamp.sh <HOST-IP> <snmp-community> <check> ./check_qnamp.sh 192.168.23.23 public cpu
Ich habe nach dem Test, welcher weniger erfolgreich war, alle snmpget Aufrufe angepasst damit es läuft. Dafür habe ich das Parameter "-mAll" entfernt und weil ich gerade dabei war die Version von "-v1" auf "-v 2c" umgestellt. Danach war alles schön =)
Commands.conf erweitern
# /etc/icinga2/conf.d/commands.conf /* Custom Commands */ object CheckCommand "check_qnap" { import "plugin-check-command" command = [ CustomPluginDir + "/check_qnap.sh", "$check_qnap_hostip$", "$check_qnap_snmpcom$", "$check_qnap_check$" ] vars.check_qnap_hostip = "$address$" vars.check_qnap_snmpcom = "public" }
Host anlegen
# /etc/icinga2/conf.d/hosts/GPS001.conf object Host "GPS001" { import "generic-host" address = "192.168.23.20" vars.os = "Linux" vars.sla = "24x7" max_check_attempts = 5 check_interval = 1m retry_interval = 30s check_command = "hostalive" }
Service anlegen (mehrfach)
# /etc/icinga2/conf.d/hosts/GPS001/check_qnap_cpu.conf object Service "cpu" { import "generic-service" host_name = "GPS001" check_command = "check_qnap" vars.check_qnap_check = "cpu" // Hier den gewünschten Check eintragen {cpu|diskusage|fan|hdsmart|hdtemp|volumes|systemp|ramuse} vars.sla = "24x7" }
check mk
- Check MK check_mk
check_by_ssh
- https://www.thomas-krenn.com/de/wiki/Icinga_check_by_ssh_Plugin#SSH-Key_erstellen
- http://docs.icinga.org/icinga2/latest/doc/module/icinga2/toc#!/icinga2/latest/doc/module/icinga2/chapter/configuring-icinga2#plugin-check-command-by-ssh
- http://docs.icinga.org/icinga2/latest/doc/module/icinga2/toc#!/icinga2/latest/doc/module/icinga2/chapter/monitoring-remote-systems#agent-based-checks-ssh