mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 00:24:21 +02:00
syntaxer run
git-svn-id: http://www.observium.org/svn/observer/trunk@3185 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -52,7 +52,6 @@ echo('
|
||||
$graph_array['width'] = "150";
|
||||
$graph_array['bg'] = "FFFFFF00";
|
||||
|
||||
|
||||
foreach ($graphs as $entry)
|
||||
{
|
||||
$graph_array['type'] = $entry['graph'];
|
||||
|
||||
@@ -177,7 +177,7 @@ function generate_graph_popup($graph_array)
|
||||
$graph_array['from'] = $config['time']['year'];
|
||||
$content .= generate_graph_tag($graph_array);
|
||||
$content .= "</div>";
|
||||
|
||||
|
||||
$graph_array['from'] = $original_from;
|
||||
|
||||
$graph_array['link'] = generate_url($graph_array, array('page' => 'graphs', 'height' => NULL, 'width' => NULL, 'bg' => NULL));
|
||||
|
||||
@@ -22,7 +22,7 @@ if (is_file($rrd_filename))
|
||||
$rrd_list[$i]['descr'] = $vars['descr'];
|
||||
$rrd_list[$i]['ds'] = $ds;
|
||||
$rrd_list[$i]['colour'] = $vars['colour'];
|
||||
if(!empty($vars['areacolour'])) { $rrd_list[$i]['areacolour'] = $vars['areacolour']; }
|
||||
if (!empty($vars['areacolour'])) { $rrd_list[$i]['areacolour'] = $vars['areacolour']; }
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -21,7 +21,7 @@ if (is_file($rrd_filename))
|
||||
$rrd_list[$i]['descr'] = $vars['descr'];
|
||||
$rrd_list[$i]['ds'] = $ds;
|
||||
$rrd_list[$i]['colour'] = $vars['colour'];
|
||||
if(!empty($vars['areacolour'])) { $rrd_list[$i]['areacolour'] = $vars['areacolour']; }
|
||||
if (!empty($vars['areacolour'])) { $rrd_list[$i]['areacolour'] = $vars['areacolour']; }
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
include("memcached.inc.php");
|
||||
include("includes/graphs/common.inc.php");
|
||||
|
||||
$device = device_by_id_cache($vars['id']);
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
|
||||
@@ -18,6 +18,4 @@ $unit_text = "Processes";
|
||||
|
||||
include("includes/graphs/generic_simplex.inc.php");
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
@@ -18,6 +18,4 @@ $unit_text = "Processes";
|
||||
|
||||
include("includes/graphs/generic_simplex.inc.php");
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<?php
|
||||
|
||||
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/netstats-icmp.rrd";
|
||||
|
||||
$stats = array('icmpInMsgs' => '00cc00',
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<?php
|
||||
|
||||
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/netstats-icmp.rrd";
|
||||
|
||||
$stats = array('icmpInSrcQuenchs' => array(),
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<?php
|
||||
|
||||
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/netstats-ip.rrd";
|
||||
|
||||
$stats = array('ipForwDatagrams' => array(),
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
|
||||
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/netstats-ip.rrd";
|
||||
|
||||
$rrd_options .= " DEF:ipInDelivers=$rrd_filename:ipInDelivers:AVERAGE";
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<?php
|
||||
|
||||
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/netstats-snmp.rrd";
|
||||
|
||||
$stats = array('snmpInTraps',
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<?php
|
||||
|
||||
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/netstats-tcp.rrd";
|
||||
|
||||
$stats = array('tcpInSegs','tcpOutSegs','tcpActiveOpens','tcpPassiveOpens','tcpAttemptFails','tcpEstabResets','tcpRetransSegs');
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<?php
|
||||
|
||||
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/netstats-udp.rrd";
|
||||
|
||||
$stats = array('udpInDatagrams','udpOutDatagrams','udpInErrors','udpNoPorts');
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<?php
|
||||
|
||||
|
||||
$file = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("screenos_sessions.rrd");
|
||||
|
||||
$rrd_list[0]['filename'] = $file;
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
|
||||
|
||||
if ($_GET['width'] > "300") { $descr_len = "40"; } else { $descr_len = "22"; }
|
||||
|
||||
$rrd_options .= " -l 0 -E ";
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
|
||||
|
||||
$rrd_options .= " -l 0 -E ";
|
||||
|
||||
$iter = "1";
|
||||
|
||||
@@ -4,7 +4,6 @@ $scale_min = "0";
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
|
||||
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/uptime.rrd";
|
||||
|
||||
$rrd_options .= " DEF:uptime=".$rrd_filename.":uptime:AVERAGE";
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
|
||||
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/vpdn-l2tp.rrd";
|
||||
|
||||
$stats = array('sessions');
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
|
||||
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/vpdn-l2tp.rrd";
|
||||
|
||||
$stats = array('tunnels');
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
|
||||
|
||||
$rrd_options .= " -l 0 -E ";
|
||||
|
||||
$radio1 = $config['rrd_dir'] . "/".$device['hostname']."/wificlients-radio1.rrd";
|
||||
|
||||
@@ -96,7 +96,7 @@ if(!$nototal)
|
||||
$rrd_options .= " CDEF:inbits=inoctets,8,*";
|
||||
$rrd_options .= " CDEF:outbits=outoctets,8,*";
|
||||
$rrd_options .= " CDEF:doutbits=doutoctets,8,*";
|
||||
|
||||
|
||||
$rrd_options .= " VDEF:95thin=inbits,95,PERCENT";
|
||||
$rrd_options .= " VDEF:95thout=outbits,95,PERCENT";
|
||||
$rrd_options .= " VDEF:d95thout=doutbits,5,PERCENT";
|
||||
@@ -110,10 +110,8 @@ if(!$nototal)
|
||||
# $rrd_options .= " GPRINT:totin:AVERAGE:%6.2lf%s$units";
|
||||
# $rrd_options .= " GPRINT:totin:MAX:%6.2lf%s$units\l";
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
$rrd_options .= $rrd_optionsb;
|
||||
$rrd_options .= " HRULE:0#999999";
|
||||
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
<?php
|
||||
|
||||
|
||||
if($config['old_graphs'])
|
||||
{
|
||||
include("includes/graphs/old_generic_simplex.inc.php");
|
||||
} else {
|
||||
|
||||
|
||||
|
||||
/// Draw generic bits graph
|
||||
/// args: ds_in, ds_out, rrd_filename, bg, legend, from, to, width, height, inverse, percentile
|
||||
|
||||
@@ -19,7 +16,6 @@ $line_text = str_pad(truncate($line_text,12,''),12);
|
||||
if ($multiplier)
|
||||
{
|
||||
$rrd_options .= " DEF:".$ds."_o=".$rrd_filename.":".$ds.":AVERAGE";
|
||||
if($config['oldrrd']) {}
|
||||
$rrd_options .= " DEF:".$ds."_max_o=".$rrd_filename.":".$ds.":MAX";
|
||||
$rrd_options .= " DEF:".$ds."_min_o=".$rrd_filename.":".$ds.":MIN";
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
if ($_SESSION['userlevel'] >= "5")
|
||||
{
|
||||
$auth = 1;
|
||||
$auth = 1;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -51,7 +51,6 @@ $colours_out = 'blues';
|
||||
|
||||
$nototal = 1;
|
||||
|
||||
|
||||
$ds_in = "INOCTETS";
|
||||
$ds_out = "OUTOCTETS";
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ $subtype = $graphtype['subtype'];
|
||||
if (is_file($config['install_dir'] . "/html/includes/graphs/$type/$subtype.inc.php"))
|
||||
{
|
||||
|
||||
if (isset($config['allow_unauth_graphs']) && $config['allow_unauth_graphs'])
|
||||
if (isset($config['allow_unauth_graphs']) && $config['allow_unauth_graphs'])
|
||||
{
|
||||
$auth = "1"; ## hardcode auth for all with config function
|
||||
}
|
||||
@@ -52,8 +52,8 @@ if (is_file($config['install_dir'] . "/html/includes/graphs/$type/$subtype.inc.p
|
||||
{
|
||||
if (Net_IPv4::ipInNetwork($_SERVER['REMOTE_ADDR'], $range))
|
||||
{
|
||||
$auth = "1";
|
||||
if($debug) { echo("matched $range"); }
|
||||
$auth = "1";
|
||||
if ($debug) { echo("matched $range"); }
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
if(is_numeric($vars['plugin']))
|
||||
if (is_numeric($vars['plugin']))
|
||||
{
|
||||
$mplug = dbFetchRow("SELECT * FROM `munin_plugins` AS M, `devices` AS D WHERE `mplug_id` = ? AND D.device_id = M.device_id ", array($vars['plugin']));
|
||||
} else {
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
if(empty($graph_array['type'])) { $graph_array['type'] = $graph_type; }
|
||||
if(empty($graph_array['device'])) { $graph_array['device'] = $device['device_id']; }
|
||||
|
||||
|
||||
# FIXME not css alternating yet
|
||||
if (!is_integer($g_i/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ if ($_POST['hostname'])
|
||||
);
|
||||
|
||||
array_push($config['snmp']['v3'], $v3);
|
||||
|
||||
|
||||
$snmpver = "v3";
|
||||
|
||||
if ($_POST['port']) { $port = mres($_POST['port']); } else { $port = "161"; }
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
$graph_array['height'] = "100";
|
||||
$graph_array['width'] = "218";
|
||||
$graph_array['width'] = "218";
|
||||
$graph_array['to'] = $config['time']['now'];
|
||||
$graph_array['from'] = $config['time']['day'];
|
||||
$graph_array_zoom = $graph_array;
|
||||
@@ -14,9 +14,9 @@ foreach ($app_list as $app)
|
||||
echo('<div style="clear: both;">');
|
||||
echo('<h2>'.generate_link(nicecase($app['app_type']),array('page'=>'apps','app'=>$app['app_type'])).'</h2>');
|
||||
$app_devices = dbFetchRows("SELECT * FROM `devices` AS D, `applications` AS A WHERE D.device_id = A.device_id AND A.app_type = ?", array($app['app_type']));
|
||||
|
||||
foreach ($app_devices as $app_device)
|
||||
{
|
||||
|
||||
$graph_type = $graphs[$app['app_type']][0];
|
||||
|
||||
$graph_array['type'] = "application_".$app['app_type']."_".$graph_type;
|
||||
@@ -33,7 +33,7 @@ foreach ($app_list as $app)
|
||||
$overlib_url = generate_url($link_array);
|
||||
|
||||
$overlib_link = '<span style="float:left; margin-left: 10px; font-weight: bold;">'.shorthost($app_device['hostname'])."</span>";
|
||||
if(!empty($app_device['app_instance']))
|
||||
if (!empty($app_device['app_instance']))
|
||||
{
|
||||
$overlib_link .= '<span style="float:right; margin-right: 10px; font-weight: bold;">'.$app_device['app_instance']."</span>";
|
||||
$app_device['content_add'] = '('.$app_device['app_instance'].')';
|
||||
|
||||
@@ -100,7 +100,6 @@ if (device_permitted($vars['device']) || $check_device == $vars['device'])
|
||||
</li>');
|
||||
}
|
||||
|
||||
|
||||
if (@dbFetchCell("SELECT COUNT(interface_id) FROM ports WHERE device_id = '" . $device['device_id'] . "'") > '0')
|
||||
{
|
||||
echo('<li class="' . $select['ports'] . $select['port'] . '">
|
||||
|
||||
@@ -20,16 +20,16 @@ if ($_POST['editing'])
|
||||
|
||||
#FIXME needs better feedback
|
||||
$update = array(
|
||||
'community' => $community,
|
||||
'snmpver' => $snmpver,
|
||||
'community' => $community,
|
||||
'snmpver' => $snmpver,
|
||||
'port' => $port
|
||||
);
|
||||
|
||||
if ($_POST['timeout']) { $update['timeout'] = $timeout; }
|
||||
if ($_POST['timeout']) { $update['timeout'] = $timeout; }
|
||||
else { $update['timeout'] = array('NULL'); }
|
||||
if ($_POST['retries']) { $update['retries'] = $retries; }
|
||||
if ($_POST['retries']) { $update['retries'] = $retries; }
|
||||
else { $update['retries'] = array('NULL'); }
|
||||
|
||||
|
||||
$update = array_merge($update, $v3);
|
||||
|
||||
$rows_updated = dbUpdate($update, 'devices', '`device_id` = ?',array($device['device_id']));
|
||||
|
||||
@@ -57,6 +57,7 @@ foreach ($graph_enable as $graph => $entry)
|
||||
{
|
||||
$graph_title = $config['graph_types']['device'][$graph]['descr'];
|
||||
$graph_array['type'] = "device_" . $graph;
|
||||
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,23 +11,23 @@
|
||||
data.addRows([
|
||||
<?php
|
||||
|
||||
foreach(getlocations() as $location)
|
||||
foreach (getlocations() as $location)
|
||||
{
|
||||
|
||||
$devices = array();
|
||||
$devices_down = array();
|
||||
$count = 0;
|
||||
$down = 0;
|
||||
foreach(dbFetchRows("SELECT * FROM devices WHERE location = ?", array($location)) as $device)
|
||||
foreach (dbFetchRows("SELECT * FROM devices WHERE location = ?", array($location)) as $device)
|
||||
{
|
||||
$devices[] = $device['hostname'];
|
||||
$count++;
|
||||
if($device['status'] == "0") { $down++; $devices_down[] = $device['hostname']; }
|
||||
if ($device['status'] == "0") { $down++; $devices_down[] = $device['hostname']; }
|
||||
}
|
||||
|
||||
if(empty($devices_down)) { $devices_down[] = "No Problems"; }
|
||||
if (empty($devices_down)) { $devices_down[] = "No Problems"; }
|
||||
|
||||
if($down > 0) { $state = 0; } else { $state = 100; }
|
||||
if ($down > 0) { $state = 0; } else { $state = 100; }
|
||||
|
||||
$locations[] = "['".$location."',".$state.", '".implode(", ", $devices_down)."']";
|
||||
|
||||
@@ -55,11 +55,8 @@ echo(implode(",\n", $locations));
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<div style="margin:0 auto;" id='chart_div'></div>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
function generate_front_box ($background, $content)
|
||||
|
||||
@@ -45,7 +45,7 @@ foreach (dbFetchRows("SELECT * FROM `packages` WHERE 1 $where GROUP BY `name`",
|
||||
$content .= "</div>";
|
||||
}
|
||||
$content .= "</div>";
|
||||
if(empty($vars['name']))
|
||||
if (empty($vars['name']))
|
||||
{
|
||||
echo("<span style='margin:5px;'>".overlib_link("", $version, $content, NULL)."</span>");
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user