improve smokeping filename detection (see filenames with underscores instead of dots). this is temporary until we "discovery" these rather than look for them on the fly.

git-svn-id: http://www.observium.org/svn/observer/trunk@3005 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2012-04-09 13:03:42 +00:00
parent 8c88728143
commit 7ffe4f2de1
4 changed files with 24 additions and 0 deletions

View File

@@ -34,8 +34,18 @@ if($width > "500")
if($device['hostname'] == $config['own_hostname'])
{
$filename = $config['smokeping']['dir'] . $dest['hostname'].'.rrd';
if (!file_exists($filename))
{
// Try with dots in hostname replaced by underscores
$filename = $config['smokeping']['dir'] . str_replace(".", "_", $dest['hostname']).'.rrd';
}
} else {
$filename = $config['smokeping']['dir'] . $dest['hostname'] .'~'.$device['hostname'].'.rrd';
if (!file_exists($filename))
{
// Try with dots in hostname replaced by underscores
$filename = $config['smokeping']['dir'] . str_replace(".", "_", $dest['hostname']) .'~'.$device['hostname'].'.rrd';
}
}
if (!isset($config['graph_colours'][$colourset][$iter])) { $iter = 0; }