Skip to content

Commit 046ca19

Browse files
committed
test: add test case for agents extra config
1 parent 6b05031 commit 046ca19

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

t/scenarios/agents-plugin/http-backend/agents.cfg

+5
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,10 @@
3434
warn = 7:10
3535
crit = 5:20
3636
</proc>
37+
38+
<extra_service_opts>
39+
service = ^net
40+
args = warn='total > 1GB' crit='total > 1GB' filter='name != testpattern123'
41+
</extra_service_opts>
3742
</snclient>
3843
</Component>

t/scenarios/agents-plugin/livestatus-backend/agents.cfg

+5
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,10 @@
3434
warn = 7:10
3535
crit = 5:20
3636
</proc>
37+
38+
<extra_service_opts>
39+
service = ^net
40+
args = warn='total > 1GB' crit='total > 1GB' filter='name != testpattern123'
41+
</extra_service_opts>
3742
</snclient>
3843
</Component>

t/scenarios/agents-plugin/t/local/livestatus-backend/02-cli-agents.t

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ BEGIN {
1010

1111
$ENV{'THRUK_TEST_AUTH'} = 'omdadmin:omd';
1212
$ENV{'PLACK_TEST_EXTERNALSERVER_URI'} = 'http://127.0.0.1/demo';
13-
plan tests => 85;
13+
plan tests => 93;
1414

1515
###########################################################
1616
# test thruks script path
@@ -30,6 +30,7 @@ TestUtils::test_command({ cmd => '/usr/bin/env thruk agents -I host-ls', like =>
3030
TestUtils::test_page( url => '/thruk/cgi-bin/status.cgi', like => ['agent inventory', 'agent version', 'net eth0'] );
3131
TestUtils::test_page( url => '/thruk/cgi-bin/agents.cgi', like => ['host-ls'] );
3232
TestUtils::test_command({ cmd => '/usr/bin/env thruk agents -l', like => ['/host-ls/'] });
33+
TestUtils::test_command({ cmd => '/usr/bin/env grep -r testpattern123 etc/naemon/conf.d/agents/', like => ['/check_command/', '/host-ls/'] });
3334

3435
###########################################################
3536
# clean up again

0 commit comments

Comments
 (0)