mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-12 16:06:25 +02:00
multiple directories for rancid configs (use array instead of text variable)
git-svn-id: http://www.observium.org/svn/observer/trunk@874 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -172,7 +172,15 @@ echo('<li class="' . $select['syslog'] . '">
|
||||
');
|
||||
}
|
||||
|
||||
if($_SESSION['userlevel'] >= "5" && is_file($config['rancid_configs'] . $device['hostname'])) {
|
||||
|
||||
|
||||
if($_SESSION['userlevel'] >= "5") {
|
||||
if(!is_array($config['rancid_configs'])) { $config['rancid_configs'] = array($config['rancid_configs']); }
|
||||
foreach($config['rancid_configs'] as $configs) {
|
||||
if(is_file($configs . $device['hostname'])) { $device_config_file = $configs . $device['hostname']; }
|
||||
}
|
||||
}
|
||||
if($device_config_file) {
|
||||
echo('<li class="' . $select['showconfig'] . '">
|
||||
<a href="'.$config['base_url']."/device/" . $device['device_id'] . '/showconfig/">
|
||||
<img src="images/16/page_white_text.png" align="absmiddle" border="0" /> Config
|
||||
|
||||
@@ -28,7 +28,7 @@ if(mysql_result(mysql_query("SELECT count(temp_id) from temperature WHERE device
|
||||
$temp_link .= "overlib('<div class=list-large>".$device['hostname']." - ".$temp['temp_descr'];
|
||||
$temp_link .= "</div><div style=\'width: 750px\'><img src=\'$temp_day\'><img src=\'$temp_week\'><img src=\'$temp_month\'><img src=\'$temp_year\'></div>', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\" >";
|
||||
|
||||
$temp_link_c = $temp_link . "<span style='color: $temp_colour'>" . $temp['temp_current'] . "°C</span></a>";
|
||||
$temp_link_c = $temp_link . "<span style='color: $temp_colour'>" . round($temp['temp_current'],0) . "°C</span></a>";
|
||||
$temp_link_b = $temp_link . $temp_minigraph . "</a>";
|
||||
$temp_link_a = $temp_link . $temp['temp_descr'] . "</a>";
|
||||
|
||||
|
||||
@@ -2,11 +2,18 @@
|
||||
|
||||
include("includes/geshi/geshi.php");
|
||||
|
||||
if($_SESSION['userlevel'] >= "5" && is_file($config['rancid_configs'] . $device['hostname'])) {
|
||||
$file = $config['rancid_configs'] . $device['hostname'];
|
||||
if($_SESSION['userlevel'] >= "5") {
|
||||
|
||||
if(!is_array($config['rancid_configs'])) { $config['rancid_configs'] = array($config['rancid_configs']); }
|
||||
|
||||
foreach($config['rancid_configs'] as $configs) {
|
||||
if(is_file($configs . $device['hostname'])) { $file = $configs . $device['hostname']; }
|
||||
}
|
||||
|
||||
$fh = fopen($file, 'r') or die("Can't open file");
|
||||
$text = fread($fh, filesize($file));
|
||||
fclose($fh);
|
||||
|
||||
if ($config['rancid_ignorecomments'])
|
||||
{
|
||||
$lines = split("\n",$text);
|
||||
@@ -20,10 +27,9 @@ if($_SESSION['userlevel'] >= "5" && is_file($config['rancid_configs'] . $device[
|
||||
$geshi = new GeSHi($text, $language);
|
||||
$geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS);
|
||||
$geshi->set_overall_style('color: black;');
|
||||
# $geshi->set_line_style('color: #999999');
|
||||
#$geshi->set_line_style('color: #999999');
|
||||
echo $geshi->parse_code();
|
||||
} else {
|
||||
print_error("Error : Insufficient access.");
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -30,7 +30,9 @@ if($device['os'] == "ironware")
|
||||
$descr = str_replace("temperature", "", $descr);
|
||||
$descr = str_replace("temp", "", $descr);
|
||||
$descr = str_replace("sensor", "Sensor", $descr);
|
||||
$descr = str_replace("Line module", "Line Mod", $descr);
|
||||
$descr = str_replace("Line module", "Slot", $descr);
|
||||
$descr = str_replace("Switch Fabric module", "Fabric", $descr);
|
||||
$descr = str_replace("Active management module", "Mgmt Module", $descr);
|
||||
$descr = str_replace(" ", " ", $descr);
|
||||
$descr = trim($descr);
|
||||
if (mysql_result(mysql_query("SELECT count(temp_id) FROM `temperature` WHERE temp_oid = '$temp_oid' AND device_id = '$id'"),0) == '0')
|
||||
|
||||
Reference in New Issue
Block a user