From a521fec1bf292ba1909a19b15bbc678aae6a5703 Mon Sep 17 00:00:00 2001 From: Anthony Roussel Date: Sun, 24 Mar 2024 23:04:07 +0100 Subject: [PATCH] nagiosPlugins: init from pkgs/servers/monitoring/nagios/plugins --- .../check_esxi_hardware/default.nix} | 0 .../check_openvpn/default.nix} | 2 +- .../check_smartmon/default.nix} | 0 .../check_ssl_cert/default.nix} | 0 .../check_systemd/default.nix} | 0 .../check_uptime/default.nix} | 2 +- .../check_wmi_plus}/default.nix | 2 +- .../check_wmi_plus}/wmiplus_fix_manpage.patch | 0 .../check_zfs/default.nix} | 0 .../monitoring/nagios-plugins/default.nix | 7 ++++++ .../labs_consol_de/default.nix} | 6 ++--- .../monitoring/nagios-plugins/plugins.nix | 14 +++++++++++ pkgs/top-level/aliases.nix | 11 +++++++++ pkgs/top-level/all-packages.nix | 23 ++----------------- 14 files changed, 40 insertions(+), 27 deletions(-) rename pkgs/servers/monitoring/{plugins/esxi.nix => nagios-plugins/check_esxi_hardware/default.nix} (100%) rename pkgs/servers/monitoring/{plugins/openvpn.nix => nagios-plugins/check_openvpn/default.nix} (95%) rename pkgs/servers/monitoring/{nagios/plugins/smartmon.nix => nagios-plugins/check_smartmon/default.nix} (100%) rename pkgs/servers/monitoring/{nagios/plugins/check_ssl_cert.nix => nagios-plugins/check_ssl_cert/default.nix} (100%) rename pkgs/servers/monitoring/{nagios/plugins/check_systemd.nix => nagios-plugins/check_systemd/default.nix} (100%) rename pkgs/servers/monitoring/{plugins/uptime.nix => nagios-plugins/check_uptime/default.nix} (96%) rename pkgs/servers/monitoring/{plugins/wmiplus => nagios-plugins/check_wmi_plus}/default.nix (98%) rename pkgs/servers/monitoring/{plugins/wmiplus => nagios-plugins/check_wmi_plus}/wmiplus_fix_manpage.patch (100%) rename pkgs/servers/monitoring/{nagios/plugins/zfs.nix => nagios-plugins/check_zfs/default.nix} (100%) create mode 100644 pkgs/servers/monitoring/nagios-plugins/default.nix rename pkgs/servers/monitoring/{plugins/labs_consol_de.nix => nagios-plugins/labs_consol_de/default.nix} (95%) create mode 100644 pkgs/servers/monitoring/nagios-plugins/plugins.nix diff --git a/pkgs/servers/monitoring/plugins/esxi.nix b/pkgs/servers/monitoring/nagios-plugins/check_esxi_hardware/default.nix similarity index 100% rename from pkgs/servers/monitoring/plugins/esxi.nix rename to pkgs/servers/monitoring/nagios-plugins/check_esxi_hardware/default.nix diff --git a/pkgs/servers/monitoring/plugins/openvpn.nix b/pkgs/servers/monitoring/nagios-plugins/check_openvpn/default.nix similarity index 95% rename from pkgs/servers/monitoring/plugins/openvpn.nix rename to pkgs/servers/monitoring/nagios-plugins/check_openvpn/default.nix index 1bf6584abfdd..c285a3cd760c 100644 --- a/pkgs/servers/monitoring/plugins/openvpn.nix +++ b/pkgs/servers/monitoring/nagios-plugins/check_openvpn/default.nix @@ -1,7 +1,7 @@ { lib, fetchFromGitHub, python3Packages }: python3Packages.buildPythonApplication rec { - pname = "check-openvpn"; + pname = "check_openvpn"; version = "0.0.1"; src = fetchFromGitHub { diff --git a/pkgs/servers/monitoring/nagios/plugins/smartmon.nix b/pkgs/servers/monitoring/nagios-plugins/check_smartmon/default.nix similarity index 100% rename from pkgs/servers/monitoring/nagios/plugins/smartmon.nix rename to pkgs/servers/monitoring/nagios-plugins/check_smartmon/default.nix diff --git a/pkgs/servers/monitoring/nagios/plugins/check_ssl_cert.nix b/pkgs/servers/monitoring/nagios-plugins/check_ssl_cert/default.nix similarity index 100% rename from pkgs/servers/monitoring/nagios/plugins/check_ssl_cert.nix rename to pkgs/servers/monitoring/nagios-plugins/check_ssl_cert/default.nix diff --git a/pkgs/servers/monitoring/nagios/plugins/check_systemd.nix b/pkgs/servers/monitoring/nagios-plugins/check_systemd/default.nix similarity index 100% rename from pkgs/servers/monitoring/nagios/plugins/check_systemd.nix rename to pkgs/servers/monitoring/nagios-plugins/check_systemd/default.nix diff --git a/pkgs/servers/monitoring/plugins/uptime.nix b/pkgs/servers/monitoring/nagios-plugins/check_uptime/default.nix similarity index 96% rename from pkgs/servers/monitoring/plugins/uptime.nix rename to pkgs/servers/monitoring/nagios-plugins/check_uptime/default.nix index 04a3ba18aa79..2434599ac1f3 100644 --- a/pkgs/servers/monitoring/plugins/uptime.nix +++ b/pkgs/servers/monitoring/nagios-plugins/check_uptime/default.nix @@ -1,7 +1,7 @@ { lib, stdenv, fetchFromGitHub, autoreconfHook }: stdenv.mkDerivation { - pname = "check-uptime"; + pname = "check_uptime"; version = "20161112"; src = fetchFromGitHub { diff --git a/pkgs/servers/monitoring/plugins/wmiplus/default.nix b/pkgs/servers/monitoring/nagios-plugins/check_wmi_plus/default.nix similarity index 98% rename from pkgs/servers/monitoring/plugins/wmiplus/default.nix rename to pkgs/servers/monitoring/nagios-plugins/check_wmi_plus/default.nix index 5ad284da002c..fc0976116820 100644 --- a/pkgs/servers/monitoring/plugins/wmiplus/default.nix +++ b/pkgs/servers/monitoring/nagios-plugins/check_wmi_plus/default.nix @@ -3,7 +3,7 @@ , wmic-bin ? null }: stdenv.mkDerivation rec { - pname = "check-wmiplus"; + pname = "check_wmi_plus"; version = "1.65"; # We fetch from github.com instead of the proper upstream as nix-build errors diff --git a/pkgs/servers/monitoring/plugins/wmiplus/wmiplus_fix_manpage.patch b/pkgs/servers/monitoring/nagios-plugins/check_wmi_plus/wmiplus_fix_manpage.patch similarity index 100% rename from pkgs/servers/monitoring/plugins/wmiplus/wmiplus_fix_manpage.patch rename to pkgs/servers/monitoring/nagios-plugins/check_wmi_plus/wmiplus_fix_manpage.patch diff --git a/pkgs/servers/monitoring/nagios/plugins/zfs.nix b/pkgs/servers/monitoring/nagios-plugins/check_zfs/default.nix similarity index 100% rename from pkgs/servers/monitoring/nagios/plugins/zfs.nix rename to pkgs/servers/monitoring/nagios-plugins/check_zfs/default.nix diff --git a/pkgs/servers/monitoring/nagios-plugins/default.nix b/pkgs/servers/monitoring/nagios-plugins/default.nix new file mode 100644 index 000000000000..d388c3c58688 --- /dev/null +++ b/pkgs/servers/monitoring/nagios-plugins/default.nix @@ -0,0 +1,7 @@ +{ newScope, pkgs }: + +let + callPackage = newScope (pkgs // plugins); + plugins = import ./plugins.nix { inherit callPackage; }; +in +plugins diff --git a/pkgs/servers/monitoring/plugins/labs_consol_de.nix b/pkgs/servers/monitoring/nagios-plugins/labs_consol_de/default.nix similarity index 95% rename from pkgs/servers/monitoring/plugins/labs_consol_de.nix rename to pkgs/servers/monitoring/nagios-plugins/labs_consol_de/default.nix index 255fd01f71f2..12089090d3bd 100644 --- a/pkgs/servers/monitoring/plugins/labs_consol_de.nix +++ b/pkgs/servers/monitoring/nagios-plugins/labs_consol_de/default.nix @@ -51,7 +51,7 @@ let }; in { - check-mssql-health = generic { + check_mssql_health = generic { pname = "check_mssql_health"; version = "2.6.4.15"; sha256 = "12z0b3c2p18viy7s93r6bbl8fvgsqh80136d07118qhxshp1pwxg"; @@ -59,7 +59,7 @@ in { buildInputs = [ perlPackages.DBDsybase ]; }; - check-nwc-health = generic { + check_nwc_health = generic { pname = "check_nwc_health"; version = "7.10.0.6"; sha256 = "092rhaqnk3403z0y60x38vgh65gcia3wrd6gp8mr7wszja38kxv2"; @@ -67,7 +67,7 @@ in { buildInputs = [ perlPackages.NetSNMP ]; }; - check-ups-health = generic { + check_ups_health = generic { pname = "check_ups_health"; version = "2.8.3.3"; sha256 = "0qc2aglppwr9ms4p53kh9nr48625sqrbn46xs0k9rx5sv8hil9hm"; diff --git a/pkgs/servers/monitoring/nagios-plugins/plugins.nix b/pkgs/servers/monitoring/nagios-plugins/plugins.nix new file mode 100644 index 000000000000..e4adccaa10e0 --- /dev/null +++ b/pkgs/servers/monitoring/nagios-plugins/plugins.nix @@ -0,0 +1,14 @@ +{ callPackage }: + +{ + check_esxi_hardware = callPackage ./check_esxi_hardware { }; + check_openvpn = callPackage ./check_openvpn { }; + check_smartmon = callPackage ./check_smartmon { }; + check_ssl_cert = callPackage ./check_ssl_cert { }; + check_systemd = callPackage ./check_systemd { }; + check_uptime = callPackage ./check_uptime { }; + check_wmi_plus = callPackage ./check_wmi_plus { }; + check_zfs = callPackage ./check_zfs { }; + + inherit (callPackage ./labs_consol_de { }) check_mssql_health check_nwc_health check_ups_health; +} diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 972743705c9f..2f54642e3632 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -231,6 +231,17 @@ mapAliases { ccloud-cli = throw "ccloud-cli has been removed, please use confluent-cli instead"; # Added 2023-06-09 certmgr-selfsigned = certmgr; # Added 2023-11-30 challenger = taler-challenger; # Added 2024-09-04 + check_smartmon = throw "'check_smartmon' has been renamed to 'nagiosPlugins.check_smartmon'"; # Added 2024-05-03 + check_systemd = throw "'check_systemd' has been renamed to 'nagiosPlugins.check_systemd'"; # Added 2024-05-03 + check_zfs = throw "'check_zfs' has been renamed to 'nagiosPlugins.check_zfs'"; # Added 2024-05-03 + check-esxi-hardware = throw "'check-esxi-hardware' has been renamed to 'nagiosPlugins.check_esxi_hardware'"; # Added 2024-05-03 + check-mssql-health = throw "'check-mssql-health' has been renamed to 'nagiosPlugins.check_mssql_health'"; # Added 2024-05-03 + check-nwc-health = throw "'check-nwc-health' has been renamed to 'nagiosPlugins.check_nwc_health'"; # Added 2024-05-03 + check-openvpn = throw "'check-openvpn' has been renamed to 'nagiosPlugins.check_openvpn'"; # Added 2024-05-03 + check-ups-health = throw "'check-ups-health' has been renamed to 'nagiosPlugins.check_ups_health'"; # Added 2024-05-03 + check-uptime = throw "'check-uptime' has been renamed to 'nagiosPlugins.check_uptime'"; # Added 2024-05-03 + check-wmiplus = throw "'check-wmiplus' has been renamed to 'nagiosPlugins.check_wmi_plus'"; # Added 2024-05-03 + checkSSLCert = throw "'checkSSLCert' has been renamed to 'nagiosPlugins.check_ssl_cert'"; # Added 2024-05-03 chefdk = throw "chefdk has been removed due to being deprecated upstream by Chef Workstation"; # Added 2023-03-22 chia = throw "chia has been removed. see https://github.com/NixOS/nixpkgs/pull/270254"; # Added 2023-11-30 chia-dev-tools = throw "chia-dev-tools has been removed. see https://github.com/NixOS/nixpkgs/pull/270254"; # Added 2023-11-30 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8630eb31bed5..ee60ffcc5ec1 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -24965,29 +24965,14 @@ with pkgs; nagios = callPackage ../servers/monitoring/nagios { }; + nagiosPlugins = callPackages ../servers/monitoring/nagios-plugins { }; + monitoring-plugins = callPackage ../servers/monitoring/plugins { }; - inherit (callPackage ../servers/monitoring/plugins/labs_consol_de.nix { }) - check-mssql-health - check-nwc-health - check-ups-health; - - check-openvpn = callPackage ../servers/monitoring/plugins/openvpn.nix { }; - - check_smartmon = callPackage ../servers/monitoring/nagios/plugins/smartmon.nix { }; - - checkSSLCert = callPackage ../servers/monitoring/nagios/plugins/check_ssl_cert.nix { }; - - check_systemd = callPackage ../servers/monitoring/nagios/plugins/check_systemd.nix { }; - - check_zfs = callPackage ../servers/monitoring/nagios/plugins/zfs.nix { }; - neo4j = callPackage ../servers/nosql/neo4j { }; neo4j-desktop = callPackage ../applications/misc/neo4j-desktop { }; - check-esxi-hardware = callPackage ../servers/monitoring/plugins/esxi.nix { }; - net-snmp = callPackage ../servers/monitoring/net-snmp { }; newrelic-sysmond = callPackage ../servers/monitoring/newrelic-sysmond { }; @@ -25278,8 +25263,6 @@ with pkgs; sensu-go-backend sensu-go-cli; - check-wmiplus = callPackage ../servers/monitoring/plugins/wmiplus { }; - shishi = callPackage ../servers/shishi { pam = if stdenv.hostPlatform.isLinux then pam else null; # see also openssl, which has/had this same trick @@ -38627,8 +38610,6 @@ with pkgs; wmic-bin = callPackage ../servers/monitoring/plugins/wmic-bin.nix { }; - check-uptime = callPackage ../servers/monitoring/plugins/uptime.nix { }; - ghc-standalone-archive = callPackage ../os-specific/darwin/ghc-standalone-archive { }; vdr = callPackage ../applications/video/vdr { };