I'm seeing this error: Argument "v6.0.1" isn't numeric in numeric lt (<) at /usr/local/libexec/nagios/check_snmp_storage.pl line 420. Argument "v6.0.1" isn't numeric in numeric lt (<) at /usr/local/libexec/nagios/check_snmp_storage.pl line 494. This affect other scripts with this package as well. The lines in question look like this: if (Net::SNMP->VERSION < 4) { I think the problem is caused by a change in format for Net::SNMP->VERSION - it is now alphanumeric and was previously numeric. I have this code snippet to demonstrate a potential fix: #!/usr/local/bin/perl use strict; use Net::SNMP; print (Net::SNMP->VERSION); print"\n"; if (Net::SNMP->VERSION lt "v4.0.0.0") { print "it is less than\n"; } else { print "it is NOT less than\n"; } $ perl test-snmp-version.pl v6.0.1 it is NOT less than $ pkg info -x nagios-snmp-plugins-extras nagios-snmp-plugins-extras-1.1.2_1 pkg info -x net-snmp net-snmp-5.9.1_1,1 p5-Net-SNMP-6.0.1_1
> it is now alphanumeric and was previously numeric. I have no proof of that. The problem script in question dates from 2007. See http://nagios.manubulon.com/check_snmp_storage.pl Going back to 4.0.0 of Net-SNMP, they used v4.0.0 - so I don't know why this was not caught earlier.
This is the scope of the problem: grep -r 'Net::SNMP->VERSION' * work/plugins/check_snmp_css_main.pl:my $resultat = (Net::SNMP->VERSION < 4) ? work/plugins/check_snmp_env.pl:my $resultat = (Net::SNMP->VERSION < 4) ? work/plugins/check_snmp_env.pl:$resultat = (Net::SNMP->VERSION < 4) ? work/plugins/check_snmp_env.pl:$resultat = (Net::SNMP->VERSION < 4) ? work/plugins/check_snmp_env.pl:$resultat = (Net::SNMP->VERSION < 4) ? work/plugins/check_snmp_env.pl: $resultat = (Net::SNMP->VERSION < 4) ? work/plugins/check_snmp_env.pl: $resultat = (Net::SNMP->VERSION < 4) ? work/plugins/check_snmp_env.pl: $resultat = (Net::SNMP->VERSION < 4) ? work/plugins/check_snmp_env.pl: $resultat = (Net::SNMP->VERSION < 4) ? work/plugins/check_snmp_env.pl: $resultat = (Net::SNMP->VERSION < 4) ? work/plugins/check_snmp_env.pl:my $result_ps = (Net::SNMP->VERSION < 4) ? work/plugins/check_snmp_mem.pl: $resultat = (Net::SNMP->VERSION < 4) ? work/plugins/check_snmp_mem.pl: $resultat = (Net::SNMP->VERSION < 4) ? work/plugins/check_snmp_mem.pl: $resultat = (Net::SNMP->VERSION < 4) ? work/plugins/check_snmp_win.pl:$resultat = (Net::SNMP->VERSION < 4) ? work/plugins/check_snmp_win.pl:$result = (Net::SNMP->VERSION < 4) ? work/plugins/check_snmp_boostedge.pl:my $resultat = (Net::SNMP->VERSION < 4) ? work/plugins/check_snmp_boostedge.pl:$resultat = (Net::SNMP->VERSION < 4) ? work/plugins/check_snmp_nsbox.pl:my $resultat = (Net::SNMP->VERSION < 4) ? work/plugins/check_snmp_nsbox.pl:$resultat = (Net::SNMP->VERSION < 4) ? work/plugins/check_snmp_process.pl: $resultat = (Net::SNMP->VERSION < 4) ? work/plugins/check_snmp_process.pl: $resultat = (Net::SNMP->VERSION < 4) ? work/plugins/check_snmp_process.pl: $resultat_param = (Net::SNMP->VERSION < 4) ? work/plugins/check_snmp_process.pl: $getall_run = (Net::SNMP->VERSION < 4) ? work/plugins/check_snmp_process.pl: $getall_cpu = (Net::SNMP->VERSION < 4) ? work/plugins/check_snmp_process.pl: $getall_mem = (Net::SNMP->VERSION < 4) ? work/plugins/check_snmp_process.pl: $tmp_result = (Net::SNMP->VERSION < 4) ? work/plugins/check_snmp_process.pl: $result = (Net::SNMP->VERSION < 4) ? work/plugins/check_snmp_storage.pl: if (Net::SNMP->VERSION < 4) { work/plugins/check_snmp_storage.pl: if (Net::SNMP->VERSION < 4) { work/plugins/check_snmp_storage.pl: if (Net::SNMP->VERSION < 4) { work/plugins/check_snmp_storage.pl:if (Net::SNMP->VERSION < 4) { work/plugins/install.sh: SNMPVER=`$PERLHOME -e 'require Net::SNMP;print Net::SNMP->VERSION'` work/plugins/check_snmp_load.pl:my $resultat = (Net::SNMP->VERSION < 4) ? work/plugins/check_snmp_load.pl:my $resultat = (Net::SNMP->VERSION < 4) ? work/plugins/check_snmp_load.pl:my $resultat = (Net::SNMP->VERSION < 4) ? work/plugins/check_snmp_load.pl:my $resultat = (Net::SNMP->VERSION < 4) ? work/plugins/check_snmp_load.pl:my $resultat = (Net::SNMP->VERSION < 4) ? work/plugins/check_snmp_load.pl:my $resultat = (Net::SNMP->VERSION < 4) ? work/plugins/check_snmp_load.pl:my $resultat = (Net::SNMP->VERSION < 4) ? work/plugins/check_snmp_linkproof_nhr.pl:my $resultat = (Net::SNMP->VERSION < 4) ? work/plugins/check_snmp_linkproof_nhr.pl:if (Net::SNMP->VERSION < 4) { work/plugins/check_snmp_css.pl: $resultat = (Net::SNMP->VERSION < 4) ? work/plugins/check_snmp_css.pl:$resultat = (Net::SNMP->VERSION < 4) ? work/plugins/check_snmp_css.pl:$resultat2 = (Net::SNMP->VERSION < 4) ? work/plugins/check_snmp_vrrp.pl:if (Net::SNMP->VERSION < 4) { work/plugins/check_snmp_vrrp.pl:if (Net::SNMP->VERSION < 4) {
Created attachment 239410 [details] Allow for non-numeric versions Tested here, works.
I sent an email upstream.
joneum: How do you feel about this patch?
Today maintainer timeout occurs.
Proceeding.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=4f8ce8f7eca6e0d4c9dad32b34e4b73965457e44 commit 4f8ce8f7eca6e0d4c9dad32b34e4b73965457e44 Author: Dan Langille <dvl@FreeBSD.org> AuthorDate: 2023-10-17 20:04:02 +0000 Commit: Dan Langille <dvl@FreeBSD.org> CommitDate: 2023-10-17 20:07:51 +0000 net-mgmt/nagios-snmp-plugins-extras: use lt not < The problem is caused by a change in format for Net::SNMP->VERSION - it is now alphanumeric and was previously numeric. PR: 268891 Approved by: maintainer timeout (12 weeks) net-mgmt/nagios-snmp-plugins-extras/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)