Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nagiosPlugins: init from pkgs/servers/monitoring/nagios/plugins #298757

Merged
merged 15 commits into from
Oct 8, 2024

Conversation

anthonyroussel
Copy link
Member

@anthonyroussel anthonyroussel commented Mar 24, 2024

Description of changes

This pull request aims to improve the organization of Nagios plugins in our repository by creating a dedicated nagiosPlugins attribute set.

  1. Grouping Nagios Plugins: Created a dedicated attribute nagiosPlugins in the all-packages.nix file to group all existing Nagios plugins together (check_smartmon, check_systemd, check_zfs, and check_ssl_cert)

  2. Formatted Nagios plugins with nixfmt-rfc-style

  3. Upgraded check_systemd to 4.1.0: Josef-Friedrich/check_systemd@v2.3.1...v4.1.0

  4. Upgraded check_esxi_hardware to 20221230: Napsty/check_esxi_hardware@2020071...2022123

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@anthonyroussel
Copy link
Member Author

anthonyroussel commented Mar 24, 2024

@ofborg build nagiosPlugins

@anthonyroussel anthonyroussel force-pushed the update/nagios-plugins branch 2 times, most recently from 375a7aa to 75668f6 Compare March 24, 2024 23:16
Copy link
Member

@oxzi oxzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for this pull request and for having the courage to restructure stuff. I came across your PR while searching for existing work to update check_systemd.

Your commit-by-commit breakdown was especially helpful in understanding your thought process. Thank you again for your hard work!

I left a few comments where I thought changes were needed, mostly related to an incorrectly converted license.

I only built check_systemd, as it was the check plugin I was looking for, and it worked as expected.

To keep things simple, I would advise against bumping packages any further, unless the upstream has been locked, as I commented.


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
# out with 406 when trying to fetch the sources
src = fetchFromGitHub {
owner = "speartail";
repo = "checkwmiplus";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This repository is dead since October 2021, speartail/checkwmiplus@37fa4f9.

On a first glance I was unable to find another repository, but tarballs on the author's webpage: https://edcint.co.nz/checkwmiplus/releases/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anthonyroussel
Copy link
Member Author

anthonyroussel commented Apr 4, 2024

Hello @oxzi
Thank you very much for the review :)

I've corrected the incorrect licenses on the 3 packages.

For the check_wmi_plus plugin, since the Git repository is no longer updated and it's no longer possible to diff easily between 2 versions, I'm not very confident about updating this plugin (update, "audit" upstream code & test the package) based on a tar.gz file hosted on a rather obscure Wordpress site, on my side unfortunately.

I suggest that we update this plugin in another PR instead.
What do you think?

@oxzi
Copy link
Member

oxzi commented Apr 4, 2024

Thanks for your fast reply!

I've corrected the incorrect licenses on the 3 packages.

Merci.

For the check_wmi_plus plugin, since the Git repository is no longer updated and it's no longer possible to diff easily between 2 versions, I'm not very confident about updating this plugin (update, audit upstream code & test the package) based on a tar.gz file hosted on a rather obscure Wordpress site, on my side unfortunately.

I suggest that we update this plugin in another PR instead. What do you think?

I completely understand your concerns and I think your suggestion is a fine one, keep the package as it is. Perhaps you could add a comment above the src block? I would recommend against labeling it as broken, since it technically isn't. Additionally, I have created issue #301654 to keep track of this package.

@anthonyroussel
Copy link
Member Author

I completely understand your concerns and I think your suggestion is a fine one, keep the package as it is. Perhaps you could add a comment above the src block? I would recommend against labeling it as broken, since it technically isn't. Additionally, I have created issue #301654 to keep track of this package.

Thanks for creating the issue ticket.

Sure, I just added comment above the src block to indicate that upstream has been moved.

Copy link
Member

@oxzi oxzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again! After having some hours of sleep, I looked at the changes again and they look good to me. Furthermore, I have tested building all packages and checked what happened when trying to build one of the now aliased packages. Looks good to me!

$ git rev-parse HEAD
559497dbb9ac3e5e3d7b4d7af2aca03155c559d5

$ nix-build -A nagiosPlugins
/nix/store/g7ry2rgiihhrjas9nma9gzxm2rc04r45-check_esxi_hardware-20221230
/nix/store/4xl1pkp3q6f2fj4j52ycgn45ixc7np8k-check_mssql_health-2.6.4.15
/nix/store/g4nmm8qv9q5dqgz6n0s57qdh4jsbxrkr-check_nwc_health-7.10.0.6
/nix/store/0dh1fbyl2y83wkcjgwgzx7l3513qnc2b-check_openvpn-0.0.1
/nix/store/ipksi0529nj4na81bpaxcax4akla7lis-check_smartmon-1.0.1
/nix/store/dd1gqs8fxavi6vdkyv3vg52g51b83j4c-check_ssl_cert-2.81.0
/nix/store/rrcnlcxm17c0j00m2cw703214ns0dvpd-check_systemd-4.1.0
/nix/store/kn1a4bc9sr0af2xqnc56m23hlbzxdwll-check_ups_health-2.8.3.3
/nix/store/xx6ybjx2lfvab0hmdjm5pkwcaccbkxcw-check_uptime-unstable-2016-11-12
/nix/store/b6svpmx5j9x9ww7hi34b8590nn093k4x-check_wmi_plus-1.65
/nix/store/yvg8qzjky77rg33jzjgxgaf5xn1z8pi0-check_zfs-2.0

$ nix-build -A monitoring-plugins
/nix/store/ks6afw75qpa156pv7sdkczfwx4bgydh0-monitoring-plugins-2.3.5

$ for i in check_smartmon check_systemd check_zfs check-esxi-hardware check-mssql-health check-nwc-health check-openvpn check-ups-health check-uptime check-wmiplus checkSSLCert; do nix-build -A "$i"; done
trace: warning: 'check_smartmon' has been renamed to 'nagiosPlugins.check_smartmon'
/nix/store/ipksi0529nj4na81bpaxcax4akla7lis-check_smartmon-1.0.1
trace: warning: 'check_systemd' has been renamed to 'nagiosPlugins.check_systemd'
/nix/store/rrcnlcxm17c0j00m2cw703214ns0dvpd-check_systemd-4.1.0
trace: warning: 'check_zfs' has been renamed to 'nagiosPlugins.check_zfs'
/nix/store/yvg8qzjky77rg33jzjgxgaf5xn1z8pi0-check_zfs-2.0
trace: warning: 'check-esxi-hardware' has been renamed to 'nagiosPlugins.check_esxi_hardware'
/nix/store/g7ry2rgiihhrjas9nma9gzxm2rc04r45-check_esxi_hardware-20221230
trace: warning: 'check-mssql-health' has been renamed to 'nagiosPlugins.check_mssql_health'
/nix/store/4xl1pkp3q6f2fj4j52ycgn45ixc7np8k-check_mssql_health-2.6.4.15
trace: warning: 'check-nwc-health' has been renamed to 'nagiosPlugins.check_nwc_health'
/nix/store/g4nmm8qv9q5dqgz6n0s57qdh4jsbxrkr-check_nwc_health-7.10.0.6
trace: warning: 'check-openvpn' has been renamed to 'nagiosPlugins.check_openvpn'
/nix/store/0dh1fbyl2y83wkcjgwgzx7l3513qnc2b-check_openvpn-0.0.1
trace: warning: 'check-ups-health' has been renamed to 'nagiosPlugins.check_ups_health'
/nix/store/kn1a4bc9sr0af2xqnc56m23hlbzxdwll-check_ups_health-2.8.3.3
trace: warning: 'check-uptime' has been renamed to 'nagiosPlugins.check_uptime'
/nix/store/xx6ybjx2lfvab0hmdjm5pkwcaccbkxcw-check_uptime-unstable-2016-11-12
trace: warning: 'check-wmiplus' has been renamed to 'nagiosPlugins.check_wmi_plus'
/nix/store/b6svpmx5j9x9ww7hi34b8590nn093k4x-check_wmi_plus-1.65
trace: warning: 'checkSSLCert' has been renamed to 'nagiosPlugins.check_ssl_cert'
/nix/store/dd1gqs8fxavi6vdkyv3vg52g51b83j4c-check_ssl_cert-2.81.0

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-already-reviewed/2617/1586

@anthonyroussel
Copy link
Member Author

@SuperSandro2000 Thank you for your review! I handled all your feedbacks.

@anthonyroussel
Copy link
Member Author

anthonyroussel commented May 3, 2024

I was just wondering if I should rename the nagiosPlugins attribute set to nagiosPackages instead to be consistent. What do you think?

@anthonyroussel
Copy link
Member Author

Rebased against master branch and solved conflicts

@anthonyroussel anthonyroussel requested a review from oxzi June 6, 2024 11:43
@anthonyroussel anthonyroussel merged commit 2c2b5ef into NixOS:master Oct 8, 2024
29 checks passed
@anthonyroussel anthonyroussel deleted the update/nagios-plugins branch October 8, 2024 18:43
@oxzi
Copy link
Member

oxzi commented Oct 9, 2024

Nice to see this getting merged. I mean.. if the original reviewer w/ merge rights did not respond, then it's easier to get merge rights yourself :)

@oxzi oxzi mentioned this pull request Oct 9, 2024
13 tasks

stdenv.mkDerivation {
pname = "check-uptime";
version = "unstable-2016-11-12";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should have a 0- prefix

makeWrapper
];

prePatch = ''
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be postPatch

inherit pname version;

src = fetchurl {
url = "https://labs.consol.de/assets/downloads/nagios/${pname}-${version}.tar.gz";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pname should not be substituted in urls

@@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those should reference the new packages instead of using throws

@SuperSandro2000
Copy link
Member

Nice to see this getting merged. I mean.. if the original reviewer w/ merge rights did not respond, then it's easier to get merge rights yourself :)

As hard as it sounds, Nagios just does not have a priority in the flood of review requests I receive on a daily and it is not great that this happened like this with the 5 comments I immediately saw above.

@anthonyroussel anthonyroussel mentioned this pull request Oct 24, 2024
13 tasks
@anthonyroussel
Copy link
Member Author

Thank you for the review! @SuperSandro2000 :)
I created PR #351008 to fix these problems introduced with my PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants