1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
#! /usr/bin/perl -w -I ..
#
# Load Average Tests via check_load
#
# $Id$
#
use strict;
use Test;
use NPTest;
use vars qw($tests);
BEGIN {$tests = 4; plan tests => $tests}
my $successOutput = '/^OK - load average: [0-9]\.?[0-9]+, [0-9]\.?[0-9]+, [0-9]\.?[0-9]+/';
my $failureOutput = '/^CRITICAL - load average: [0-9]\.?[0-9]+, [0-9]\.?[0-9]+, [0-9]\.?[0-9]+/';
my $t;
$t += checkCmd( "./check_load -w 100,100,100 -c 100,100,100", 0, $successOutput );
$t += checkCmd( "./check_load -w 0,0,0 -c 0,0,0", 2, $failureOutput );
exit(0) if defined($Test::Harness::VERSION);
exit($tests - $t);
|