server:zabbix

Zabbix

Zabbix ist ein Monitoringsystem das auf Agents basiert. Besonders die von Haus aus enthaltenen Graphen und Templates mit Autodiscovery von z.B. mountpoints sind von Vorteil.

Komponenten:

  • agent
  • server
  • webinterface

Begriffe:

  • items
  • trigger
  • key
  • application

Menustruktur der Weboberfläche:

  • Monitoring
    • Dashboard
    • Problems
    • Hosts
    • Overview
    • Latest data
    • Screens
    • Maps
    • Discovery
    • Services
  • Inventory
    • Overview
    • Hosts
  • Reports
    • System information
    • Triggers top 100
    • Audit
    • Actions Log
    • Notifications
  • Configuration
    • Host groups
    • Templates
    • Hosts
    • Maintenance (periods)
    • Event Correlation
    • Discovery (rules)
    • Services
  • Administration
    • General
    • Proxies
    • Authentication (Internes Verzeichnis, HTTP basic auth, LDAP, SAML)
    • User groups
    • User
    • Media types
    • Scripts
    • Queue (overview)
  • Support
  • Share
  • Help
  • User settings
  • Sign out

Installation

Für die Installation kann auf Automatisierung zurückgegriffen werden:

Ansible Rollen

puppet modul

Händische Installation: Passendes Paket auf zabbix.com herunterladen.

Beispiel für:

Debian Stretch + Zabbix 3.4.1:

wget https://repo.zabbix.com/zabbix/3.4/debian/pool/main/z/zabbix-release/zabbix-release_3.4-1+stretch_all.deb
dpkg -i zabbix-release_3.4-1+stretch_all.deb
apt update

Debian Jessie + Zabbix 3.4.1:

wget https://repo.zabbix.com/zabbix/3.4/debian/pool/main/z/zabbix-release/zabbix-release_3.4-1+jessie_all.deb
dpkg -i zabbix-release_3.4-1+jessie_all.deb
apt update

Weiter mit der Sektion 2 „Install and configure Zabbix server“ machen.

apt install zabbix-agent
systemctl stop zabbix-agent.service
# check if still running:
lsof -i -n | grep zab
 
mv /etc/zabbix/zabbix_agentd.conf /etc/zabbix/zabbix_agentd.conf.dist

Neue Config: /etc/zabbix/zabbix_agentd.conf

# my Zabbix config
PidFile=/var/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix/zabbix_agentd.log
# size of Logfile in MB, Range: 0-1024; 0 means "disable automatic log rotation"
LogFileSize=100
# Source IP address for outgoing connections
# SourceIP=
EnableRemoteCommands=1
ListenPort=10050
# Unique, case sensitive hostname.
# Required for active checks and must match hostname as configured on the server.
# Value is acquired from HostnameItem (default: HostnameItem=system.hostname) if undefined: 
Hostname=MY.HOSTNAME.DOMAIN.TLD
Server=1.2.3.4/32
ServerActive=1.2.3.4/32
systemctl start zabbix-agent.service
systemctl enable zabbix-agent.service
  1. Konfiguration anpassen „C:\Program Files\Zabbix\config\zabbix-agentd.conf“
  2. Dienst einrichten (cmd.exe) – hierbei beachten, daß die Bindestriche Unterstriche sein müssen (zabbix_agentd)C:\Program Files\Zabbix\win<32|64>/zabbix-agentd -c „C:\Program Files\Zabbix\config\zabbix-agentd.conf“ -i
  3. Dienst starten:
    1. Server-Manager→ Konfiguration→ Dienste Zabbix Agent
    2. →Starten

Unter CentOS ist standardmäßig die Firewall aktiv, folgende Ports/Befehle:

# server/webinterface:
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --zone=public --add-port=443/tcp --permanent
# server/proxy:
firewall-cmd --zone=public --add-port=10051/tcp --permanent
# agent:
firewall-cmd --zone=public --add-port=10050/tcp --permanent
firewall-cmd --reload

Wenn keine Verbindung zum Server zustande kommt kann auch selinux das „Problem“ sein:

Status prüfen: sestatus

Im enforcing-modus fehlen u.U. Fähigkeiten:

getsebool -a|grep zabbix Ausgabe:

httpd_can_connect_zabbix --> off
zabbix_can_network --> off

…auf on setzen: setsebool -P httpd_can_connect_zabbix on setsebool -P zabbix_can_network on

Alle Befehle ohne Passwort erlauben (nicht empfohlen):

zabbix ALL=NOPASSWD: ALL

Ausgewählte Befehle erlauben:

zabbix ALL=NOPASSWD: /etc/init.d/apache restart

Konfiguration

PHP-Konfiguration_

date.timezone = Europe/Berlin
max_execution_time = 300

Der Installationsassistent findet sich unter http://SERVER.TLD/zabbix/

Konfigurationsdatei (/usr/share/zabbix/conf/zabbix.conf.php; bei CentOS /etc/zabbix/web/zabbix.conf.php):

<?php
global $DB_TYPE, $DB_SERVER, $DB_PORT, $DB_DATABASE, $DB_USER, $DB_PASSWORD, $IMAGE_FORMAT_DEFAULT;
 
$DB_TYPE	= "MYSQL";
$DB_SERVER	= "localhost";
$DB_PORT	= "0";
$DB_DATABASE	= "zabbix";
$DB_USER	= "zabbix";
$DB_PASSWORD	= "Passwort";
 
$IMAGE_FORMAT_DEFAULT	= IMAGE_FORMAT_PNG;
?>

Danach ist der Login mit Admin und Passwort Zabbix möglich.

Zabbix meldet wenn bestimmt Poller ausgelastet sind (viele Proxies, viele System nicht erreichbar etc.)

StartPollers=100
# für passive proxies:
StartProxyPollers=5
StartHTTPPollers=5

Anschließend könnte mysql in Bedrängnis geraten weil Zabbix zu viele Datenbankverbindungen anfordert (in dermy.cnf):

[mysqld]
max_connections = 500

Es wird benutzt:

Vorgehensweise:

  1. Bot bei Telegram anlegen
    1. dazu im Client mit BotFather eine neue Konversation starten, der Befehl ist: /newbot
    2. es führt ein Assistent durch die Einrichtung: man muss einen Benutzernamen eingeben der auf „bot“ endet
    3. …und bekommt am Ende einen token für die HTTP API (z.B. 124226418:BCF9EoD6k10O5qNDfhBL0ofneQ4OfIux5Fo)
  2. Skript ablegen in /usr/lib/zabbix/alertscripts
    #!/bin/sh
    # to must be $chat_id or "@username":
    to=$1 
    subject=$2
    body=$3
     
    botID="124226418:BCF9EoD6k10O5qNDfhBL0ofneQ4OfIux5Fo"
     
    curl -X POST --retry 5 --retry-delay 0 --retry-max-time 60 --data-urlencode "chat_id=$1" --data-urlencode "text=$2 $3" "https://api.telegram.org/$botID/sendMessage?disable_web_page_preview=true"
    if [ $? -ne 0 ]; then
            exit 1
    fi
  3. Im Monitoring-System: Administration → Media-types → Create Media Type
    1. Name: Telegram
    2. Type: Skript
    3. Script name: $Dateiname (ohne Pfad!)
    4. Script parameters:
      1. {ALERT.SENDTO}
      2. {ALERT.SUBJECT}
      3. {ALERT.MESSAGE}
    5. Options entsprechend ausfüllen
  4. Im Monitoring-System: Administration → Users → $Benutzername → Media → Add
    1. Type: Telegram
    2. Send to: $Benutzername (aus Telegram) oder die $ChatID

Welche Lokales angezeigt werden legt einseits der Translation status fest (muss mindestens 75% übersetzt sein):

/usr/share/zabbix/include/locales.inc.php :

function getLocales() {
	return [
		'en_GB' => ['name' => _('English (en_GB)'),	'display' => true],
		'en_US' => ['name' => _('English (en_US)'),	'display' => true],
		'bg_BG' => ['name' => _('Bulgarian (bg_BG)'),	'display' => false],
		'ca_ES' => ['name' => _('Catalan (ca_ES)'),	'display' => false],
		'zh_CN' => ['name' => _('Chinese (zh_CN)'),	'display' => false],
		'zh_TW' => ['name' => _('Chinese (zh_TW)'),	'display' => false],
		'cs_CZ' => ['name' => _('Czech (cs_CZ)'),	'display' => false],
		'nl_NL' => ['name' => _('Dutch (nl_NL)'),	'display' => false],
		'fi_FI' => ['name' => _('Finnish (fi_FI)'),	'display' => false],
		'fr_FR' => ['name' => _('French (fr_FR)'),	'display' => true],
		'ka_GE' => ['name' => _('Georgian (ka_GE)'),	'display' => false],
		'de_DE' => ['name' => _('German (de_DE)'),	'display' => true],
		'el_GR' => ['name' => _('Greek (el_GR)'),	'display' => false],
		'he_IL' => ['name' => _('Hebrew (he_IL)'),	'display' => false],
		'hu_HU' => ['name' => _('Hungarian (hu_HU)'),	'display' => false],
		'id_ID' => ['name' => _('Indonesian (id_ID)'),	'display' => false],
		'it_IT' => ['name' => _('Italian (it_IT)'),	'display' => true],
		'ko_KR' => ['name' => _('Korean (ko_KR)'),	'display' => false],
		'ja_JP' => ['name' => _('Japanese (ja_JP)'),	'display' => false],
		'lv_LV' => ['name' => _('Latvian (lv_LV)'),	'display' => false],
		'lt_LT' => ['name' => _('Lithuanian (lt_LT)'),	'display' => false],
		'nb_NO' => ['name' => _('Norwegian (nb_NO)'),	'display' => false],
		'fa_IR' => ['name' => _('Persian (fa_IR)'),	'display' => false],
		'pl_PL' => ['name' => _('Polish (pl_PL)'),	'display' => false],
		'pt_BR' => ['name' => _('Portuguese (pt_BR)'),	'display' => false],
		'pt_PT' => ['name' => _('Portuguese (pt_PT)'),	'display' => false],
		'ro_RO' => ['name' => _('Romanian (ro_RO)'),	'display' => false],
		'ru_RU' => ['name' => _('Russian (ru_RU)'),	'display' => false],
		'sk_SK' => ['name' => _('Slovak (sk_SK)'),	'display' => false],
		'es_ES' => ['name' => _('Spanish (es_ES)'),	'display' => true],
		'sv_SE' => ['name' => _('Swedish (sv_SE)'),	'display' => false],
		'tr_TR' => ['name' => _('Turkish (tr_TR)'),	'display' => false],
		'uk_UA' => ['name' => _('Ukrainian (uk_UA)'),	'display' => false],
		'vi_VN' => ['name' => _('Vietnamese (vi_VN)'),	'display' => false]
	];
}

…aber auch die Lokales die im System vorhanden sind. Bei Debian/Ubuntu lässt sich das zu festlegen (die obigen Codes z.B. „de_DE“ müssen in der UTF8-Variante vorhanden sein):

dpkg-reconfigure locales

Möchte man keine CA für die Absicherung der Kommunikation zwischen Server und dem Agent einsetzen, so sind alternativ pre-shared keys (PSK) möglich. Siehe auch: Using pre-shared keys.

# 32Byte / 256 Bit-Zufallszeichenkette erzeugen:
openssl rand -hex 32 > /etc/zabbix/zabbix.psk
chmod 600 /etc/zabbix/zabbix.psk
chown zabbix.zabbix /etc/zabbix/zabbix.psk

Den Inhalt von /etc/zabbix/zabbix.psk auf dem Server/Proxy eintragen (Karteikarte encryption, Methode umstellen!):

/etc/zabbix/zabbix_agentd.conf:

TLSConnect=psk
TLSAccept=psk
TLSPSKFile=/etc/zabbix/zabbix.psk
TLSPSKIdentity=$SERVERNAME_oder_anderer_String
systemctl restart zabbix-agent.service
Noch eine letzte Warnung zu duplizierten Identitäten: Es darf wirklich immer nur eine eindeutige Kombination von Identity (Benutzernamen) und Passwort geben. Wird die Identity nochmal irgendwo mit einem anderen Passwort verwendet, dann werden die Daten nicht an den Server/Proxy übertragen obwohl der agent-ping noch funktioniert. Hinweis aus der Doku: „It is a user responsibility to ensure that there are no two PSKs with the same identity string but different values. Failing to do so may lead to unpredictable disruptions of communication between Zabbix components using PSKs with this PSK identity string“.
zabbix_get -I $IP  -s $IP -k "system.cpu.load[all,avg1]" --tls-connect=psk --tls-psk-identity="$IDENTITY" --tls-psk-file=/etc/zabbix/zabbix.psk

Templates

Anpassungen:

Es gibt System die haben keinen Swap-Speicher, dort kommt die Meldung „Lack of free swap space on $HOST“. Ich möchte diesen Trigger nur sehen wenn Swap da ist:

{Template OS Linux:system.swap.size[,free].last()}<50 and {Template OS Linux:system.swap.size[,total].last()}>0

Zabbix Upgrade

  1. Die oben aufgeführte Paketquelle in /etc/apt/sources.list.d/ wird angepasst.
  2. Pakete upgrade
  3. Anschließend muss der zabbix-server neu gestartet werden:
    systemctl restart zabbix-server
  4. der Neustart triggert das Datenbank-upgrade (zu verfolgen in /var/log/zabbix/zabbix_server.log)
     30934:20200605:135159.629 completed 100% of database upgrade
     30934:20200605:135159.629 database upgrade fully completed
    1. System-dashboard „Database history tables upgraded: No“
    2. Änderungen anwenden: https://git.zabbix.com/projects/ZBX/repos/zabbix/raw/database/mysql/double.sql
      ALTER TABLE trends
      	MODIFY value_min DOUBLE PRECISION DEFAULT '0.0000' NOT NULL,
      	MODIFY value_avg DOUBLE PRECISION DEFAULT '0.0000' NOT NULL,
      	MODIFY value_max DOUBLE PRECISION DEFAULT '0.0000' NOT NULL;
      ALTER TABLE history MODIFY VALUE DOUBLE PRECISION DEFAULT '0.0000' NOT NULL;
    3. mysql -u'zabbix' -p'$zabbixDBpass' zabbix -e "show create table history;"
    4. Alt:
      VALUE DOUBLE(16,4) NOT NULL DEFAULT '0.0000',
    5. Neu:
      VALUE DOUBLE NOT NULL DEFAULT '0',
    6. nano /etc/zabbix/web/zabbix.conf.php
      // db is upgrades to double precision
      // https://git.zabbix.com/projects/ZBX/repos/zabbix/raw/database/mysql/double.sql
      $DB['DOUBLE_IEEE754'] = 'true';
    7. das web interface von Version 5.0 brauch php 7.2, bei Debian Jessie ist aber nur 7.0 vorhanden. Entweder dist-upgrade oder deprecated-Paket holen http://repo.zabbix.com/zabbix/5.0/debian/pool/main/z/zabbix/

Fehler im serverlog:

Zabbix supports only "utf8_bin" collation. Database "zabbix" has default collation "utf8_general_ci"
ALTER DATABASE zabbix CHARACTER SET utf8 COLLATE utf8_bin;

Ergebnis:

SELECT DEFAULT_CHARACTER_SET_NAME, DEFAULT_COLLATION_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'zabbix';
+----------------------------+------------------------+
| DEFAULT_CHARACTER_SET_NAME | DEFAULT_COLLATION_NAME |
+----------------------------+------------------------+
| utf8                       | utf8_bin               |
+----------------------------+------------------------+

Änderung wenn Tabellen nicht utf8 als Standard-Character-set haben oder Collation *nicht* utf8_bin ist:

Liste von Tabellen erstellen (mit mysql-Batchmode ausführen um den Rahmen wegzubekommen: mysql -s -r):

SELECT CONCAT('ALTER TABLE ', tbl.TABLE_SCHEMA, '.', tbl.TABLE_NAME, ' CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;') FROM information_schema.TABLES tbl WHERE tbl.TABLE_SCHEMA= 'zabbix';

Ergebnis:

ALTER TABLE zabbix.acknowledges CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.alerts CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.application_discovery CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.application_prototype CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.application_template CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.applications CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.auditlog CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.auditlog_details CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.autoreg_host CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.conditions CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.config CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.config_autoreg_tls CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.corr_condition CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.corr_condition_group CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.corr_condition_tag CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.corr_condition_tagpair CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.corr_condition_tagvalue CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.corr_operation CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.correlation CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.dashboard CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.dashboard_user CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.dashboard_usrgrp CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.dbversion CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.dchecks CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.dhosts CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.drules CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.dservices CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.escalations CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.event_recovery CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.event_suppress CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.event_tag CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.events CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.expressions CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.functions CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.globalmacro CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.globalvars CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.graph_discovery CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.graph_theme CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.graphs CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.graphs_items CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.group_discovery CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.group_prototype CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.history CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.history_log CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.history_str CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.history_text CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.history_uint CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.host_discovery CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.host_inventory CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.host_tag CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.hostmacro CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.hosts CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.hosts_groups CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.hosts_templates CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.housekeeper CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.hstgrp CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.httpstep CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.httpstep_field CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.httpstepitem CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.httptest CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.httptest_field CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.httptestitem CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.icon_map CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.icon_mapping CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.ids CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.images CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.interface CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.interface_discovery CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.interface_snmp CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.item_application_prototype CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.item_condition CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.item_discovery CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.item_preproc CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.item_rtdata CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.items CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.items_applications CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.lld_macro_path CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.lld_override CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.lld_override_condition CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.lld_override_opdiscover CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.lld_override_operation CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.lld_override_ophistory CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.lld_override_opinventory CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.lld_override_opperiod CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.lld_override_opseverity CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.lld_override_opstatus CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.lld_override_optag CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.lld_override_optemplate CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.lld_override_optrends CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.maintenance_tag CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.maintenances CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.maintenances_groups CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.maintenances_hosts CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.maintenances_windows CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.mappings CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.media CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.media_type CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.media_type_message CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.media_type_param CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.module CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.opcommand CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.opcommand_grp CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.opcommand_hst CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.opconditions CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.operations CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.opgroup CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.opinventory CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.opmessage CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.opmessage_grp CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.opmessage_usr CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.optemplate CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.problem CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.problem_tag CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.profiles CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.proxy_autoreg_host CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.proxy_dhistory CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.proxy_history CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.regexps CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.rights CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.screen_user CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.screen_usrgrp CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.screens CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.screens_items CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.scripts CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.service_alarms CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.services CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.services_links CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.services_times CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.sessions CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.slides CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.slideshow_user CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.slideshow_usrgrp CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.slideshows CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.sysmap_element_trigger CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.sysmap_element_url CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.sysmap_shape CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.sysmap_url CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.sysmap_user CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.sysmap_usrgrp CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.sysmaps CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.sysmaps_elements CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.sysmaps_link_triggers CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.sysmaps_links CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.tag_filter CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.task CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.task_acknowledge CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.task_check_now CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.task_close_problem CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.task_data CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.task_remote_command CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.task_remote_command_result CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.task_result CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.timeperiods CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.trends CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.trends_uint CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.trigger_depends CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.trigger_discovery CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.trigger_tag CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.triggers CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.users CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.users_groups CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.usrgrp CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.valuemaps CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.widget CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE zabbix.widget_field CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;