The code in the SYNOPSIS section of the manual page causes an error when
the dump() method gets called on the object:
Can't locate object method "name" via package "d" (perhaps you forgot to
load "d"?) at ...5.8.5/Nagios/Object.pm line 520.
Looks like instead of
notification_options => [qw(d u r)],
you need
notification_options => "d,u,r",
to work around the error. Here's the code to reproduce the problem:
use Nagios::Object;
my $some_command = "foo";
my $timeperiod = 5;
my $generic_host = Nagios::Host->new(
register => 0,
parents => undef,
check_command => $some_command,
max_check_attempts => 3,
checks_enabled => 1,
event_handler => $some_command,
event_handler_enabled => 0,
low_flap_threshold => 0,
high_flap_threshold => 0,
flap_detection_enabled => 0,
process_perf_data => 1,
retain_status_information => 1,
retain_nonstatus_information => 1,
notification_interval => $timeperiod,
notification_options => [qw(d u r)],
notifications_enabled => 1,
stalking_options => [qw(o d u)]
);
$generic_host->dump();