|
Nagios::Config::Onject - Class for Nagios object configuration files |
Nagios::Config::Onject - Class for Nagios object configuration files
use Nagios::Config ;
my $nc = new Nagios::Config("/usr/local/nagios/etc/nagios.cfg") ;
my @object_files = $nc->get_object_files() ;
foreach (@object_files){
my @hosts = $_->get_objects('host') ;
foreach my $h (@hosts){
print $h->get_attr('host_name') . "\n" ;
}
}
Nagios::Config::ObjectFile is the class for all Nagios object
configuration files. You should not need to create these yourself.
Nagios::Config::ObjectFile.
TYPE that where found during the
parse.
Each of these objects will be blessed in the Nagios::Config::Object::TYPE
package, which inherits from Nagios::Config::Object.
Ex: my @hosts = $of->get_objects('host') ;
TYPE that where found during
the parse, using attribute KEY as the hash key. Make sure that the value
of KEY is unique for each object, or else you will not get all the objects
in the hash.
Each of these objects will be blessed in the Nagios::Config::Object::TYPE
package, which inherits from Nagios::Config::Object.
Ex: my %hosts = $of->get_object_hash('host', 'host_name') ;
TYPE that where found during
the parse, where ATTR ``matches'' QUERY. QUERY can be a regular expression
(i.e. qr/.../) or a scalar. If SPLIT is true, the values will be split
on /\s*,\s*/ and each of the resulting values will be compared separately.
Also, if the value of the ATTR is '*', the object is returned regardless
of the value of QUERY.
Each of these objects will be blessed in the Nagios::Config::Object::TYPE
package, which inherits from Nagios::Config::Object.
Ex: my %services = $of->get_object_hash('service', 'host_name', 'my_host', 1) ;
Patrick LeBoutillier, patl@cpan.org
Nagios::Config, Nagios::Config::Object, Nagios::Config::File
|
Nagios::Config::Onject - Class for Nagios object configuration files |