#! /usr/bin/perl -w
+# Copyright (c) 2014 Joey Schulze <joey@infodrom.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
+
use strict;
use Getopt::Long;
use lib '/usr/lib/nagios/plugins';
-use utils qw(%ERRORS &print_revision &support);
+use utils qw(%ERRORS);
my $config = {
'host' => undef,
my $host;
Getopt::Long::Configure('no_ignore_case');
-GetOptions 'H=s' => \$host,
+GetOptions
'host|h=s' => \$host,
'warn=s' => \$config->{warn_jobs},
'crit=s' => \$config->{crit_jobs},
my $cmd = sprintf('/usr/bin/uustat -s %s %s', $host,
$hours ? '-o ' . $hours : '');
- open my $prg, '|-', $cmd || return;
+ open my $prg, '-|', $cmd || return;
my @list;
while (<$prg>) {
push @list, $_;