CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [stumpd] Trying to sort output: Edit Log



FishMonger
Veteran / Moderator

Feb 23, 2013, 12:06 PM


Views: 1584
Re: [stumpd] Trying to sort output


Code
#!/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)


Edit Log:
Post edited by FishMonger (Veteran) on Feb 23, 2013, 12:07 PM
Post edited by FishMonger (Veteran) on Feb 23, 2013, 12:11 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives