Move the ceph_rrd function to includes/common.inc.php

This commit is contained in:
Mark Schouten
2015-11-10 12:33:52 +01:00
parent 669eb872a5
commit 930d9b022d
7 changed files with 21 additions and 25 deletions

View File

@@ -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));
}