The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Nagios::Config::Object - Base class for Nagios configuration objects

SYNOPSIS

  use Nagios::Config ;
  my $nc = new Nagios::Config("/usr/local/nagios/etc/nagios.cfg") ;
  foreach my $object ($nc->get_objects('host')){
    print $object->get('host_name') . "\n" ;
  }

DESCRIPTION

Nagios::Config::Object is the base class for all Nagios configuration objects. You should not need to create these yourself.

CONSTRUCTOR

new ([FILE])

Creates a Nagios::Config::Object.

METHODS

get_attr ([NAME], [SPLIT])

Returns the value of the attribute NAME for the current object. If SPLIT is true, returns a list of all the values split on /\s*,\s*/. This is useful for attributes that can have more that one value.

Ex: my $value = $host_obj->get_attr('notification_period') ;

Ex: my @values = $service_obj->get_attr('host_name', 1) ;

AUTHOR

Patrick LeBoutillier, patl@cpan.org

SEE ALSO

Nagios::Config, Nagios::Config::File, Nagios::Config::ObjectFile