
FishMonger
Veteran
Feb 23, 2013, 12:06 PM
Views: 395
|
|
Re: [stumpd] Trying to sort output
|
|
|
#!/usr/bin/perl use strict; use warnings; use List::Util qw(max); my $rundsm = `dsmadmc -id=reports -pa=reports q proc`; my @seconds = $rundsm =~ /\((\d+)\s+seconds\)/mg; if (max(@seconds) >= 1001) { print "Message: Issue Found, Alert Operations\n", "Statistic: 1\n"; exit 1; } else { print "Message: No Issues Foun\n", "Statistic: 0\n"; exit 0; }
(This post was edited by FishMonger on Feb 23, 2013, 12:11 PM)
|