summaryrefslogtreecommitdiffstats
path: root/plugins/tests/check_procs.t
diff options
context:
space:
mode:
authorLorenz Kästle <lorenz.kaestle@netways.de>2023-04-28 09:00:05 (GMT)
committerLorenz Kästle <lorenz.kaestle@netways.de>2023-04-28 09:00:05 (GMT)
commit34c4d13edd8ece1e928c578974218c10d25600c4 (patch)
tree96eaf64dc46c8b785d437250d42471180597a699 /plugins/tests/check_procs.t
parente4ddeb7bb722b50613108da1cb51a48e84068701 (diff)
parent7cb82e6486e662fa4d2530523787d3eced266545 (diff)
downloadmonitoring-plugins-34c4d13edd8ece1e928c578974218c10d25600c4.tar.gz
Merge branch 'master' into RincewindsHat-patch-1
Diffstat (limited to 'plugins/tests/check_procs.t')
-rwxr-xr-xplugins/tests/check_procs.t8
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/tests/check_procs.t b/plugins/tests/check_procs.t
index 3af218f..b3a0a30 100755
--- a/plugins/tests/check_procs.t
+++ b/plugins/tests/check_procs.t
@@ -8,7 +8,7 @@ use Test::More;
8use NPTest; 8use NPTest;
9 9
10if (-x "./check_procs") { 10if (-x "./check_procs") {
11 plan tests => 52; 11 plan tests => 54;
12} else { 12} else {
13 plan skip_all => "No check_procs compiled"; 13 plan skip_all => "No check_procs compiled";
14} 14}
@@ -34,9 +34,13 @@ is( $result->return_code, 0, "Checking no threshold breeched" );
34is( $result->output, "PROCS OK: 95 processes | procs=95;100;200;0;", "Output correct" ); 34is( $result->output, "PROCS OK: 95 processes | procs=95;100;200;0;", "Output correct" );
35 35
36$result = NPTest->testCmd( "$command -C launchd -c 5" ); 36$result = NPTest->testCmd( "$command -C launchd -c 5" );
37is( $result->return_code, 2, "Checking processes filtered by command name" ); 37is( $result->return_code, 2, "Checking processes matched by command name" );
38is( $result->output, "PROCS CRITICAL: 6 processes with command name 'launchd' | procs=6;;5;0;", "Output correct" ); 38is( $result->output, "PROCS CRITICAL: 6 processes with command name 'launchd' | procs=6;;5;0;", "Output correct" );
39 39
40$result = NPTest->testCmd( "$command -X bash -c 5" );
41is( $result->return_code, 2, "Checking processes excluded by command name" );
42is( $result->output, "PROCS CRITICAL: 95 processes with exclude progs 'bash' | procs=95;;5;0;", "Output correct" );
43
40SKIP: { 44SKIP: {
41 skip 'user with uid 501 required', 4 unless getpwuid(501); 45 skip 'user with uid 501 required', 4 unless getpwuid(501);
42 46