From 5392e84b8a2fc87717bec4af6cfb84c4624ccec3 Mon Sep 17 00:00:00 2001 From: Rowan Wookey Date: Fri, 17 Apr 2020 22:34:37 +0100 Subject: [PATCH] Fixed warnings generated by total_by_process_ Fixed the following: * Argument "config" isn't numeric in numeric eq (==) at line 89. * Use of uninitialized value $ARGV[1] in string eq at line 35 --- plugins/system/total_by_process_ | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/system/total_by_process_ b/plugins/system/total_by_process_ index d374f463..d4a9b825 100755 --- a/plugins/system/total_by_process_ +++ b/plugins/system/total_by_process_ @@ -32,7 +32,7 @@ $scriptname =~ s|.*/||; my $fieldname = ($scriptname =~ /^total_by_process_(.*)_(.*)/) ? $1 : undef; my $fieldtype = ($scriptname =~ /^total_by_process_(.*)_(.*)/) ? $2 : undef; -if (@ARGV and $ARGV[1] eq "suggest") +if (defined($ARGV[0]) and $ARGV[0] eq "suggest") { system("ps L | cut -d' ' -f1"); exit(0); @@ -86,7 +86,7 @@ foreach my $process (keys %total_by_process) close(PS); -if (@ARGV and $ARGV[1] == "config") +if (defined($ARGV[0]) and $ARGV[0] eq "config") { print <