Munin::Master::Utils(3pm) | User Contributed Perl Documentation | Munin::Master::Utils(3pm) |
Munin::Master::Utils - Exports a lot of utility functions.
use Munin::Master::Utils;
Parameters:
- $hash: A ref to the hash node whose children to
check
- $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
Parameters:
- $file: munin.conf filename. If omitted, default
filename is used.
Returns:
- Success: The $config hash (also cached in
module)
Parameters:
- $from: Hash node to copy
- $to: Where to copy it to
Returns:
- Success: $to
- Failure: undef
Parameters:
- $from: Hash node to copy
- $to: Where to copy it to
- $loc: Path to node under
$to
Returns:
- Success: $to
- Failure: undef
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
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
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
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
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
Parameters:
- $hash: A hash ref to the parent node
Returns:
- Success: A ref to an array of the child nodes
- Failure: undef
Parameters:
- $hash: A hash ref to the service
Returns:
- Success: A ref to an array of the field names
- Failure: undef
Parameters:
- $hash: Ref to hash field
Returns:
- Success: Full path to rrd file
- Failure: undef
Parameters:
- $hash: A ref to the service hash node
Returns:
- Success: The file name with full path
- Failure: undef
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
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
Parameters:
- $hash: A ref to the node
Returns:
- Success: Ref to an array with the full path of the variable
- Failure: undef
Parameters:
- $hash: A ref to the hash node
Returns:
- Success: The name of the node
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
Parameters:
- $hash: A ref to the node
Returns:
- Success: Ref to an parent
- Failure: undef
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.
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
Parameters:
- $hash: A ref to the node
Returns:
- Success: Ref to an array with the full path of the variable
- Failure: undef
Parameters:
- $hash: A hash node to traverse up from
Returns:
- Success: A ref to the root hash node
- Failure: undef
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
Parameters:
- $hash: The node to copy
Returns:
- Success: A ref to a new node without "#%#"-fields
- Failure: undef
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 service
Returns:
- true: if the hash is indeed a service, and said service has got
subservices
- false: otherwise
munin_mkdir_p('/a/path/', oct('777'));
Make a directory and recursively any nonexistent directory in the path to it.
Parameters:
- $path: A path string
Returns:
- Success: A ref to an array with the loc
- Failure: undef
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
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
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
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
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
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.
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.
2023-03-21 | perl v5.36.0 |