---
name: "Tirex::Munin"
section: "3pm"
platform: "linux"
package: "tirex"
version: "0.7.1-3+b2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Tirex::Munin"
---

# Tirex::Munin(3pm)

Parent class for Munin scripts

## 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).
