Scroll to navigation

Tirex::Munin(3pm) User Contributed Perl Documentation Tirex::Munin(3pm)

NAME

Tirex::Munin - Parent class for Munin scripts

SYNOPSIS

 my $m = Tirex::Munin::SomeSubclass->new(...)
 if ($ARGV[0] eq 'config') {
     print $m->config();
 } else {
     $m->init(...) or die;
     print $m->fetch();
 }

DESCRIPTION

Parent class for Munin scripts. This class is never instantiated, create subclasses instead.

METHODS

Tirex::Munin::SomeSubclass->new( map => [ 'map1', 'map2' ], z => [$zr1, $zr2] )

Create new munin object.

$m->do(...)

Do the right Munin action depending on command line.

All command line args are passed to init_data().

$m->init()

Initialize config source.

This method is called from new(), in the Tirex::Munin class it does nothing, but can be overwritten in subclasses.

$m->config()

Return config in Munin format.

This method must be overwritten in subclasses.

$m->init_data()

Initialize data source.

This method must be called before fetch(), in the Tirex::Munin class it does nothing, but can be overwritten in subclasses.

$m->fetch()

Return data in Munin format.

This method must be overwritten in subclasses.

Tirex::Munin::make_id($name)

Create Id from name by changing all characters except A-Z, a-z, and 0-9 to a _ (underscore).

2024-05-06 perl v5.38.2