mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-27 00:25:06 +02:00
Separate convenience function for RRD filename generation; tidy formatting
This commit is contained in:
+16
-2
@@ -1251,7 +1251,8 @@ function ip_exists($ip) {
|
||||
/*
|
||||
* convenience function - please use this instead of 'if ($debug) { echo ...; }'
|
||||
*/
|
||||
function d_echo($text) {
|
||||
function d_echo($text)
|
||||
{
|
||||
global $debug;
|
||||
if ($debug) {
|
||||
echo "$text\n";
|
||||
@@ -1261,9 +1262,22 @@ function d_echo($text) {
|
||||
/*
|
||||
* convenience function - please use this instead of 'if ($debug) { print_r ...; }'
|
||||
*/
|
||||
function d_print_r($var) {
|
||||
function d_print_r($var)
|
||||
{
|
||||
global $debug;
|
||||
if ($debug) {
|
||||
print_r($var);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* @return the name of the rrd file for $host's $extra component
|
||||
* @param host Host name
|
||||
* @param extra Components of RRD filename - will be separated with "-"
|
||||
*/
|
||||
function rrdname($host, $extra)
|
||||
{
|
||||
global $config;
|
||||
return implode("/", array($config['rrd_dir'], $host, safename(implode("-", $extra)).".rrd"));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user