r52344 - in /branches/upstream/libnagios-object-perl/current: Build.PL ChangeLog MANIFEST META.yml lib/Nagios/Host.pm lib/Nagios/Object.pm lib/Nagios/Service.pm lib/Nagios/StatusLog.pm t/70status.dat t/70status.t

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Mon Feb 8 22:59:56 UTC 2010


Author: jawnsy-guest
Date: Mon Feb  8 22:59:51 2010
New Revision: 52344

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=52344
Log:
[svn-upgrade] Integrating new upstream version, libnagios-object-perl (0.21.9)

Removed:
    branches/upstream/libnagios-object-perl/current/lib/Nagios/Host.pm
    branches/upstream/libnagios-object-perl/current/lib/Nagios/Service.pm
Modified:
    branches/upstream/libnagios-object-perl/current/Build.PL
    branches/upstream/libnagios-object-perl/current/ChangeLog
    branches/upstream/libnagios-object-perl/current/MANIFEST
    branches/upstream/libnagios-object-perl/current/META.yml
    branches/upstream/libnagios-object-perl/current/lib/Nagios/Object.pm
    branches/upstream/libnagios-object-perl/current/lib/Nagios/StatusLog.pm
    branches/upstream/libnagios-object-perl/current/t/70status.dat
    branches/upstream/libnagios-object-perl/current/t/70status.t

Modified: branches/upstream/libnagios-object-perl/current/Build.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnagios-object-perl/current/Build.PL?rev=52344&op=diff
==============================================================================
--- branches/upstream/libnagios-object-perl/current/Build.PL (original)
+++ branches/upstream/libnagios-object-perl/current/Build.PL Mon Feb  8 22:59:51 2010
@@ -4,7 +4,7 @@
 
 my $build = Module::Build->new(
     dist_name      => 'Nagios-Object',
-    dist_version   => "0.21.8",
+    dist_version   => "0.21.9",
     dist_author    => 'Duncan Ferguson <duncs at cpan.org>',
     dist_abstract  => 'Nagios::Object - Nagios object configuration parsing.',
     license        => 'gpl',

Modified: branches/upstream/libnagios-object-perl/current/ChangeLog
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnagios-object-perl/current/ChangeLog?rev=52344&op=diff
==============================================================================
--- branches/upstream/libnagios-object-perl/current/ChangeLog (original)
+++ branches/upstream/libnagios-object-perl/current/ChangeLog Mon Feb  8 22:59:51 2010
@@ -105,3 +105,5 @@
        - Run 'perltidy -pbp' across all perl code
 0.21.8 - Apply speedup patch for v2 to v3 from PJNewman's patch (RT#47912)
        - Apply patch from Stephen Gran to add in more missing methods (RT#49411)
+0.21.9 - Fixed speedup patch using logic similar to Nagios' for parsing status.dat
+       - Added more comprehensive test for parsing status file

Modified: branches/upstream/libnagios-object-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnagios-object-perl/current/MANIFEST?rev=52344&op=diff
==============================================================================
--- branches/upstream/libnagios-object-perl/current/MANIFEST (original)
+++ branches/upstream/libnagios-object-perl/current/MANIFEST Mon Feb  8 22:59:51 2010
@@ -7,10 +7,8 @@
 ChangeLog
 lib/Nagios/Config.pm
 lib/Nagios/Config/File.pm
-lib/Nagios/Host.pm
 lib/Nagios/Object.pm
 lib/Nagios/Object/Config.pm
-lib/Nagios/Service.pm
 lib/Nagios/StatusLog.pm
 MANIFEST
 META.yml

Modified: branches/upstream/libnagios-object-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnagios-object-perl/current/META.yml?rev=52344&op=diff
==============================================================================
--- branches/upstream/libnagios-object-perl/current/META.yml (original)
+++ branches/upstream/libnagios-object-perl/current/META.yml Mon Feb  8 22:59:51 2010
@@ -1,6 +1,6 @@
 ---
 name: Nagios-Object
-version: 0.21.8
+version: 0.21.9
 author:
   - 'Duncan Ferguson <duncs at cpan.org>'
 abstract: 'Nagios::Object - Nagios object configuration parsing.'
@@ -24,8 +24,8 @@
     file: lib/Nagios/Config/File.pm
     version: 35
   Nagios::Host:
-    file: lib/Nagios/Host.pm
-    version: 0.21
+    file: lib/Nagios/Object.pm
+    version: 0
   Nagios::Host::Status:
     file: lib/Nagios/StatusLog.pm
     version: 0.1
@@ -45,8 +45,8 @@
     file: lib/Nagios/StatusLog.pm
     version: 0.1
   Nagios::Service:
-    file: lib/Nagios/Service.pm
-    version: 0.21
+    file: lib/Nagios/Object.pm
+    version: 0
   Nagios::Service::Status:
     file: lib/Nagios/StatusLog.pm
     version: 0.1
@@ -55,7 +55,7 @@
     version: 0
   Nagios::StatusLog:
     file: lib/Nagios/StatusLog.pm
-    version: 40
+    version: 41
 generated_by: Module::Build version 0.33
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html

Modified: branches/upstream/libnagios-object-perl/current/lib/Nagios/Object.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnagios-object-perl/current/lib/Nagios/Object.pm?rev=52344&op=diff
==============================================================================
--- branches/upstream/libnagios-object-perl/current/lib/Nagios/Object.pm (original)
+++ branches/upstream/libnagios-object-perl/current/lib/Nagios/Object.pm Mon Feb  8 22:59:51 2010
@@ -46,11 +46,7 @@
 sub NAGIOS_V3_ONLY    { 1 << 9 }    # not valid for nagios v1 or v2
 
 # export constants - the :all tag will export them all
-our %EXPORT_TAGS = (
-    all => [
-        qw(NAGIOS_NO_INHERIT NAGIOS_PERL_ONLY NAGIOS_V1 NAGIOS_V2 NAGIOS_V3 NAGIOS_V1_ONLY NAGIOS_V2_ONLY NAGIOS_V3_ONLY NAGIOS_NO_DISPLAY)
-    ]
-);
+our %EXPORT_TAGS = ( all => [ qw(NAGIOS_NO_INHERIT NAGIOS_PERL_ONLY NAGIOS_V1 NAGIOS_V2 NAGIOS_V3 NAGIOS_V1_ONLY NAGIOS_V2_ONLY NAGIOS_V3_ONLY NAGIOS_NO_DISPLAY) ] );
 Exporter::export_ok_tags('all');
 
 # we also export %nagios_setup only if it is asked for by name
@@ -71,7 +67,7 @@
     Service => {
         use                 => [ 'Nagios::Service', 10 ],
         service_description => [ 'STRING',          10 ],
-        display_name        => ['STRING',             280],
+        display_name        => [ 'STRING',          280 ],
         host_name      => [ ['Nagios::Host'],         10 ],
         servicegroups  => [ ['Nagios::ServiceGroup'], 280 ],
         hostgroup_name => [ ['Nagios::HostGroup'],    256 ],
@@ -294,8 +290,8 @@
         notification_interval => [ 'INTEGER',   280 ],
         name                  => [ 'host_name', 280 ],
         comment               => [ 'comment',   280 ],
-        escalation_options    => [[qw(d u r)],  280 ],
-        file                  => [ 'filename',  280 ]
+        escalation_options => [ [qw(d u r)], 280 ],
+        file => [ 'filename', 280 ]
     },
     HostDependency => {
         use                      => [ 'Nagios::HostDependency', 280 ],
@@ -464,13 +460,11 @@
 
     #print "type: $type, key: $nagios_setup_key\n";
 
-    confess
-        "invalid type '$type' for Nagios::Object - does not exist in \%nagios_setup"
+    confess "invalid type '$type' for Nagios::Object - does not exist in \%nagios_setup"
         if ( !exists $nagios_setup{$nagios_setup_key} );
 
     # set everything to undef by default
-    my %default
-        = map { $_ => undef } keys %{ $nagios_setup{$nagios_setup_key} };
+    my %default = map { $_ => undef } keys %{ $nagios_setup{$nagios_setup_key} };
 
     # if pre_link is set, don't set objects' resolved/registered flag
     if ($pre_link) {
@@ -497,8 +491,7 @@
             # timeranges must be parsed into ARRAYs, so parse it here so that
             # users don't have to figure out the arrays and so we don't have
             # to export parse_time_range
-            if ( $nagios_setup{$nagios_setup_key}->{$key}[0] eq 'TIMERANGE' )
-            {
+            if ( $nagios_setup{$nagios_setup_key}->{$key}[0] eq 'TIMERANGE' ) {
                 $args{$key} = parse_time_range( $args{$key} );
             }
             $default{$key} = $args{$key};
@@ -633,8 +626,7 @@
             return $self->{_use};
         }
         else {
-            confess
-                "Unable to walk object heirarchy without object configuration.";
+            confess "Unable to walk object heirarchy without object configuration.";
         }
     }
 }
@@ -662,9 +654,7 @@
 
     if ( $name_method eq 'generated' ) {
         $_name_hack++;
-        return
-            ref($self) . '-'
-            . $_name_hack;    # FIXME: this should work but feels wrong
+        return ref($self) . '-' . $_name_hack;    # FIXME: this should work but feels wrong
     }
 
     if ( !$self->register ) {
@@ -846,7 +836,7 @@
 
     if ( !$pre_link && !$fast_mode && exists $vf->{$key} ) {
 
-       # validate passed in arugments against arrayref in $vf (\%valid_fields)
+        # validate passed in arugments against arrayref in $vf (\%valid_fields)
         $self->_validate( $key, $value, @{ $vf->{$key} } );
     }
 
@@ -885,9 +875,7 @@
             # process single values as an arrayref anyways for consistency
             if ( ref($value) ne 'ARRAY' ) { $value = [$value] }
             foreach my $val (@$value) {
-                croak "object isa '"
-                    . ref($val)
-                    . "' when it should be a '$type'"
+                croak "object isa '" . ref($val) . "' when it should be a '$type'"
                     if ( ref($val) ne $type->[0] );
             }
         }
@@ -963,8 +951,7 @@
         return $self->set_hostgroup( [ @existing, shift ] );
     }
     else {
-        confess
-            "Called set_hostgroup() on an object that doesn't support it.";
+        confess "Called set_hostgroup() on an object that doesn't support it.";
     }
 }
 
@@ -1023,7 +1010,7 @@
             # name() is a special case and is implemented by hand
             next if ( $method eq 'name' );
 
-        # the members() method in ServiceGroup is implemented manually (below)
+            # the members() method in ServiceGroup is implemented manually (below)
             next
                 if ( $pkg eq 'Nagios::ServiceGroup' && $method eq 'members' );
 
@@ -1078,8 +1065,7 @@
         $pkg->_make_method($setup_field);
     }
     else {
-        confess
-            "Invalid method call.   $pkg does not know about method $method.";
+        confess "Invalid method call.   $pkg does not know about method $method.";
     }
 
     goto \&{$AUTOLOAD};
@@ -1088,6 +1074,8 @@
 # ---------------------------------------------------------------------------- #
 # ---------------------------------------------------------------------------- #
 # special-case methods coded straight into their packages
+
+1;
 
 package Nagios::Host;
 our $VERSION = $Nagios::Object::VERSION;
@@ -1096,12 +1084,16 @@
 sub hostgroups     { shift->hostgroup(@_); }
 sub set_hostgroups { shift->set_hostgroup(@_); }
 
+1;
+
 package Nagios::HostGroup;
 our $VERSION = $Nagios::Object::VERSION;
 
 # aliases
 sub hostgroup     { shift->hostgroup_name(@_); }
 sub set_hostgroup { shift->set_hostgroup_name(@_); }
+
+1;
 
 package Nagios::ServiceGroup;
 use Carp;
@@ -1127,8 +1119,7 @@
     # has resolved yet
     if ( $self->resolved ) {
         foreach my $item (@_) {
-            confess
-                "set_members() arguments must be objects after resolve_objects() has been called."
+            confess "set_members() arguments must be objects after resolve_objects() has been called."
                 unless ( ref($item) );
             push @members, $item;
         }
@@ -1165,6 +1156,8 @@
     return @out;
 }
 
+1;
+
 package Nagios::Service;
 our $VERSION = $Nagios::Object::VERSION;
 

Modified: branches/upstream/libnagios-object-perl/current/lib/Nagios/StatusLog.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnagios-object-perl/current/lib/Nagios/StatusLog.pm?rev=52344&op=diff
==============================================================================
--- branches/upstream/libnagios-object-perl/current/lib/Nagios/StatusLog.pm (original)
+++ branches/upstream/libnagios-object-perl/current/lib/Nagios/StatusLog.pm Mon Feb  8 22:59:51 2010
@@ -25,7 +25,7 @@
 
 # NOTE: due to CPAN version checks this cannot currently be changed to a
 # standard version string, i.e. '0.21'
-our $VERSION = '40';
+our $VERSION = '41';
 
 # this is going to be rewritten to use AUTOLOAD + method caching in a future version
 BEGIN {
@@ -457,32 +457,29 @@
     open( $log_fh, "<$self->{LOGFILE}" )
         || croak "could not open file $self->{LOGFILE} for reading: $!";
 
-# change the first line of the RE to this:
-# (info|programstatus|hoststatus|servicestatus|contactstatus|servicecomment|hostcomment|servicedowntime|hostdowntime) \s* {(
-# to make it a bit more careful, but it has a measurable cost on runtime
-    my $entry_re = qr/
-        # capture the type into $1
-        (\w+) \s*
-        # capture all of the text between the brackets into $2
-        {( .*? )}
-        # match the last bracket only if followed by another definition
-        (?=(?: \s* (?:info|programstatus|hoststatus|servicestatus|contacstatus|servicecomment|hostcomment|servicedowntime|hostdowntime) \s* { | \Z) )
-        # capture remaining text (1-2 lines) into $3 for re-processing
-        (.*)$
-    /xs;
-
-    my @lines = <$log_fh>;
-    my $file  = "@lines";
-
-#Drop comments if we don't need them as it should speed things up a little bit.
-#Comment out the line below if you do want to keep comments
-    $file =~ s/#.*\n//mg;
-    $file =~ s/[\r\n]+\s*/\n/g;    # clean up whitespace and newlines
-
-    while ( $file =~ /$entry_re/g ) {
-        ( my $type, my $text ) = ( $1, $2 );
-        my %item = map { split /\s*=\s*/, $_, 2 } split /\n/, $text;
-        $handlers{$type}->( \%item );
+    my %valid_types = map { ( $_ => 1 ) } qw(info programstatus hoststatus servicestatus contactstatus servicecomment hostcomment servicedowntime hostdowntime);
+    my $entry = '';
+    my %attributes;
+    my $type = 0;
+    while ( my $line = <$log_fh> ) {
+        next if ( $line =~ /^\s*#|^\s*$/ );
+        if ( $line =~ /^\s*(\w+)\s*{\s*$/ ) {
+            %attributes = ();
+            if (exists $valid_types{$1}) {
+                $type = $1;
+            } else {
+                $type = 0;
+            }
+        }
+        if ( $line =~ /^\s*}\s*$/ ) {
+            # Only save the object if it is a valid type
+            if ($type) {
+                $handlers{$type}->( \%attributes );
+            }
+        }
+        if ( $line =~ /\s*(\w+)=(.*)$/ ) {
+            $attributes{$1} = $2;
+        }
     }
 
     close($log_fh);

Modified: branches/upstream/libnagios-object-perl/current/t/70status.dat
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnagios-object-perl/current/t/70status.dat?rev=52344&op=diff
==============================================================================
--- branches/upstream/libnagios-object-perl/current/t/70status.dat (original)
+++ branches/upstream/libnagios-object-perl/current/t/70status.dat Mon Feb  8 22:59:51 2010
@@ -74,7 +74,7 @@
 	current_event_id=31
 	current_problem_id=18
 	last_problem_id=0
-	plugin_output=CRITICAL - 192.168.50.10: rta nan, lost 100%
+	plugin_output=CRITICAL - 192.168.50.10: rta nan, lost 100% with {}
 	long_plugin_output=
 	performance_data=rta=0.000ms;500.000;1000.000;0; pl=100%;80;100;;
 	last_check=1233216743
@@ -144,7 +144,7 @@
 	last_time_unknown=0
 	last_time_critical=1233914007
 	plugin_output=CRITICAL - 192.168.50.10: rta nan, lost 100%
-	long_plugin_output=
+	long_plugin_output=IOS (tm) 7200 Software (C7200-P-M), Version 12.2(14)S5, EARLY DEPLOYMENT RELEASE SOFTWARE (fc2)
\nTAC Support: http://www.cisco.com/tac
\nCopyright (c) 1986-2003 by cisco Systems, Inc.
\nCompiled Fri 26-Sep-03 1\n
 	performance_data=rta=0.000ms;100.000;500.000;0; pl=100%;20;60;;
 	last_check=1233914007
 	next_check=1233914307
@@ -183,3 +183,16 @@
 	service_notifications_enabled=1
 	}
 
+contactstatus {
+	contact_name=admin2
+	modified_attributes=0
+	modified_host_attributes=0
+	modified_service_attributes=0
+	host_notification_period=24x7
+	service_notification_period=24x7
+	last_host_notification=1
+	last_service_notification=0
+	host_notifications_enabled=1
+	service_notifications_enabled=1
+	}
+

Modified: branches/upstream/libnagios-object-perl/current/t/70status.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnagios-object-perl/current/t/70status.t?rev=52344&op=diff
==============================================================================
--- branches/upstream/libnagios-object-perl/current/t/70status.t (original)
+++ branches/upstream/libnagios-object-perl/current/t/70status.t Mon Feb  8 22:59:51 2010
@@ -1,14 +1,12 @@
 #!/usr/bin/perl
 use strict;
 use warnings;
-use Test::More tests => 2;
+use Test::More tests => 8;
 use Test::NoWarnings;
 use Test::Exception;
 
 use lib qw( ../lib ./lib );
 use Nagios::StatusLog;
-
-my $host = 'localhost';
 
 ( my $filename = $0 ) =~ s/t$/dat/;
 
@@ -18,3 +16,158 @@
 );
 
 isa_ok( $log, 'Nagios::StatusLog' );
+
+my $admin_contact = $log->contact("admin");
+isa_ok( $admin_contact, "Nagios::Contact::Status" );
+is_deeply( $admin_contact, {
+    contact_name => "admin",
+    host_notification_period => "24x7",
+    host_notifications_enabled => 1,
+    last_host_notification => 0,
+    last_service_notification => 0,
+    modified_attributes => 0,
+    modified_host_attributes => 0,
+    modified_service_attributes => 0,
+    service_notification_period => "24x7",
+    service_notifications_enabled => 1,
+    }, "Attributes for admin right" );
+
+my $admin2 = $log->contact("admin2");
+isa_ok( $admin2, "Nagios::Contact::Status");
+is_deeply( $admin2, {
+    contact_name => "admin2",
+    host_notification_period => "24x7",
+    host_notifications_enabled => 1,
+    last_host_notification => 1,
+    last_service_notification => 0,
+    modified_attributes => 0,
+    modified_host_attributes => 0,
+    modified_service_attributes => 0,
+    service_notification_period => "24x7",
+    service_notifications_enabled => 1,
+    }, "Attributes for admin right" );
+
+
+my $host = $log->host("doesnt_exist_1");
+my $hostattrs = attributes_hash($host);
+is_deeply( $hostattrs, { 
+         'acknowledgement_type' => 0,
+         'active_checks_enabled' => 1,
+         'check_command' => 'check_host_15!-H $HOSTADDRESS$ -t 3 -w 500.0,80% -c 1000.0,100%',
+         'check_execution_time' => 3.186,
+         'check_interval' => "0.000000",
+         'check_latency' => 0.067,
+         'check_options' => 0,
+         'check_period' => '',
+         'check_type' => 0,
+         'current_attempt' => 1,
+         'current_event_id' => 31,
+         'current_notification_id' => 553,
+         'current_notification_number' => 46,
+         'current_problem_id' => 18,
+         'current_state' => 2,
+         'event_handler' => '',
+         'event_handler_enabled' => 0,
+         'failure_prediction_enabled' => 1,
+         'flap_detection_enabled' => 1,
+         'has_been_checked' => 1,
+         'host_name' => 'doesnt_exist_1',
+         'is_flapping' => 0,
+         'last_check' => 1233216743,
+         'last_event_id' => 24,
+         'last_hard_state' => 2,
+         'last_hard_state_change' => 1233216701,
+         'last_notification' => 1233911011,
+         'last_problem_id' => 0,
+         'last_state_change' => 1233216701,
+         'last_time_down' => 1231947569,
+         'last_time_unreachable' => 1231947633,
+         'last_time_up' => 1231947413,
+         'last_update' => 1233914050,
+         'long_plugin_output' => '',
+         'max_attempts' => 2,
+         'modified_attributes' => 1,
+         'next_check' => 0,
+         'next_notification' => 1233914611,
+         'no_more_notifications' => 0,
+         'notification_period' => '24x7',
+         'notifications_enabled' => 1,
+         'obsess_over_host' => 0,
+         'passive_checks_enabled' => 1,
+         'percent_state_change' => "0.00",
+         'performance_data' => 'rta=0.000ms;500.000;1000.000;0; pl=100%;80;100;;',
+         'plugin_output' => 'CRITICAL - 192.168.50.10: rta nan, lost 100% with {}',
+         'problem_has_been_acknowledged' => 0,
+         'process_performance_data' => 1,
+         'retry_interval' => "1.000000",
+         'scheduled_downtime_depth' => 0,
+         'should_be_scheduled' => 0,
+         'state_type' => 1,
+ }, "Host attributes correct" );
+
+
+my $service = $log->service( "doesnt_exist_1", "TCP/IP" );
+my $serviceattrs = attributes_hash( $service );
+is_deeply( $serviceattrs, {
+               'acknowledgement_type' => 0,
+            'active_checks_enabled' => 1,
+            'check_command' => 'check_icmp!-H $HOSTADDRESS$ -w 100.0,20% -c 500.0,60%',
+            'check_execution_time' => 3.677,
+            'check_interval' => "5.000000",
+            'check_latency' => 0.218,
+            'check_options' => 0,
+            'check_period' => '24x7',
+            'check_type' => 0,
+            'current_attempt' => 1,
+            'current_event_id' => 23,
+            'current_notification_id' => 0,
+            'current_notification_number' => 0,
+            'current_problem_id' => 17,
+            'current_state' => 2,
+            'event_handler' => '',
+            'event_handler_enabled' => 1,
+            'failure_prediction_enabled' => 1,
+            'flap_detection_enabled' => 1,
+            'has_been_checked' => 1,
+            'host_name' => 'doesnt_exist_1',
+            'is_flapping' => 0,
+            'last_check' => 1233914007,
+            'last_event_id' => 0,
+            'last_hard_state' => 2,
+            'last_hard_state_change' => 1233216735,
+            'last_notification' => 0,
+            'last_problem_id' => 0,
+            'last_state_change' => 1233216735,
+            'last_time_critical' => 1233914007,
+            'last_time_ok' => 1231947411,
+            'last_time_unknown' => 0,
+            'last_time_warning' => 0,
+            'last_update' => 1233914050,
+            'long_plugin_output' => 'IOS (tm) 7200 Software (C7200-P-M), Version 12.2(14)S5, EARLY DEPLOYMENT RELEASE SOFTWARE (fc2)
\nTAC Support: http://www.cisco.com/tac
\nCopyright (c) 1986-2003 by cisco Systems, Inc.
\nCompiled Fri 26-Sep-03 1\n',
+            'max_attempts' => 3,
+            'modified_attributes' => 1,
+            'next_check' => 1233914307,
+            'next_notification' => 0,
+            'no_more_notifications' => 0,
+            'notification_period' => '24x7',
+            'notifications_enabled' => 1,
+            'obsess_over_service' => 0,
+            'passive_checks_enabled' => 1,
+            'percent_state_change' => "0.00",
+            'performance_data' => 'rta=0.000ms;100.000;500.000;0; pl=100%;20;60;;',
+            'plugin_output' => 'CRITICAL - 192.168.50.10: rta nan, lost 100%',
+            'problem_has_been_acknowledged' => 0,
+            'process_performance_data' => 1,
+            'retry_interval' => "1.000000",
+            'scheduled_downtime_depth' => 0,
+            'service_description' => 'TCP/IP',
+            'should_be_scheduled' => 1,
+            'state_type' => 1,
+}, "service attributes okay" );
+
+sub attributes_hash {
+    my $host = shift;
+    my %attrs = %$host;
+    delete $attrs{__parent};
+    \%attrs;
+}




More information about the Pkg-perl-cvs-commits mailing list