diff --git a/nixos/doc/manual/release-notes/rl-2009.xml b/nixos/doc/manual/release-notes/rl-2009.xml
index f70b2f2856ab..4695175638d0 100644
--- a/nixos/doc/manual/release-notes/rl-2009.xml
+++ b/nixos/doc/manual/release-notes/rl-2009.xml
@@ -156,6 +156,40 @@ GRANT ALL PRIVILEGES ON *.* TO 'mysql'@'localhost' WITH GRANT OPTION;
Support for built-in LCDs in various pieces of Logitech hardware (keyboards and USB speakers). hardware.logitech.lcd.enable enables support for all hardware supported by the g15daemon project.
+
+
+ Zabbix now defaults to 5.0, updated from 4.4. Please carefully read through
+ the upgrade guide
+ and apply any changes required. Be sure to take special note of the section on
+ enabling extended range of numeric (float) values
+ as you will need to apply this database migration manually.
+
+
+ If you are using Zabbix Server with a MySQL or MariaDB database you should note that using a character set of utf8 and a collate of utf8_bin has become mandatory with
+ this release. See the upstream issue for further discussion. Before upgrading you should check the character set and collation used by
+ your database and ensure they are correct:
+
+ SELECT
+ default_character_set_name,
+ default_collation_name
+ FROM
+ information_schema.schemata
+ WHERE
+ schema_name = 'zabbix';
+
+ If these values are not correct you should take a backup of your database and convert the character set and collation as required. Here is an
+ example of how to do so, taken from
+ the Zabbix forums:
+
+ ALTER DATABASE `zabbix` DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
+
+ -- the following will produce a list of SQL commands you should subsequently execute
+ SELECT CONCAT("ALTER TABLE ", TABLE_NAME," CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;") AS ExecuteTheString
+ FROM information_schema.`COLUMNS`
+ WHERE table_schema = "zabbix" AND COLLATION_NAME = "utf8_general_ci";
+
+
+
diff --git a/nixos/modules/services/monitoring/zabbix-proxy.nix b/nixos/modules/services/monitoring/zabbix-proxy.nix
index d51507c91a1f..2c8b8b92cb38 100644
--- a/nixos/modules/services/monitoring/zabbix-proxy.nix
+++ b/nixos/modules/services/monitoring/zabbix-proxy.nix
@@ -5,8 +5,8 @@ let
pgsql = config.services.postgresql;
mysql = config.services.mysql;
- inherit (lib) mkDefault mkEnableOption mkIf mkMerge mkOption;
- inherit (lib) attrValues concatMapStringsSep literalExample optional optionalAttrs optionalString types;
+ inherit (lib) mkAfter mkDefault mkEnableOption mkIf mkMerge mkOption;
+ inherit (lib) attrValues concatMapStringsSep getName literalExample optional optionalAttrs optionalString types;
inherit (lib.generators) toKeyValue;
user = "zabbix";
@@ -232,14 +232,15 @@ in
services.mysql = optionalAttrs mysqlLocal {
enable = true;
package = mkDefault pkgs.mariadb;
- ensureDatabases = [ cfg.database.name ];
- ensureUsers = [
- { name = cfg.database.user;
- ensurePermissions = { "${cfg.database.name}.*" = "ALL PRIVILEGES"; };
- }
- ];
};
+ systemd.services.mysql.postStart = mkAfter (optionalString mysqlLocal ''
+ ( echo "CREATE DATABASE IF NOT EXISTS \`${cfg.database.name}\` CHARACTER SET utf8 COLLATE utf8_bin;"
+ echo "CREATE USER IF NOT EXISTS '${cfg.database.user}'@'localhost' IDENTIFIED WITH ${if (getName config.services.mysql.package == getName pkgs.mariadb) then "unix_socket" else "auth_socket"};"
+ echo "GRANT ALL PRIVILEGES ON \`${cfg.database.name}\`.* TO '${cfg.database.user}'@'localhost';"
+ ) | ${config.services.mysql.package}/bin/mysql -N
+ '');
+
services.postgresql = optionalAttrs pgsqlLocal {
enable = true;
ensureDatabases = [ cfg.database.name ];
diff --git a/nixos/modules/services/monitoring/zabbix-server.nix b/nixos/modules/services/monitoring/zabbix-server.nix
index df09488a8ccc..c8658634ecb6 100644
--- a/nixos/modules/services/monitoring/zabbix-server.nix
+++ b/nixos/modules/services/monitoring/zabbix-server.nix
@@ -5,8 +5,8 @@ let
pgsql = config.services.postgresql;
mysql = config.services.mysql;
- inherit (lib) mkDefault mkEnableOption mkIf mkMerge mkOption;
- inherit (lib) attrValues concatMapStringsSep literalExample optional optionalAttrs optionalString types;
+ inherit (lib) mkAfter mkDefault mkEnableOption mkIf mkMerge mkOption;
+ inherit (lib) attrValues concatMapStringsSep getName literalExample optional optionalAttrs optionalString types;
inherit (lib.generators) toKeyValue;
user = "zabbix";
@@ -220,14 +220,15 @@ in
services.mysql = optionalAttrs mysqlLocal {
enable = true;
package = mkDefault pkgs.mariadb;
- ensureDatabases = [ cfg.database.name ];
- ensureUsers = [
- { name = cfg.database.user;
- ensurePermissions = { "${cfg.database.name}.*" = "ALL PRIVILEGES"; };
- }
- ];
};
+ systemd.services.mysql.postStart = mkAfter (optionalString mysqlLocal ''
+ ( echo "CREATE DATABASE IF NOT EXISTS \`${cfg.database.name}\` CHARACTER SET utf8 COLLATE utf8_bin;"
+ echo "CREATE USER IF NOT EXISTS '${cfg.database.user}'@'localhost' IDENTIFIED WITH ${if (getName config.services.mysql.package == getName pkgs.mariadb) then "unix_socket" else "auth_socket"};"
+ echo "GRANT ALL PRIVILEGES ON \`${cfg.database.name}\`.* TO '${cfg.database.user}'@'localhost';"
+ ) | ${config.services.mysql.package}/bin/mysql -N
+ '');
+
services.postgresql = optionalAttrs pgsqlLocal {
enable = true;
ensureDatabases = [ cfg.database.name ];
diff --git a/pkgs/servers/monitoring/zabbix/server.nix b/pkgs/servers/monitoring/zabbix/server.nix
index fdf3fd476df1..9d0e1c199d32 100644
--- a/pkgs/servers/monitoring/zabbix/server.nix
+++ b/pkgs/servers/monitoring/zabbix/server.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, curl, libevent, libiconv, libxml2, openssl, pcre, zlib
+{ stdenv, fetchurl, autoreconfHook, pkgconfig, curl, libevent, libiconv, libxml2, openssl, pcre, zlib
, jabberSupport ? true, iksemel
, ldapSupport ? true, openldap
, odbcSupport ? true, unixODBC
@@ -25,7 +25,7 @@ in
inherit sha256;
};
- nativeBuildInputs = [ pkgconfig ];
+ nativeBuildInputs = [ autoreconfHook pkgconfig ];
buildInputs = [
curl
libevent
@@ -65,6 +65,13 @@ in
find database -name data.sql -exec sed -i 's|/usr/bin/||g' {} +
'';
+ preAutoreconf = ''
+ for i in $(find . -type f -name "*.m4"); do
+ substituteInPlace $i \
+ --replace 'test -x "$PKG_CONFIG"' 'type -P "$PKG_CONFIG" >/dev/null'
+ done
+ '';
+
postInstall = ''
mkdir -p $out/share/zabbix/database/
cp -r include $out/
diff --git a/pkgs/servers/monitoring/zabbix/versions.nix b/pkgs/servers/monitoring/zabbix/versions.nix
index c75df46cf047..f867c819d07f 100644
--- a/pkgs/servers/monitoring/zabbix/versions.nix
+++ b/pkgs/servers/monitoring/zabbix/versions.nix
@@ -1,7 +1,7 @@
generic: {
- v44 = generic {
- version = "4.4.8";
- sha256 = "0l9n4l5179lf90krv1kb0lraipj7q4hyba6r48n6rj2zqx2j4mn0";
+ v50 = generic {
+ version = "5.0.2";
+ sha256 = "1cnns7ixqi7ank3cbvcs7d8rb5zh9qiqbmgivazr83jnz81qg46w";
};
v40 = generic {
diff --git a/pkgs/servers/monitoring/zabbix/web.nix b/pkgs/servers/monitoring/zabbix/web.nix
index a75deff3db27..f677fe5c0af3 100644
--- a/pkgs/servers/monitoring/zabbix/web.nix
+++ b/pkgs/servers/monitoring/zabbix/web.nix
@@ -18,7 +18,7 @@ import ./versions.nix ({ version, sha256 }:
installPhase = ''
mkdir -p $out/share/zabbix/
- cp -a frontends/php/. $out/share/zabbix/
+ cp -a ${if stdenv.lib.versionAtLeast version "5.0.0" then "ui/." else "frontends/php/."} $out/share/zabbix/
cp ${phpConfig} $out/share/zabbix/conf/zabbix.conf.php
'';
diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix
index 9f959c8d16e3..c884b40ef2a0 100644
--- a/pkgs/top-level/aliases.nix
+++ b/pkgs/top-level/aliases.nix
@@ -687,6 +687,9 @@ mapAliases ({
mumble_git = pkgs.mumble;
murmur_git = pkgs.murmur;
+ # added 2020-08-17
+ zabbix44 = throw "Zabbix 4.4 is end of life, see https://www.zabbix.com/documentation/current/manual/installation/upgrade_notes_500 for details on upgrading to Zabbix 5.0.";
+
# added 2019-09-06
zeroc_ice = pkgs.zeroc-ice;
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index b81ee80fdc26..3000f7dd438b 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -16958,11 +16958,11 @@ in
server = server-pgsql;
};
- zabbix44 = recurseIntoAttrs (zabbixFor "v44");
+ zabbix50 = recurseIntoAttrs (zabbixFor "v50");
zabbix40 = dontRecurseIntoAttrs (zabbixFor "v40");
zabbix30 = dontRecurseIntoAttrs (zabbixFor "v30");
- zabbix = zabbix44;
+ zabbix = zabbix50;
zipkin = callPackage ../servers/monitoring/zipkin { };