mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
add rancid config integration
git-svn-id: http://www.observium.org/svn/observer/trunk@343 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -26,6 +26,12 @@
|
||||
$device_id = getpeerhost($_GET['peer']);
|
||||
}
|
||||
|
||||
if($_GET['legend']) {
|
||||
$legend = $_GET['legend'];
|
||||
}
|
||||
if($_GET['inverse']) {
|
||||
$inverse = $_GET['inverse'];
|
||||
}
|
||||
|
||||
if($device_id) {
|
||||
$hostname = gethostbyid($device_id);
|
||||
@@ -63,7 +69,7 @@
|
||||
$graph = graph_netscreen_memory ($hostname . "/netscreen-memory.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
break;
|
||||
case 'multi_bits':
|
||||
$graph = graph_multi_bits ($_GET['interfaces'], $graphfile, $from, $to, $width, $height);
|
||||
$graph = graph_multi_bits ($_GET['interfaces'], $graphfile, $from, $to, $width, $height, $title, $vertical, $inverse, $legend);
|
||||
break;
|
||||
case 'adsl_rate':
|
||||
$graph = graph_adsl_rate ($hostname. "/adsl-4.rrd", $graphfile, $from, $to, $width, $height);
|
||||
@@ -87,7 +93,7 @@
|
||||
$graph = graph_device_bits ($device_id, $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
break;
|
||||
case 'bits':
|
||||
$graph = trafgraph ($hostname . "/". $ifIndex . ".rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
$graph = graph_bits ($hostname . "/". $ifIndex . ".rrd", $graphfile, $from, $to, $width, $height, $title, $vertical, $inverse, $legend);
|
||||
break;
|
||||
case 'pkts':
|
||||
$graph = pktsgraph ($hostname . "/". $ifIndex . ".rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
|
@@ -137,6 +137,16 @@ if($config['enable_syslog']) { echo("
|
||||
</li>
|
||||
"); }
|
||||
|
||||
if($_SESSION[userlevel] >= "5" && is_file($config['rancid_configs'] . $device['hostname'])) {
|
||||
echo("
|
||||
<li class=" . $select['showconfig'] . ">
|
||||
<a href='/device/" . $device['device_id'] . "/showconfig/'>
|
||||
<img src='images/16/page_white_text.png' align=absmiddle border=0> Config
|
||||
</a>
|
||||
</li>
|
||||
");
|
||||
}
|
||||
|
||||
if($_SESSION[userlevel] >= "5") {
|
||||
echo("
|
||||
<li class=" . $select['edit'] . ">
|
||||
|
16
html/pages/device/showconfig.inc.php
Normal file
16
html/pages/device/showconfig.inc.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
if($_SESSION[userlevel] >= "5" && is_file($config['rancid_configs'] . $device['hostname'])) {
|
||||
|
||||
$file = $config['rancid_configs'] . $device['hostname'];
|
||||
$fh = fopen($file, 'r') or die("Can't open file");
|
||||
echo(highlight_string(fread($fh, filesize($file))));
|
||||
fclose($fh);
|
||||
|
||||
} else {
|
||||
|
||||
print_error("Error : Insufficient access.");
|
||||
|
||||
}
|
||||
|
||||
?>
|
Reference in New Issue
Block a user