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:
@@ -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