summaryrefslogtreecommitdiffstats
path: root/plugins/t/check_procs.t
blob: cb5f1224be30a316284b9fb19ec99b15a2d1749f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#! /usr/bin/perl -w -I ..
#
# Process Tests via check_procs
#
# $Id$
#

use strict;
use Test;
use NPTest;

use vars qw($tests);
BEGIN {$tests = 10; plan tests => $tests}

my $t;

$t += checkCmd( "./check_procs -w 100000 -c   100000",      0, '/^PROCS OK: [0-9]+ process(es)?$/' );
$t += checkCmd( "./check_procs -w 100000 -c   100000 -s Z", 0, '/^PROCS OK: [0-9]+ process(es)? with /' );
$t += checkCmd( "./check_procs -w      0 -c 10000000",      1, '/^PROCS WARNING: [0-9]+ process(es)?$/' );
$t += checkCmd( "./check_procs -w 0      -c        0",      2, '/^PROCS CRITICAL: [0-9]+ process(es)?$/' );
$t += checkCmd( "./check_procs -w 0      -c        0 -s S", 2, '/^PROCS CRITICAL: [0-9]+ process(es)? with /' );

exit(0) if defined($Test::Harness::VERSION);
exit($tests - $t);