Munin::...::Utils(3)

πŸ“¦ version 2.0.78, in nixos 26.05, nixpkgs unstable

okay so this is part 1 of Munin::...::Utils(3) πŸ’… β€” the User Contributed Perl Documentation page β€” and the module is Munin::Master::Utils. It's literally a utility-function buffet, and we're going through every single one, no cap ✨

πŸŽ€ NAME πŸŽ€

Munin::Master::Utils - Exports a lot of utility functions.

✨ SYNOPSIS ✨

use Munin::Master::Utils;

πŸ’… SUBROUTINES πŸ’…

okay bestie, here's the whole lineup. Every single one is getting its moment, and every detail stays put β€” facts don't change, only the vibe πŸ’–

🌸 munin_category_status 🌸

okay so this one gets the current status of a category. Status-check energy, honestly ✨

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 dir files, and initializes important default values that are optional. very main-character config behavior 🫢

Parameters:

  • $file β€” munin.conf filename. If omitted, default filename is used.

Returns:

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

πŸŽ€ munin_copy_node πŸŽ€

Copy a hash node. Literally copy-paste but make it data structures πŸ’…

Parameters:

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

Returns:

  • Success: $to
  • Failure: undef

🌈 munin_copy_node_toloc 🌈

Copy a hash node to a specific location. location-aware copy moment ✨

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 in the original β€” just the name, bestie 🫢)

πŸ“ munin_delete πŸ“

(no description in the original β€” just the name, bestie πŸ“)

✨ munin_draw_field ✨

Checks whether a field will be visible in the graph or not. visibility check, iconic πŸ¦‹

Parameters:

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

Returns:

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

πŸ”₯ munin_field_status πŸ”₯

Gets the current status of a field. field status supremacy πŸ’…

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. search-and-rescue but for hash nodes πŸ”Ž

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 classic getter, no notes ✨

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. true/false bestie behavior πŸ’–

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 in the original β€” just the name, bestie 🌸)

πŸŽ€ munin_get_children πŸŽ€

Get all child hash nodes. collecting the children, not in a creepy way 🫢

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. order matters, always πŸ’…

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 rrd filename for a field, without any bells or whistles. Used by munin-update to figure out which file to update. no extra sparkle, just the filename ✨

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. html-path realness 🌈

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. longest-label competition, but make it data πŸ’…

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. node retrieval moment πŸ¦‹

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 location array for hash node. path-finding but for hash nodes ✨

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 πŸ¦‹

Return the name of the hash node supplied. name reveal πŸ’–

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. partial-path icon behavior 🫢

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 parent node of a hash. parental hash energy πŸ’…

Parameters:

  • $hash β€” a ref to the node

Returns:

  • Success: ref to a parent
  • Failure: undef

πŸ”₯ munin_get_parent_name πŸ”₯

Return the name of the parent of the hash node supplied. parent-name reveal ✨

Parameters:

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

Returns:

  • Success: the name of the parent node
  • Failure: if no parent node exists, "none" is returned.

🧚 munin_get_picture_filename 🧚

Get the full path+name of a picture file. picture-file path+name, slay 🌸

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 location array for hash node for picture purposes. Differs from munin_get_node_loc in that it honors #%#origin metadata. it's giving metadata-aware location energy πŸ’…

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. going all the way up πŸ¦‹

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 function is the correct one to use when figuring out where to fetch data from. this is the one, bestie πŸ”₯

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". separate-node realness ✨

Parameters:

  • $hash β€” the node to copy

Returns:

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

πŸŽ€ munin_get_var_path πŸŽ€

(no description in the original β€” just the name, bestie πŸŽ€)

🌈 munin_getlock 🌈

(no description in the original β€” just the name, bestie 🌈)

πŸ”₯ munin_graph_column_headers πŸ”₯

(no description in the original β€” just the name, bestie πŸ”₯)

🧚 munin_has_subservices 🧚

munin_has_subservices($hash);

Checks whether the service represented by $hash has subservices (multigraph), and returns the result. subservice check, very demure πŸ’…

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 πŸ“

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

Make a directory and recursively any nonexistent directory in the path to it. recursive directory creation, iconic 🌸

πŸŽ€ munin_node_status πŸŽ€

(no description in the original β€” just the name, bestie πŸŽ€)

🌸 munin_nscasend 🌸

(no description in the original β€” just the name, bestie 🌸)

πŸ¦‹ munin_overwrite πŸ¦‹

Take contents of one config-namespace and replace/insert the instances needed. namespace overwrite behavior ✨

πŸŽ€ munin_parse_config πŸŽ€

(no description in the original β€” just the name, bestie πŸŽ€)

🌈 munin_path_to_loc 🌈

Returns a loc array from a path string. path-to-loc translation moment 🫢

Parameters:

  • $path β€” a path string

Returns:

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

πŸ”₯ munin_readconfig_part πŸ”₯

Read a partial configuration. partial config, full drama πŸ’…

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 in the original β€” just the name, bestie 🧚)

πŸ“ munin_runlock πŸ“

(no description in the original β€” just the name, bestie πŸ“)

πŸŽ€ munin_service_status πŸŽ€

Gets the current status of a service. service-status check, periodt πŸ’–

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. setter behavior, no cap ✨

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
  • Failure: undef

πŸ¦‹ munin_set_var_loc πŸ¦‹

Sets a variable in a hash. location-based setter realness πŸ’…

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. path-based setter moment 🫢

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, both success and failure hand you back $hash β€” that's what the original says, bestie πŸ’€

🌈 munin_writeconfig 🌈

(no description in the original β€” just the name, bestie 🌈)

πŸ”₯ munin_writeconfig_loop πŸ”₯

(no description in the original β€” just the name, bestie πŸ”₯)

πŸ’– COPYING πŸ’–

okay so legal era, but make it cute β€” this is the part where the page tells you who made it and what you're allowed to do with it. no cap, it's important.

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

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. slay, that's the whole vibe.

This program is distributed in the hope that it will be useful, but β€” and this is the loud part β€” WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. like, it's giving "no promises bestie" πŸ’€

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.

and that's the whole page, icon that it is ✨ this was Munin::...::Utils(3) from the User Contributed Perl Documentation for Munin, shipped with perl v5.42.3 and stamped 1980-01-01 β€” yes the date is lowkey ancient and yes she's still main character energy πŸ’…πŸ‘‘ go read your licences and stay hydrated, ily πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from