table of contents
- experimental 2.999.16-1
Munin::Master::Utils(3pm) | User Contributed Perl Documentation | Munin::Master::Utils(3pm) |
NAME¶
Munin::Master::Utils - Exports a lot of utility functions.
SYNOPSIS¶
use Munin::Master::Utils;
SUBROUTINES¶
- munin_copy_node
- Copy hash node.
Parameters:
- $from: Hash node to copy
- $to: Where to copy it toReturns:
- Success: $to
- Failure: undef - munin_delete
- munin_get
- Get variable.
Parameters:
- $hash: Ref to hash node
- $field: Name of field to get
- $default: [optional] Value to return if $field isn't setReturns:
- Success: field contents
- Failure: $default if defined, else undef - munin_get_bool
- Get boolean variable.
Parameters:
- $hash: Ref to hash node
- $field: Name of field to get
- $default: [optional] Value to return if $field isn't setReturns:
- Success: 1 or 0 (true or false)
- Failure: $default if defined, else undef - munin_get_children
- Get all child hash nodes.
Parameters:
- $hash: A hash ref to the parent nodeReturns:
- Success: A ref to an array of the child nodes
- 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 nodeReturns:
- Success: The node ref found by $loc
- Failure: undef - munin_get_node_loc
- Get location array for hash node.
Parameters:
- $hash: A ref to the nodeReturns:
- 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.
Parameters:
- $hash: A ref to the hash nodeReturns:
- Success: The name of the node - munin_get_root_node
- Get the root node of the hash tree.
Parameters:
- $hash: A hash node to traverse up fromReturns:
- 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.
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_var_path
- munin_has_subservices
-
munin_has_subservices($hash);
Checks whether the service represented by $hash has subservices (multigraph), and returns the result.
Parameters:
- $hash: Hash reference pointing to a serviceReturns:
- 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.
- munin_parse_config
- munin_path_to_loc
- Returns a loc array from a path string.
Parameters:
- $path: A path stringReturns:
- Success: A ref to an array with the loc
- Failure: undef - munin_set
- Sets a variable in a hash.
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 toReturns:
- Success: The $hash we were handed
- Failure: undef - munin_set_var_loc
- Sets a variable in a hash.
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 toReturns:
- Success: The $hash we were handed
- Failure: undef
COPYING¶
Copyright (C) 2010-2014 Steve Schnepp Copyright (C) 2003-2011 Jimmy Olsen Copyright (C) 2006-2010 Nicolai Langfeldt Copyright (C) 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.
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. 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.
2022-02-10 | perl v5.34.0 |