Introspector/Probe/Nagios/CheckMkAgent.pm

filter: Statementstmt 95.0% 19 / 20 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod 0.0% 0 / 1 totaltotal 86.6% 26 / 30 CC 4 SCAR 9.7
CC
4
Cov
92%
__ANON__
4.0
_get_check_mk_agent_output
2.0
gather
1.0
CRAP 2.6
« Introspector/Probe/Sudoers.pm ↑ Summary Introspector/Config.pm »
1 package System::Introspector::Probe::Nagios::CheckMkAgent;
2 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 1 ▶use System::Introspector::Util qw(
Subroutine BEGIN: called CC=1 SCAR=0.0
5 lines_from_command
6 transform_exceptions
7 1 );
8  
9 1 ▶sub gather {
Subroutine gather: called CC=1 SCAR=0.0
Pod undocumented
10 1 my ($self) = @_;
11 1 ▶ return transform_exceptions {
Subroutine __ANON__: called CC=4 SCAR=13.9
12 1 my @lines = $self->_get_check_mk_agent_output;
13 1 chomp @lines;
14 1 my %plugin;
15 my $current;
16 1 for my $line (@lines) {
17 6 ▶ if ($line =~ m{^<<<(.+)>>>$}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($line =~ /^<<<(.+)>>>$/) 3 3 6
18 3 $plugin{ $1 } = $current = [];
19 3 next;
20 }
21 3 ▶ next unless $current;
Branch: 1 branch
BranchTrueFalseTotal
unless $current 0 3 3
22 3 push @$current, $line;
23 }
24 1 return { nagios_check_mk_agent => \%plugin };
25 1 };
26 }
27  
28 0 ▶sub _get_check_mk_agent_output {
Subroutine _get_check_mk_agent_output: not called CC=1 SCAR=6.9
29 0 return lines_from_command ['check_mk_agent'];
30 }
31  
32 1 1;
33  
34 __END__
« Introspector/Probe/Sudoers.pm ↑ Summary Introspector/Config.pm »