mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Move the ceph_rrd function to includes/common.inc.php
This commit is contained in:
@@ -1,17 +0,0 @@
|
||||
<?php
|
||||
|
||||
function ceph_rrd($gtype) {
|
||||
global $device;
|
||||
global $vars;
|
||||
global $config;
|
||||
|
||||
if ($gtype == "osd") {
|
||||
$var = $vars['osd'];
|
||||
}
|
||||
else {
|
||||
$var = $vars['pool'];
|
||||
}
|
||||
|
||||
$rrd = join('-', array('app', 'ceph', $vars['id'], $gtype, $var)).'.rrd';
|
||||
return join('/', array($config['rrd_dir'], $device['hostname'], $rrd));
|
||||
}
|
@@ -1,7 +1,5 @@
|
||||
<?php
|
||||
|
||||
require 'includes/graphs/application/ceph_common.inc.php';
|
||||
|
||||
$ds_in = 'apply_ms';
|
||||
$ds_out = 'commit_ms';
|
||||
|
||||
|
@@ -1,8 +1,6 @@
|
||||
<?php
|
||||
|
||||
require 'includes/graphs/common.inc.php';
|
||||
require 'includes/graphs/application/ceph_common.inc.php';
|
||||
|
||||
|
||||
$ceph_pool_rrd = ceph_rrd('df');
|
||||
|
||||
|
@@ -1,7 +1,5 @@
|
||||
<?php
|
||||
|
||||
require 'includes/graphs/application/ceph_common.inc.php';
|
||||
|
||||
$ds_in = 'rbytes';
|
||||
$in_text = 'Read';
|
||||
$ds_out = 'wrbytes';
|
||||
|
@@ -3,7 +3,6 @@
|
||||
$scale_min = 0;
|
||||
|
||||
require 'includes/graphs/common.inc.php';
|
||||
require 'includes/graphs/application/ceph_common.inc.php';
|
||||
|
||||
$ceph_pool_rrd = ceph_rrd('pool');
|
||||
|
||||
|
@@ -3,7 +3,6 @@
|
||||
$scale_min = 0;
|
||||
|
||||
require 'includes/graphs/common.inc.php';
|
||||
require 'includes/graphs/application/ceph_common.inc.php';
|
||||
|
||||
$ceph_pool_rrd = ceph_rrd('df');
|
||||
|
||||
|
@@ -774,3 +774,24 @@ function can_ping_device($attribs) {
|
||||
return false;
|
||||
}
|
||||
} // end can_ping_device
|
||||
|
||||
/**
|
||||
* Constructs the path to an RRD for the Ceph application
|
||||
* @param string $gtype The type of rrd we're looking for
|
||||
* @return string
|
||||
**/
|
||||
function ceph_rrd($gtype) {
|
||||
global $device;
|
||||
global $vars;
|
||||
global $config;
|
||||
|
||||
if ($gtype == "osd") {
|
||||
$var = $vars['osd'];
|
||||
}
|
||||
else {
|
||||
$var = $vars['pool'];
|
||||
}
|
||||
|
||||
$rrd = join('-', array('app', 'ceph', $vars['id'], $gtype, $var)).'.rrd';
|
||||
return join('/', array($config['rrd_dir'], $device['hostname'], $rrd));
|
||||
}
|
||||
|
Reference in New Issue
Block a user