Branch Coverage

blib/lib/App/MultiModule/Tasks/NagiosCmd.pm
Criterion Covered Total %
branch 0 44 0.0


line true false branch
26 0 0 unless (defined $message->{$field_name})
31 0 0 if ($message->{'nagios_return_code'} != 0 and $message->{'nagios_return_code'} != 1 and $message->{'nagios_return_code'} != 2 and $message->{'nagios_return_code'} != 3)
43 0 0 if (scalar @{$nagios_commands;} > $max_messages)
55 0 0 unless scalar @$nagios_commands
56 0 0 if (my $command_file_err = _validate_command_file($self->{'state'}{'command_file'}))
71 0 0 unless my $np = 'Nagios::Passive'->create('command_file', $self->{'state'}{'command_file'}, 'service_description', $cmd->{'nagios_service_description'}, 'host_name', $cmd->{'nagios_host_name'}, 'check_name', $cmd->{'nagios_check_name'})
73 0 0 unless $np->return_code($cmd->{'nagios_return_code'})
75 0 0 unless $np->output($cmd->{'nagios_output'})
76 0 0 unless $np->submit
80 0 0 if ($@)
96 0 0 unless -e $command_file
98 0 0 unless -w $command_file
100 0 0 unless -p $command_file
105 0 0 if $@
119 0 0 unless open my $fh, '>>', $logfile
121 0 0 unless print $fh qq[${now}: "$cmd->{'nagios_service_description'}" "$cmd->{'nagios_host_name'}" $cmd->{'nagios_return_code'} "$cmd->{'nagios_check_name'}" "$cmd->{'nagios_output'}"\n]
123 0 0 unless close $fh
126 0 0 if ($@)
138 0 0 unless $self->{'state'}
140 0 0 unless $self->{'state'}{'nagios_commands'}
141 0 0 unless ($self->{'config'}{'command_file'})
145 0 0 if (my $command_file_err = _validate_command_file($self->{'config'}{'command_file'}))