use Spong::Info;
use POSIX;
+use Data::Dumper;
+
package Spong::Host;
# Constructor. This is a lazy constructor in that it doesn't get all it's
sub service_objects {
my( $self, $name ) = @_;
my $servicelist = $self->services();
- return $servicelist->services() if $servicelist;
+ if ( $servicelist ) { return $servicelist->services(); } else { return (); }
}
sub service_names {
my $self = shift;
my $servicelist = $self->services();
- return $servicelist->names() if $servicelist;
+ if ( $servicelist ) { return $servicelist->names(); } else { return (); }
}
sub color {
my( $self, $color ) = @_;
foreach( $self->service_objects() ) {
+ if (! defined $_) { next; }
if( $_->color() eq $color ) { return 1; } }
return 0;
my( $services, @problist, $probtime, $summary );
foreach $service ( $self->service_objects() ) {
+ if ( ! defined $service ) { next; }
if( $service->has_problem() ) {
push( @problist, $service->name() );
$summary = $service->summary();
my( $services, @problist, $probtime, $summary );
foreach $service ( $self->service_objects() ) {
+ if( ! defined $service ) { next; }
if( $service->has_problem() ) {
push( @problist, $service->name() );
$summary = $service->summary();