File: multi_type_entries.t

package info (click to toggle)
libnagios-object-perl 0.21.20-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,032 kB
  • sloc: perl: 3,198; makefile: 9
file content (35 lines) | stat: -r--r--r-- 793 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/perl

use strict;
use warnings;
use lib qw( ./lib ../lib );
use Test::More 'no_plan';
use Test::NoWarnings;
use Data::Dumper;

use Nagios::Object::Config;
use Nagios::Object;

eval { chdir('t'); };

my $cfile = 'multi_type_entries.cfg';
my $c = Nagios::Object::Config->new( Version => 2.5 );
ok( $c->parse($cfile), "Config parse() succeeded for '$cfile'" );
$c->resolve_objects;
$c->register_objects;

ok( my $service = $c->find_object('Current Load'),
    "Get a service object to work with"
);

ok( my $host = $c->find_object('anotherhost'), "Get a host to work with" );
my $host_multi = $host->parents;

#print Dumper($host_multi);

#use B::Deparse;
#my $dp = B::Deparse->new();
#print $dp->coderef2text( \&Nagios::Service::servicegroups );

my $list = $service->servicegroups;