Fix INADDR_NONE value (for systems which don't define it).
[monitoring-plugins.git] / plugins / t / check_procs.t
blobb8c2e8a59fb67cbb9e517982d66bfb0f7eb1d9f8
1 #! /usr/bin/perl -w -I ..
3 # Process Tests via check_procs
5 # $Id$
8 use strict;
9 use Test;
10 use NPTest;
12 use vars qw($tests);
13 BEGIN {$tests = 12; plan tests => $tests}
15 my $t;
17 $t += checkCmd( "./check_procs -w 100000 -c 100000", 0, '/^PROCS OK: [0-9]+ process(es)?$/' );
18 $t += checkCmd( "./check_procs -w 100000 -c 100000 -s Z", 0, '/^PROCS OK: [0-9]+ process(es)? with /' );
19 $t += checkCmd( "./check_procs -w 0 -c 10000000", 1, '/^PROCS WARNING: [0-9]+ process(es)?$/' );
20 $t += checkCmd( "./check_procs -w 0 -c 0", 2, '/^PROCS CRITICAL: [0-9]+ process(es)?$/' );
21 $t += checkCmd( "./check_procs -w 0 -c 0 -s S", 2, '/^PROCS CRITICAL: [0-9]+ process(es)? with /' );
22 $t += checkCmd( "./check_procs -w 0 -c 10000000 -p 1", 1, '/^PROCS WARNING: [0-9]+ process(es)? with PPID = 1/' );
24 exit(0) if defined($Test::Harness::VERSION);
25 exit($tests - $t);