Munin:...:Utils(3pm)

πŸ’– Munin::Master::Utils(3pm) β€” or, the User Contributed Perl Documentation era of Munin:...:Utils(3pm) πŸŽ€

okay bestie, buckle up β€” this is Munin::Master::Utils, and she is literally the utility drawer of the Munin master. The NAME line says it plain: Exports a lot of utility functions. That's it. That's the whole pitch. And honestly? Iconic. No notes. πŸ’…


✨ SYNOPSIS ✨

Like every good Perl module she slides in with one line, no drama:

use Munin::Master::Utils;

and suddenly you have access to the entire drawer of functions. slay. 🫢


🌸 SUBROUTINES 🌸

okay so here's the whole crew, one by one. I'm not skipping a single one β€” not even the mysterious silent ones. nobody gets left behind at this party. πŸ’œ


πŸ”₯ munin_category_status

Gets the current status of a category. simple as that, bestie.

Parameters:

  • $hash β€” a ref to the hash node whose children we're checking πŸ‘€
  • $limits β€” a ref to the root node of the limits tree
  • $category β€” the category to review
  • $check_draw β€” [optional] ignore undrawn fields

Returns:

  • Success: the status of the field ✨
  • Failure: undef πŸ’€

πŸ¦‹ munin_readconfig_base

Reads the configuration file, includes the dir files, and initializes the important default values that are optional. she's the setup queen fr fr.

Parameters:

  • $file β€” the munin.conf filename. If you omit it, the default filename gets used. (she'll pick for you, she has taste πŸ’…)

Returns:

  • Success: the $config hash (also cached in the module 🧚)

πŸŽ€ munin_copy_node

Copy hash node. short and sweet.

Parameters:

  • $from β€” hash node to copy
  • $to β€” where to copy it to

Returns:

  • Success: $to
  • Failure: undef 😭

⭐ munin_copy_node_toloc

Copy hash node at. (yes, "at" β€” that's what she says, don't @ me)

Parameters:

  • $from β€” hash node to copy
  • $to β€” where to copy it to
  • $loc β€” path to node under $to

Returns:

  • Success: $to
  • Failure: undef

πŸ™ˆ munin_createlock

no description on this one, bestie β€” she's mysterious. lowkey main character energy: shows up in the list, says nothing, leaves. πŸ’€


🌈 munin_delete

also no description. she's giving silent-but-deadly. just know she deletes. the name ate. periodt.


πŸ“ munin_draw_field

Checks whether a field will actually be visible in the graph or not. the vibe check for your fields, basically ✨

Parameters:

  • $hash β€” a ref to the hash node for the field

Returns:

  • Success: Boolean; true if the field will be graphed, false if not
  • Failure: undef

πŸ’œ munin_field_status

Gets the current status of a field.

Parameters:

  • $hash β€” a ref to the field hash node
  • $limits β€” a ref to the root node of the limits tree
  • $check_draw β€” [optional] ignore undrawn fields

Returns:

  • Success: the status of the field
  • Failure: undef

πŸ” munin_find_field

Searches a hash to find hash nodes with $field defined. detective mode activated πŸ•΅οΈβ€β™€οΈ

Parameters:

  • $hash β€” a hash ref to search
  • $field β€” the name of the field to search for, or a regex πŸ‘‘
  • $avoid β€” [optional] stop traversing further down if this field is found

Returns:

  • Success: a ref to an array of the hash nodes containing $field
  • Failure: undef

🌸 munin_get

Get variable. the simplest little getter in the world.

Parameters:

  • $hash β€” ref to hash node
  • $field β€” name of field to get
  • $default β€” [optional] value to return if $field isn't set

Returns:

  • Success: field contents
  • Failure: $default if defined, else undef

🫢 munin_get_bool

Get boolean variable. she's munin_get's more decisive sister.

Parameters:

  • $hash β€” ref to hash node
  • $field β€” name of field to get
  • $default β€” [optional] value to return if $field isn't set

Returns:

  • Success: 1 or 0 (true or false) βœ…βŒ
  • Failure: $default if defined, else undef

🧚 munin_get_bool_val

no description, no parameters listed, no returns listed. she simply is. the mystery of it all πŸ’…


πŸ‘‘ munin_get_children

Get all child hash nodes. family reunion time.

Parameters:

  • $hash β€” a hash ref to the parent node

Returns:

  • Success: a ref to an array of the child nodes
  • Failure: undef

πŸŽ€ munin_get_field_order

Get the field order in a graph. somebody has to decide who goes first, and it's her.

Parameters:

  • $hash β€” a hash ref to the service

Returns:

  • Success: a ref to an array of the field names
  • Failure: undef

πŸ’– munin_get_filename

Get the rrd filename for a field, without any bells or whistles. Used by munin-update to figure out which file to update. she's the no-frills one, the "we have food at home" of filename getters 😌

Parameters:

  • $hash β€” ref to hash field

Returns:

  • Success: full path to rrd file
  • Failure: undef

🌷 munin_get_html_filename

Get the full path-name of an html file.

Parameters:

  • $hash β€” a ref to the service hash node

Returns:

  • Success: the file name with full path
  • Failure: undef

✨ munin_get_max_label_length

Get the length of the longest label in a graph. she's measuring, she's comparing, she's judging (lovingly).

Parameters:

  • $hash β€” the graph in question
  • $order β€” a ref to an array of fields (graph_order)

Returns:

  • Success: the length of the longest label in the graph
  • Failure: undef

πŸ¦‹ munin_get_node

Gets a node by loc.

Parameters:

  • $hash β€” a ref to the hash to set the variable in
  • $loc β€” a ref to an array with the full path of the node

Returns:

  • Success: the node ref found by $loc
  • Failure: undef

🌈 munin_get_node_loc

Get the location array for a hash node. the receipts of where this node lives.

Parameters:

  • $hash β€” a ref to the node

Returns:

  • Success: ref to an array with the full path of the variable
  • Failure: undef

πŸ“ munin_get_node_name

Returns the name of the hash node you hand her. just the name. that's the whole job.

Parameters:

  • $hash β€” a ref to the hash node

Returns:

  • Success: the name of the node

πŸ’œ munin_get_node_partialpath

Gets a node from a partial path β€” the relative-address queen πŸ‘‘

Parameters:

  • $hash β€” a ref to the "current" location in the hash tree
  • $var β€” a path string with relative location (from the $hash)

Returns:

  • Success: the node
  • Failure: undef

🫢 munin_get_parent

Get the parent node of a hash. go up one level, say hi to mom.

Parameters:

  • $hash β€” a ref to the node

Returns:

  • Success: ref to an parent (yes, "an parent" β€” we love her, we keep her words πŸ₯Ή)
  • Failure: undef

🧚 munin_get_parent_name

Returns the name of the parent of the hash node supplied.

Parameters:

  • $hash β€” a ref to the hash node

Returns:

  • Success: the name of the parent node
  • Failure: if no parent node exists, the string "none" is returned. she's polite about it πŸ’…

πŸŽ€ munin_get_picture_filename

Get the full path + name of a picture file. graph pics, for the grid.

Parameters:

  • $hash β€” a ref to the service hash node
  • $scale β€” [optional] the scale (day, week, year, month)
  • $sum β€” [optional] Boolean value, whether it's a sum graph or not

Returns:

  • Success: the file name with full path
  • Failure: undef

⭐ munin_get_picture_loc

Get the location array for a hash node, for picture purposes. And here's the tea: it differs from munin_get_node_loc in that it honors #%#origin metadata πŸ‘€βœ¨

Parameters:

  • $hash β€” a ref to the node

Returns:

  • Success: ref to an array with the full path of the variable
  • Failure: undef

πŸ‘‘ munin_get_root_node

Get the root node of the hash tree. go all the way up. touch grass. 🌱

Parameters:

  • $hash β€” a hash node to traverse up from

Returns:

  • Success: a ref to the root hash node
  • Failure: undef

πŸ”₯ munin_get_rrd_filename

Get the name of the rrd file corresponding to a field. Checks for lots of bells and whistles. This is the correct one to use when you're figuring out where to fetch data from β€” she said what she said, bestie. use this one. πŸ’…

Parameters:

  • $field β€” the hash object of the field
  • $path β€” [optional] the path to the field (as given in graph_order/sum/stack/et al)

Returns:

  • Success: a string with the filename of the rrd file
  • Failure: undef

🌸 munin_get_separated_node

Copy a node to a separate node without "specials". the stripped-down, de-influenced version of your node πŸ§–β€β™€οΈ

Parameters:

  • $hash β€” the node to copy

Returns:

  • Success: a ref to a new node without "#%#"-fields
  • Failure: undef

πŸ™ˆ munin_get_var_path

no description given. she's a vibe, not a documentation page. moving on πŸ’€


πŸŽ€ munin_getlock

also undocumented in this page. the lock-getting sister of munin_createlock. mysterious. powerful. silent. 🫢


πŸ¦‹ munin_graph_column_headers

no description. she handles column headers. that's all we're told and honestly that's enough. ✨


πŸ’– munin_has_subservices

okay this one actually has a little example, look at her go:

munin_has_subservices($hash);

Checks whether the service represented by $hash has subservices (multigraph), and returns the result. very "are you a mom or not" energy.

Parameters:

  • $hash β€” hash reference pointing to a service

Returns:

  • true β€” if the hash is indeed a service, and said service has got subservices πŸ‘‘
  • false β€” otherwise

πŸ“ munin_mkdir_p

another one with a tiny example, we love a demo:

munin_mkdir_p('/a/path/', oct('777'));

Make a directory β€” and recursively any nonexistent directory in the path to it. she builds the whole road, not just the destination. πŸ›£οΈβœ¨


πŸ’œ munin_node_status

no description in the source. she's a status function for nodes and she's keeping it to herself. respect the privacy. πŸ™ˆ


🌈 munin_nscasend

no description. nsca sending, by the name of her. that's all we get, bestie. 🫢


⭐ munin_overwrite

Take the contents of one config-namespace and replace/insert the instances needed. she's not here to negotiate, she's here to overwrite. πŸ’…


πŸŽ€ munin_parse_config

no description. she parses config. the name is the documentation. iykyk. ✨


πŸ” munin_path_to_loc

Returns a loc array from a path string. the reverse of what you'd expect and somehow exactly what you needed.

Parameters:

  • $path β€” a path string

Returns:

  • Success: a ref to an array with the loc
  • Failure: undef

🧚 munin_readconfig_part

Read a partial configuration. she does not need the whole thing, she just needs a part. queen of moderation. 🍡

Parameters:

  • $what β€” name of the part that should be loaded (datafile or limits)

Returns:

  • Success: a $config with the $specified part, but overwritten by $config

🫢 munin_removelock

no description. she removes the lock. the yin to munin_createlock's yang. πŸ’€βœ¨


🌸 munin_runlock

no description. yes, "runlock". yes, we're all thinking it. no, we're not going to say it. (okay maybe we are: she's the run-lock one.) πŸƒβ€β™€οΈπŸ”“


πŸ’œ munin_service_status

Gets the current status of a service.

Parameters:

  • $hash β€” a ref to the field hash node
  • $limits β€” a ref to the root node of the limits tree
  • $check_draw β€” [optional] ignore undrawn fields

Returns:

  • Success: the status of the field
  • Failure: undef

πŸ‘‘ munin_set

Sets a variable in a hash. the setter to munin_get's getter. they're a matching set, your honor. πŸ’…

Parameters:

  • $hash β€” a ref to the hash to set the variable in
  • $var β€” the name of the variable
  • $val β€” the value to set the variable to

Returns:

  • Success: the $hash we were handed (she gives it right back 🫢)
  • Failure: undef

πŸŽ€ munin_set_var_loc

Sets a variable in a hash β€” but, like, by location. same energy, more coordinates.

Parameters:

  • $hash β€” a ref to the hash to set the variable in
  • $loc β€” a ref to an array with the full path of the variable
  • $val β€” the value to set the variable to

Returns:

  • Success: the $hash we were handed
  • Failure: undef

πŸ¦‹ munin_set_var_path

Sets a variable in a hash β€” this time with a full path string. she's the third sister and honestly the most dramatic one. 😭

Parameters:

  • $hash β€” a ref to the hash to set the variable in
  • $var β€” a string with the full path of the variable
  • $val β€” the value to set the variable to

Returns:

  • Success: the $hash we were handed
  • Failure: the $hash we were handed β€” yes bestie, on failure she still hands you back the hash. read it again. that's what it says. we report, we don't explain. πŸ’€βœ¨

πŸ“ munin_writeconfig

no description listed. she writes config. the name is doing a lot of heavy lifting and honestly it's slaying. πŸ’…


🌈 munin_writeconfig_loop

no description either. she's the loop version of munin_writeconfig. they're a duo. a little config-writing duo. 🫢

πŸŽ€ COPYING πŸŽ€

Okay bestie, legal time, but make it cute. πŸ’…

Copyright (C) 2003-2007 Jimmy Olsen, Audun Ytterdal

These two iconic kings wrote this and we stan. πŸ‘‘

Now the actual license stuff, no cap:

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 dated June, 1991.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Like, it might be great, it might be a whole mess, and nobody's promising anything 😭. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Fr fr, if you're missing it, go ask them, they have spares πŸ’Œ.


And that's the whole page, bestie! πŸ¦‹ This one's from perl v5.42.0, dated 2026-09-14, and the page itself is Munin:...:Utils(3pm). Go forth and read your logs, you gorgeous main character πŸŒΈβœ¨πŸ’–

πŸ“¦ where this page comes from