server:zabbix

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
Letzte ÜberarbeitungBeide Seiten der Revision
server:zabbix [2021/10/16 09:10] – [Händische Installation] stserver:zabbix [2023/01/18 22:15] – [Server und Datenbank tuning] st
Zeile 232: Zeile 232:
 Am Ende der Installation ist der Login mit "Admin" und Passwort "zabbix" möglich. Am Ende der Installation ist der Login mit "Admin" und Passwort "zabbix" möglich.
  
-===== Server und Datenbank tuning =====+===== Datenbank ===== 
 + 
 +**Größe der Datenbank** "zabbix": <code sql> SELECT table_schema "zabbix", sum(data_length + index_length)/1024/1024 "DВ size in MB" FROM information_schema.TABLES GROUP BY table_schema;</code> 
 +**Größe der zabbix Tabellen**: <code sql>use 
 +SELECT 
 +  TABLE_NAME AS `Table`, 
 +  ROUND((DATA_LENGTH + INDEX_LENGTH) / 1024 / 1024) AS `Size (MB)` 
 +FROM 
 +  information_schema.TABLES 
 +WHERE 
 +  TABLE_SCHEMA = "zabbix" 
 +ORDER BY 
 +  (DATA_LENGTH + INDEX_LENGTH) 
 +DESC; 
 +</code> 
 + 
 +==== housekeeping ==== 
 + 
 +Seit Zabbix 6.0 kann das audit log größer werden (u.a. werden discovery-aktionen von Benutzer SYSTEM geloggt): 
 +  * Administration -> General -> Audit log ( https://$ZABBIX_SERVER/zabbix/zabbix.phpaction=audit.settings.edit ):  
 + 
 +==== housekeeping ==== 
 + 
 +Administration -> General -> Housekeeping ( https://$ZABBIX_SERVER/zabbix/zabbix.php?action=housekeeping.edit ) 
 +    * Override item history period: 30, ... 90d ? 
 +    * ...? 
 + 
 +[[https://www.zabbix.com/documentation/3.0/manual/concepts/server|zabbix housekeeper laufen lassen]] (manuell): <code bash>zabbix_server -c /etc/zabbix/zabbix_server.conf -R housekeeper_execute</code> 
 + 
 +manuelles clean-up der Datenbank (vorher BACKUP!): 
 +<code sql> 
 +-- intervals in days 
 +SET @history_interval = 30; 
 +SET @trends_interval = 90; 
 + 
 +DELETE FROM alerts WHERE (UNIX_TIMESTAMP(NOW()) - clock) > (@history_interval * 24 * 60 * 60); 
 +DELETE FROM acknowledges WHERE (UNIX_TIMESTAMP(NOW()) - clock) > (@history_interval * 24 * 60 * 60); 
 +DELETE FROM events WHERE (UNIX_TIMESTAMP(NOW()) - clock) > (@history_interval * 24 * 60 * 60); 
 + 
 +DELETE FROM history WHERE (UNIX_TIMESTAMP(NOW()) - clock) > (@history_interval * 24 * 60 * 60); 
 +DELETE FROM history_uint WHERE (UNIX_TIMESTAMP(NOW()) - clock) > (@history_interval * 24 * 60 * 60); 
 +DELETE FROM history_str WHERE (UNIX_TIMESTAMP(NOW()) - clock) > (@history_interval * 24 * 60 * 60); 
 +DELETE FROM history_text WHERE (UNIX_TIMESTAMP(NOW()) - clock) > (@history_interval * 24 * 60 * 60); 
 +DELETE FROM history_log WHERE (UNIX_TIMESTAMP(NOW()) - clock) > (@history_interval * 24 * 60 * 60); 
 + 
 +DELETE FROM trends WHERE (UNIX_TIMESTAMP(NOW()) - clock) > (@trends_interval * 24 * 60 * 60); 
 +DELETE FROM trends_uint WHERE (UNIX_TIMESTAMP(NOW()) - clock) > (@trends_interval * 24 * 60 * 60);  
 +</code> 
 + 
 +===== Poller ausgelastet ===== 
  
 Zabbix meldet wenn bestimmt Poller ausgelastet sind (viele Proxies, viele System nicht erreichbar etc.) Zabbix meldet wenn bestimmt Poller ausgelastet sind (viele Proxies, viele System nicht erreichbar etc.)
Zeile 705: Zeile 755:
     * wenn userparameter-Dateien in /etc/zabbix/zabbix_agentd.d (Include-Verzeichnis) nicht lesbar sind, bricht der agent ohne Fehlermeldung ab - sieht man bei manuellem Start:<code bash>sudo -u zabbix /usr/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf</code>     * wenn userparameter-Dateien in /etc/zabbix/zabbix_agentd.d (Include-Verzeichnis) nicht lesbar sind, bricht der agent ohne Fehlermeldung ab - sieht man bei manuellem Start:<code bash>sudo -u zabbix /usr/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf</code>
  
 +==== DB upgrade failed (no SUPER privilege or log_bin_trust_function_creators) ====
 +
 +Fehler bei upgrade auf 6.0.11:
 +<file>
 +[Z3005] query failed: [1419] You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable) [create trigger hosts_name_upper_insert
 +before insert on hosts for each row
 +set new.name_upper=upper(new.name)]
 +$timestamp database upgrade failed
 +</file>
 +
 +Lösung: [[https://mariadb.com/docs/ent/ref/mdb/system-variables/log_bin_trust_function_creators/|log_bin_trust_function_creators]] auf 1 / True:
 +
 +temporär:
 +<code sql>
 +set global log_bin_trust_function_creators=1;
 +</code>
 +
 +permanent: ''/etc/mysql/mysql.conf.d/mysqld.cnf'' (oder vergleichbarer Pfad bei mariadb):
 +<file>
 +log_bin_trust_function_creators = 1
 +</file>
 +
 +Super-privilegien sind vermutlich nicht nötig:
 +<code sql>
 +SELECT Host,User,Super_priv FROM mysql.user;
 +UPDATE mysql.user SET Super_Priv='Y' WHERE user='zabbix_server' AND host='localhost';
 +</code>
 ===== Homeverzeichnis des agents fixen ===== ===== Homeverzeichnis des agents fixen =====