diff --git a/pkgs/by-name/za/zabbix-agent2-plugin-postgresql/package.nix b/pkgs/by-name/za/zabbix-agent2-plugin-postgresql/package.nix index da499f9f7157..87879b5a8a48 100644 --- a/pkgs/by-name/za/zabbix-agent2-plugin-postgresql/package.nix +++ b/pkgs/by-name/za/zabbix-agent2-plugin-postgresql/package.nix @@ -1,22 +1,27 @@ -{ lib, buildGoModule, fetchurl }: +{ + lib, + buildGoModule, + fetchurl, +}: buildGoModule rec { pname = "zabbix-agent2-plugin-postgresql"; - version = "6.4.15"; + version = "7.0.2"; src = fetchurl { url = "https://cdn.zabbix.com/zabbix-agent2-plugins/sources/postgresql/zabbix-agent2-plugin-postgresql-${version}.tar.gz"; - hash = "sha256-9N2xN7ckfBiwWcI+C4VeHDQVrWEaeKUcjfIw7GU7K9E="; + hash = "sha256-2+P0a74flxWIpZaII+V04G/szFUrnnIy+f8LfDewcx0="; }; vendorHash = null; - meta = with lib; { + meta = { description = "Required tool for Zabbix agent integrated PostgreSQL monitoring"; mainProgram = "postgresql"; homepage = "https://www.zabbix.com/integrations/postgresql"; - license = licenses.asl20; - maintainers = with maintainers; [ gador ]; - platforms = platforms.linux; + license = + if (lib.versions.major version >= "7") then lib.licenses.agpl3Only else lib.licenses.gpl2Plus; + maintainers = with lib.maintainers; [ gador ]; + platforms = lib.platforms.linux; }; } diff --git a/pkgs/servers/monitoring/zabbix/agent.nix b/pkgs/servers/monitoring/zabbix/agent.nix index f87ddf4c92b2..02b6fb71734b 100644 --- a/pkgs/servers/monitoring/zabbix/agent.nix +++ b/pkgs/servers/monitoring/zabbix/agent.nix @@ -1,6 +1,15 @@ -{ lib, stdenv, fetchurl, pkg-config, libiconv, openssl, pcre }: +{ + lib, + stdenv, + fetchurl, + pkg-config, + libiconv, + openssl, + pcre, +}: -import ./versions.nix ({ version, hash, ... }: +import ./versions.nix ( + { version, hash, ... }: stdenv.mkDerivation { pname = "zabbix-agent"; inherit version; @@ -36,8 +45,13 @@ import ./versions.nix ({ version, hash, ... }: meta = { description = "Enterprise-class open source distributed monitoring solution (client-side agent)"; homepage = "https://www.zabbix.com/"; - license = lib.licenses.gpl2Plus; - maintainers = with lib.maintainers; [ mmahut psyanticy ]; + license = + if (lib.versions.major version >= "7") then lib.licenses.agpl3Only else lib.licenses.gpl2Plus; + maintainers = with lib.maintainers; [ + mmahut + psyanticy + ]; platforms = lib.platforms.unix; }; - }) + } +) diff --git a/pkgs/servers/monitoring/zabbix/agent2.nix b/pkgs/servers/monitoring/zabbix/agent2.nix index befc1954473e..c577f9709c0e 100644 --- a/pkgs/servers/monitoring/zabbix/agent2.nix +++ b/pkgs/servers/monitoring/zabbix/agent2.nix @@ -1,6 +1,22 @@ -{ lib, buildGoModule, fetchurl, autoreconfHook, pkg-config, libiconv, openssl, pcre, zlib }: +{ + lib, + buildGoModule, + fetchurl, + autoreconfHook, + pkg-config, + libiconv, + openssl, + pcre, + zlib, +}: -import ./versions.nix ({ version, hash, vendorHash ? throw "unsupported version ${version} for zabbix-agent2", ... }: +import ./versions.nix ( + { + version, + hash, + vendorHash ? throw "unsupported version ${version} for zabbix-agent2", + ... + }: buildGoModule { pname = "zabbix-agent2"; inherit version; @@ -14,8 +30,16 @@ import ./versions.nix ({ version, hash, vendorHash ? throw "unsupported version inherit vendorHash; - nativeBuildInputs = [ autoreconfHook pkg-config ]; - buildInputs = [ libiconv openssl pcre zlib ]; + nativeBuildInputs = [ + autoreconfHook + pkg-config + ]; + buildInputs = [ + libiconv + openssl + pcre + zlib + ]; inherit (buildGoModule.go) GOOS GOARCH; @@ -59,8 +83,10 @@ import ./versions.nix ({ version, hash, vendorHash ? throw "unsupported version meta = { description = "Enterprise-class open source distributed monitoring solution (client-side agent)"; homepage = "https://www.zabbix.com/"; - license = lib.licenses.gpl2Plus; + license = + if (lib.versions.major version >= "7") then lib.licenses.agpl3Only else lib.licenses.gpl2Plus; maintainers = with lib.maintainers; [ aanderse ]; platforms = lib.platforms.unix; }; - }) + } +) diff --git a/pkgs/servers/monitoring/zabbix/proxy.nix b/pkgs/servers/monitoring/zabbix/proxy.nix index b91fb94cd90e..c0ac7d46628b 100644 --- a/pkgs/servers/monitoring/zabbix/proxy.nix +++ b/pkgs/servers/monitoring/zabbix/proxy.nix @@ -1,10 +1,25 @@ -{ lib, stdenv, fetchurl, pkg-config, libevent, libiconv, openssl, pcre, zlib -, odbcSupport ? true, unixODBC -, snmpSupport ? stdenv.buildPlatform == stdenv.hostPlatform, net-snmp -, sshSupport ? true, libssh2 -, sqliteSupport ? false, sqlite -, mysqlSupport ? false, libmysqlclient -, postgresqlSupport ? false, postgresql +{ + lib, + stdenv, + fetchurl, + pkg-config, + libevent, + libiconv, + openssl, + pcre, + zlib, + odbcSupport ? true, + unixODBC, + snmpSupport ? stdenv.buildPlatform == stdenv.hostPlatform, + net-snmp, + sshSupport ? true, + libssh2, + sqliteSupport ? false, + sqlite, + mysqlSupport ? false, + libmysqlclient, + postgresqlSupport ? false, + postgresql, }: # ensure exactly one database type is selected @@ -15,18 +30,20 @@ assert sqliteSupport -> !mysqlSupport && !postgresqlSupport; let inherit (lib) optional optionalString; in - import ./versions.nix ({ version, hash, ... }: - stdenv.mkDerivation { - pname = "zabbix-proxy"; - inherit version; +import ./versions.nix ( + { version, hash, ... }: + stdenv.mkDerivation { + pname = "zabbix-proxy"; + inherit version; - src = fetchurl { - url = "https://cdn.zabbix.com/zabbix/sources/stable/${lib.versions.majorMinor version}/zabbix-${version}.tar.gz"; - inherit hash; - }; + src = fetchurl { + url = "https://cdn.zabbix.com/zabbix/sources/stable/${lib.versions.majorMinor version}/zabbix-${version}.tar.gz"; + inherit hash; + }; - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ + nativeBuildInputs = [ pkg-config ]; + buildInputs = + [ libevent libiconv openssl @@ -40,7 +57,8 @@ in ++ optional mysqlSupport libmysqlclient ++ optional postgresqlSupport postgresql; - configureFlags = [ + configureFlags = + [ "--enable-ipv6" "--enable-proxy" "--with-iconv" @@ -56,33 +74,39 @@ in ++ optional mysqlSupport "--with-mysql" ++ optional postgresqlSupport "--with-postgresql"; - prePatch = '' - find database -name data.sql -exec sed -i 's|/usr/bin/||g' {} + - ''; + prePatch = '' + find database -name data.sql -exec sed -i 's|/usr/bin/||g' {} + + ''; - makeFlags = [ - "AR:=$(AR)" - "RANLIB:=$(RANLIB)" - ]; + makeFlags = [ + "AR:=$(AR)" + "RANLIB:=$(RANLIB)" + ]; - postInstall = '' + postInstall = + '' mkdir -p $out/share/zabbix/database/ - '' + optionalString sqliteSupport '' + '' + + optionalString sqliteSupport '' mkdir -p $out/share/zabbix/database/sqlite3 cp -prvd database/sqlite3/schema.sql $out/share/zabbix/database/sqlite3/ - '' + optionalString mysqlSupport '' + '' + + optionalString mysqlSupport '' mkdir -p $out/share/zabbix/database/mysql cp -prvd database/mysql/schema.sql $out/share/zabbix/database/mysql/ - '' + optionalString postgresqlSupport '' + '' + + optionalString postgresqlSupport '' mkdir -p $out/share/zabbix/database/postgresql cp -prvd database/postgresql/schema.sql $out/share/zabbix/database/postgresql/ ''; - meta = with lib; { - description = "Enterprise-class open source distributed monitoring solution (client-server proxy)"; - homepage = "https://www.zabbix.com/"; - license = licenses.gpl2Plus; - maintainers = [ maintainers.mmahut ]; - platforms = platforms.linux; - }; - }) + meta = { + description = "Enterprise-class open source distributed monitoring solution (client-server proxy)"; + homepage = "https://www.zabbix.com/"; + license = + if (lib.versions.major version >= "7") then lib.licenses.agpl3Only else lib.licenses.gpl2Plus; + maintainers = with lib.maintainers; [ mmahut ]; + platforms = lib.platforms.linux; + }; + } +) diff --git a/pkgs/servers/monitoring/zabbix/server.nix b/pkgs/servers/monitoring/zabbix/server.nix index 6a1ee65c8758..9234354d4366 100644 --- a/pkgs/servers/monitoring/zabbix/server.nix +++ b/pkgs/servers/monitoring/zabbix/server.nix @@ -1,12 +1,32 @@ -{ lib, stdenv, fetchurl, autoreconfHook, pkg-config, curl, libevent, libiconv, libxml2, openssl, pcre, zlib -, jabberSupport ? true, iksemel -, ldapSupport ? true, openldap -, odbcSupport ? true, unixODBC -, snmpSupport ? true, net-snmp -, sshSupport ? true, libssh2 -, mysqlSupport ? false, libmysqlclient -, postgresqlSupport ? false, postgresql -, ipmiSupport ? false, openipmi +{ + lib, + stdenv, + fetchurl, + autoreconfHook, + pkg-config, + curl, + libevent, + libiconv, + libxml2, + openssl, + pcre, + zlib, + jabberSupport ? true, + iksemel, + ldapSupport ? true, + openldap, + odbcSupport ? true, + unixODBC, + snmpSupport ? true, + net-snmp, + sshSupport ? true, + libssh2, + mysqlSupport ? false, + libmysqlclient, + postgresqlSupport ? false, + postgresql, + ipmiSupport ? false, + openipmi, }: # ensure exactly one primary database type is selected @@ -16,18 +36,23 @@ assert postgresqlSupport -> !mysqlSupport; let inherit (lib) optional optionalString; in - import ./versions.nix ({ version, hash, ... }: - stdenv.mkDerivation { - pname = "zabbix-server"; - inherit version; +import ./versions.nix ( + { version, hash, ... }: + stdenv.mkDerivation { + pname = "zabbix-server"; + inherit version; - src = fetchurl { - url = "https://cdn.zabbix.com/zabbix/sources/stable/${lib.versions.majorMinor version}/zabbix-${version}.tar.gz"; - inherit hash; - }; + src = fetchurl { + url = "https://cdn.zabbix.com/zabbix/sources/stable/${lib.versions.majorMinor version}/zabbix-${version}.tar.gz"; + inherit hash; + }; - nativeBuildInputs = [ autoreconfHook pkg-config ]; - buildInputs = [ + nativeBuildInputs = [ + autoreconfHook + pkg-config + ]; + buildInputs = + [ curl libevent libiconv @@ -45,7 +70,8 @@ in ++ optional postgresqlSupport postgresql ++ optional ipmiSupport openipmi; - configureFlags = [ + configureFlags = + [ "--enable-ipv6" "--enable-server" "--with-iconv" @@ -65,33 +91,41 @@ in ++ optional postgresqlSupport "--with-postgresql" ++ optional ipmiSupport "--with-openipmi=${openipmi.dev}"; - prePatch = '' - find database -name data.sql -exec sed -i 's|/usr/bin/||g' {} + - ''; + prePatch = '' + 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 - ''; + 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 = '' + postInstall = + '' mkdir -p $out/share/zabbix/database/ cp -r include $out/ - '' + optionalString mysqlSupport '' + '' + + optionalString mysqlSupport '' mkdir -p $out/share/zabbix/database/mysql cp -prvd database/mysql/*.sql $out/share/zabbix/database/mysql/ - '' + optionalString postgresqlSupport '' + '' + + optionalString postgresqlSupport '' mkdir -p $out/share/zabbix/database/postgresql cp -prvd database/postgresql/*.sql $out/share/zabbix/database/postgresql/ ''; - meta = with lib; { - description = "Enterprise-class open source distributed monitoring solution"; - homepage = "https://www.zabbix.com/"; - license = licenses.gpl2Plus; - maintainers = with maintainers; [ mmahut psyanticy ]; - platforms = platforms.linux; - }; - }) + meta = { + description = "Enterprise-class open source distributed monitoring solution"; + homepage = "https://www.zabbix.com/"; + license = + if (lib.versions.major version >= "7") then lib.licenses.agpl3Only else lib.licenses.gpl2Plus; + maintainers = with lib.maintainers; [ + mmahut + psyanticy + ]; + platforms = lib.platforms.linux; + }; + } +) diff --git a/pkgs/servers/monitoring/zabbix/versions.nix b/pkgs/servers/monitoring/zabbix/versions.nix index 5761d64e8c81..2707600db4d4 100644 --- a/pkgs/servers/monitoring/zabbix/versions.nix +++ b/pkgs/servers/monitoring/zabbix/versions.nix @@ -1,4 +1,9 @@ generic: { + v70 = generic { + version = "7.0.2"; + hash = "sha256-QnlBW8zvcuyF+fmrIf/o43Mf61volBYReReADpRfoYA="; + vendorHash = null; + }; v64 = generic { version = "6.4.15"; hash = "sha256-CtmNCuzDVchijinWcop3lGUTVGS2JbiQCbmusyXBQvY="; diff --git a/pkgs/servers/monitoring/zabbix/web.nix b/pkgs/servers/monitoring/zabbix/web.nix index 8a4226fb9d32..a77cfe3b7dd6 100644 --- a/pkgs/servers/monitoring/zabbix/web.nix +++ b/pkgs/servers/monitoring/zabbix/web.nix @@ -1,6 +1,12 @@ -{ lib, stdenv, fetchurl, writeText }: +{ + lib, + stdenv, + fetchurl, + writeText, +}: -import ./versions.nix ({ version, hash, ... }: +import ./versions.nix ( + { version, hash, ... }: stdenv.mkDerivation rec { pname = "zabbix-web"; inherit version; @@ -11,9 +17,9 @@ import ./versions.nix ({ version, hash, ... }: }; phpConfig = writeText "zabbix.conf.php" '' - + ''; installPhase = '' @@ -22,11 +28,13 @@ import ./versions.nix ({ version, hash, ... }: cp ${phpConfig} $out/share/zabbix/conf/zabbix.conf.php ''; - meta = with lib; { + meta = { description = "Enterprise-class open source distributed monitoring solution (web frontend)"; homepage = "https://www.zabbix.com/"; - license = licenses.gpl2Plus; - maintainers = [ maintainers.mmahut ]; - platforms = platforms.linux; + license = + if (lib.versions.major version >= "7") then lib.licenses.agpl3Only else lib.licenses.gpl2Plus; + maintainers = with lib.maintainers; [ mmahut ]; + platforms = lib.platforms.linux; }; - }) + } +) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b05d99c0808e..9d5a4a3f9548 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -25997,6 +25997,7 @@ with pkgs; server = server-pgsql; }; + zabbix70 = recurseIntoAttrs (zabbixFor "v70"); zabbix60 = recurseIntoAttrs (zabbixFor "v60"); zabbix64 = recurseIntoAttrs (zabbixFor "v64"); zabbix50 = recurseIntoAttrs (zabbixFor "v50");