1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 18:41:03 +00:00

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
This commit is contained in:
Rowan Wookey 2020-04-17 22:34:37 +01:00 committed by Lars Kruse
parent 90ccaf4b06
commit 5392e84b8a

View file

@ -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 <<END;
graph_title $fieldname by Process