| 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
| |||||||||||
| 18 | 3 | $plugin{ $1 } = $current = []; | |||||||||
| 19 | 3 | next; | |||||||||
| 20 | } | ||||||||||
| 21 | 3 | ▶ | next unless $current; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 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__ | ||||||||||