mirror of
https://github.com/librenms/librenms.git
synced 2024-09-21 10:28:13 +00:00
kill a whole bunch of trailing spaces
git-svn-id: http://www.observium.org/svn/observer/trunk@2516 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
parent
9b270dd1e5
commit
d864ce234f
@ -53,7 +53,7 @@ if (isset($argv[1]) && $argv[1])
|
||||
echo("Added device ".$device['hostname']." (".$device['device_id'].")\n");
|
||||
}
|
||||
|
||||
} else {
|
||||
} else {
|
||||
|
||||
print Console_Color::convert("
|
||||
Observium v".$config['version']." Add Host Tool
|
||||
|
@ -29,7 +29,7 @@ foreach (dbFetchRows("SELECT * FROM `devices` AS D, `services` AS S WHERE S.devi
|
||||
if ($service_status != $status)
|
||||
{
|
||||
$update['service_changed'] = time();
|
||||
|
||||
|
||||
if ($service['sysContact']) { $email = $service['sysContact']; } else { $email = $config['email_default']; }
|
||||
if ($status == "1")
|
||||
{
|
||||
@ -47,7 +47,7 @@ foreach (dbFetchRows("SELECT * FROM `devices` AS D, `services` AS S WHERE S.devi
|
||||
|
||||
$update = array_merge(array('service_status' => $status, 'service_message' => $check, 'service_checked' => time()), $update);
|
||||
dbUpdate($update, 'services', '`service_id` = ?', array($service['service_id']));
|
||||
unset($update);
|
||||
unset($update);
|
||||
|
||||
} else {
|
||||
$status = "0";
|
||||
|
@ -152,7 +152,7 @@ $graph->xaxis->SetTitleMargin(30);
|
||||
$graph->xaxis->title->Set($type);
|
||||
$graph->yaxis->title->Set($yaxis);
|
||||
|
||||
function TimeCallback($aVal) {
|
||||
function TimeCallback($aVal) {
|
||||
global $dur;
|
||||
|
||||
if ($dur < 172800)
|
||||
@ -161,7 +161,7 @@ function TimeCallback($aVal) {
|
||||
} elseif ($dur < 604800) {
|
||||
return Date('D',$aVal);
|
||||
} else {
|
||||
return Date('j M',$aVal);
|
||||
return Date('j M',$aVal);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
<?php
|
||||
/*
|
||||
Originally part of m0n0wall (http://m0n0.ch/wall)
|
||||
|
||||
|
||||
Copyright (C) 2004-2006 T. Lechat <dev@lechat.org>, Manuel Kasper <mk@neon1.net>
|
||||
and Jonathan Watt <jwatt@jwatt.org>.
|
||||
All rights reserved.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
include_once("../includes/defaults.inc.php");
|
||||
@ -184,7 +184,7 @@ function fetch_data() {
|
||||
function plot_data(obj) {
|
||||
// Show datetimelegend
|
||||
var now = new Date();
|
||||
var datetime = (now.getMonth()+1) + "/" + now.getDate() + "/" + now.getFullYear() + ' ' +
|
||||
var datetime = (now.getMonth()+1) + "/" + now.getDate() + "/" + now.getFullYear() + ' ' +
|
||||
LZ(now.getHours()) + ":" + LZ(now.getMinutes()) + ":" + LZ(now.getSeconds());
|
||||
SVGDoc.getElementById('datetime').firstChild.data = datetime;
|
||||
|
||||
@ -210,7 +210,7 @@ function plot_data(obj) {
|
||||
last_ugmt = ugmt;
|
||||
last_ifin = ifin;
|
||||
last_ifout = ifout;
|
||||
|
||||
|
||||
switch (plot_in.length) {
|
||||
case 0:
|
||||
SVGDoc.getElementById("collect_initial").setAttributeNS(null, 'visibility', 'visible');
|
||||
@ -283,7 +283,7 @@ function plot_data(obj) {
|
||||
rmax *= 1.25;
|
||||
else
|
||||
rmax *= 2;
|
||||
|
||||
|
||||
if (i == 8)
|
||||
rmax *= 1.024;
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ function passwordscanchange($username="")
|
||||
* By default allow the password to be modified, unless the existing
|
||||
* user is explicitly prohibited to do so.
|
||||
*/
|
||||
|
||||
|
||||
if (empty($username) || !user_exists($username))
|
||||
{
|
||||
return 1;
|
||||
|
@ -505,7 +505,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) {
|
||||
'GPRINT:temp_max:MAX:%4.1lf%%',
|
||||
'GPRINT:temp_avg:LAST:%4.1lf%%\l');
|
||||
$GraphDefs['if_errors'] = array(
|
||||
#'-v', 'Errors/s',
|
||||
#'-v', 'Errors/s',
|
||||
'--units=si',
|
||||
'DEF:tx_min={file}:tx:MIN',
|
||||
'DEF:tx_avg={file}:tx:AVERAGE',
|
||||
@ -551,7 +551,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) {
|
||||
'GPRINT:max:MAX:%5.1lf%s',
|
||||
'GPRINT:avg:LAST:%5.1lf%s\l');
|
||||
$GraphDefs['if_dropped'] = array(
|
||||
#'-v', 'Packets/s',
|
||||
#'-v', 'Packets/s',
|
||||
'--units=si',
|
||||
'DEF:tx_min={file}:tx:MIN',
|
||||
'DEF:tx_avg={file}:tx:AVERAGE',
|
||||
@ -734,7 +734,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) {
|
||||
'GPRINT:spam:LAST:%4.1lf',
|
||||
'HRULE:0#000000');
|
||||
$GraphDefs['memory'] = array(
|
||||
'-b', '1024',
|
||||
'-b', '1024',
|
||||
#'-v', 'Bytes',
|
||||
'DEF:avg={file}:value:AVERAGE',
|
||||
'DEF:min={file}:value:MIN',
|
||||
@ -1290,7 +1290,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) {
|
||||
'GPRINT:max:MAX:%9.3lf',
|
||||
'GPRINT:avg:LAST:%9.3lf\l');
|
||||
$GraphDefs['swap'] = array(
|
||||
#'-v', 'Bytes',
|
||||
#'-v', 'Bytes',
|
||||
'-b', '1024',
|
||||
'DEF:avg={file}:value:AVERAGE',
|
||||
'DEF:min={file}:value:MIN',
|
||||
@ -1396,7 +1396,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) {
|
||||
'GPRINT:s_max:MAX:%5.2lf%s',
|
||||
'GPRINT:s_avg:LAST:%5.2lf%s');
|
||||
$GraphDefs['if_octets'] = array(
|
||||
#'-v', 'Bits/s',
|
||||
#'-v', 'Bits/s',
|
||||
'--units=si',
|
||||
'DEF:out_min_raw={file}:tx:MIN',
|
||||
'DEF:out_avg_raw={file}:tx:AVERAGE',
|
||||
@ -1755,7 +1755,7 @@ function meta_graph_memory($host, $plugin, $plugin_instance, $type, $type_instan
|
||||
$opts['title'] = $title;
|
||||
$opts['number_format'] = '%5.1lf%s';
|
||||
$opts['rrd_opts'] = array('-b', '1024', 'COMMENT:Bytes Cur Min Ave Max\l');
|
||||
|
||||
|
||||
|
||||
# BYTES
|
||||
|
||||
|
@ -39,7 +39,7 @@ function rrdtool_graph($graph_file, $options)
|
||||
// proc_close in order to avoid a deadlock
|
||||
$return_value = proc_close($process);
|
||||
|
||||
if($debug)
|
||||
if($debug)
|
||||
{
|
||||
echo("<p>");
|
||||
if($debug) { echo("graph $graph_file $options"); }
|
||||
@ -415,7 +415,7 @@ function generate_port_thumbnail($args)
|
||||
function print_optionbar_start ($height = 0, $width = 0, $marginbottom = 5)
|
||||
{
|
||||
echo("
|
||||
<div class='rounded-5px' style='display: block; background: #e5e5e5; text-align: left; margin-top: 0px;
|
||||
<div class='rounded-5px' style='display: block; background: #e5e5e5; text-align: left; margin-top: 0px;
|
||||
margin-bottom: ".$marginbottom."px; " . ($width ? 'max-width: ' . $width . (strstr($width,'%') ? '' : 'px') . '; ' : '') . "
|
||||
padding: 7px 14px'>");
|
||||
}
|
||||
@ -443,7 +443,7 @@ function overlibprint($text)
|
||||
|
||||
function humanmedia($media)
|
||||
{
|
||||
array_preg_replace($rewrite_iftype, $media);
|
||||
array_preg_replace($rewrite_iftype, $media);
|
||||
return $media;
|
||||
}
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
@ -9,7 +9,7 @@ $language_data = array (
|
||||
'OOLANG' => false,
|
||||
'NUMBERS' => GESHI_NUMBER_OCT_PREFIX | GESHI_NUMBER_HEX_PREFIX,
|
||||
'KEYWORDS' => array(
|
||||
1 => array(
|
||||
1 => array(
|
||||
'no', 'shutdown'
|
||||
),
|
||||
# 2 => array(
|
||||
@ -32,7 +32,7 @@ $language_data = array (
|
||||
# 'isis', 'ospf', 'eigrp', 'rip', 'igrp', 'bgp', 'ipv4', 'unicast', 'multicast', 'ipv6', 'connected', 'static', 'subnets', 'tcl'
|
||||
# ),
|
||||
# 4 => array(
|
||||
# 'point-to-point', 'aal5snap', 'rj45', 'auto', 'full', 'half', 'precedence', 'percent', 'datetime', 'msec', 'locatime', 'summer-time', 'md5', 'wait-for-bgp', 'wide',
|
||||
# 'point-to-point', 'aal5snap', 'rj45', 'auto', 'full', 'half', 'precedence', 'percent', 'datetime', 'msec', 'locatime', 'summer-time', 'md5', 'wait-for-bgp', 'wide',
|
||||
# 'level-1', 'level-2', 'log-neighbor-changes', 'directed-request', 'password-encryption', 'common', 'origin-as', 'bgp-nexthop', 'random-detect', 'localtime', 'sso', 'stm-1',
|
||||
# 'dot1q', 'isl', 'new-model', 'always', 'summary-only', 'freeze', 'global', 'forwarded', 'access', 'trunk', 'edge', 'transparent'
|
||||
# ),
|
||||
@ -108,7 +108,7 @@ $language_data = array (
|
||||
GESHI_REPLACE => '\\2',
|
||||
GESHI_BEFORE => '\\1 '
|
||||
),
|
||||
|
||||
|
||||
),
|
||||
|
||||
'STYLES' => array(
|
||||
@ -163,7 +163,7 @@ $language_data = array (
|
||||
2 => '',
|
||||
3 => ''
|
||||
)
|
||||
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
@ -61,6 +61,6 @@ $rrd_options .= 'GPRINT:i:MAX:"%6.2lf %s\n" ';
|
||||
$rrd_options .= 'AREA:j#FF4105FF:"Idle ":STACK ';
|
||||
$rrd_options .= 'GPRINT:j:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:j:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:j:MAX:"%6.2lf %s\n"';
|
||||
$rrd_options .= 'GPRINT:j:MAX:"%6.2lf %s\n"';
|
||||
|
||||
?>
|
||||
|
@ -9,7 +9,7 @@ if (is_file($mysql_rrd))
|
||||
$rrd_filename = $mysql_rrd;
|
||||
}
|
||||
|
||||
$rrd_options .= ' -b 1024 ';
|
||||
$rrd_options .= ' -b 1024 ';
|
||||
$rrd_options .= ' DEF:a='.$rrd_filename.':BRd:AVERAGE ';
|
||||
$rrd_options .= ' DEF:b='.$rrd_filename.':BSt:AVERAGE ';
|
||||
$rrd_options .= ' CDEF:c=a,-1,* ';
|
||||
|
@ -23,7 +23,7 @@ if ($_GET['bg']) { $rrd_options .= " -c CANVAS#" . mres($_GET['bg']) . " "; }
|
||||
|
||||
#$rrd_options .= " -c BACK#FFFFFF";
|
||||
|
||||
if ($height < "99") { $rrd_options .= " --only-graph"; }
|
||||
if ($height < "99") { $rrd_options .= " --only-graph"; }
|
||||
|
||||
if ($width <= "300") { $rrd_options .= " --font LEGEND:7:" . $config['mono_font'] . " --font AXIS:6:" . $config['mono_font']; }
|
||||
else { $rrd_options .= " --font LEGEND:8:" . $config['mono_font'] . " --font AXIS:7:" . $config['mono_font']; }
|
||||
|
@ -17,7 +17,7 @@ $stats = array('icmpInMsgs' => '00cc00',
|
||||
|
||||
$i=0;
|
||||
|
||||
foreach($stats as $stat => $colour)
|
||||
foreach($stats as $stat => $colour)
|
||||
{
|
||||
$i++;
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
|
@ -5,7 +5,7 @@ $device = device_by_id_cache($id);
|
||||
if (!is_array($config['nfsen_rrds'])) { $config['nfsen_rrds'] = array($config['nfsen_rrds']); }
|
||||
|
||||
foreach ( $config['nfsen_rrds'] as $nfsenrrds )
|
||||
{
|
||||
{
|
||||
if ($configs[strlen($nfsenrrds)-1] != '/') { $nfsenrrds .= '/'; }
|
||||
|
||||
# convert dots in filename to underscores
|
||||
@ -16,7 +16,7 @@ foreach ( $config['nfsen_rrds'] as $nfsenrrds )
|
||||
|
||||
if (is_file($nfsenrrds . $nfsen_filename . ".rrd"))
|
||||
{
|
||||
$rrd_filename = $nfsenrrds . $nfsen_filename . ".rrd";
|
||||
$rrd_filename = $nfsenrrds . $nfsen_filename . ".rrd";
|
||||
|
||||
$flowtypes = array('tcp', 'udp', 'icmp', 'other');
|
||||
|
||||
|
@ -18,7 +18,7 @@ $rrd_list[2]['filename'] = $file;
|
||||
$rrd_list[2]['descr'] = "Failed";
|
||||
$rrd_list[2]['rra'] = "failed";
|
||||
|
||||
if ($_GET['debug']) { print_r($rrd_list); }
|
||||
if ($_GET['debug']) { print_r($rrd_list); }
|
||||
|
||||
$colours = "mixed";
|
||||
$nototal = 1;
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
$rrd_filename_in = $config['rrd_dir'] . "/" . $device['hostname'] . "/ucd_ssIORawReceived.rrd";
|
||||
$rrd_filename_out = $config['rrd_dir'] . "/" . $device['hostname'] . "/ucd_ssIORawSent.rrd";
|
||||
$rrd_filename_out = $config['rrd_dir'] . "/" . $device['hostname'] . "/ucd_ssIORawSent.rrd";
|
||||
$rra_in = "value";
|
||||
$rra_out = "value";
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
$rrd_filename_in = $config['rrd_dir'] . "/" . $device['hostname'] . "/ucd_ssRawSwapIn.rrd";
|
||||
$rrd_filename_out = $config['rrd_dir'] . "/" . $device['hostname'] . "/ucd_ssRawSwapOut.rrd";
|
||||
$rrd_filename_out = $config['rrd_dir'] . "/" . $device['hostname'] . "/ucd_ssRawSwapOut.rrd";
|
||||
$rra_in = "value";
|
||||
$rra_out = "value";
|
||||
|
||||
|
@ -38,7 +38,7 @@ foreach ($rrd_list as $i => $rrd)
|
||||
$g_defname = $rrd['rra'] . "_cdef";
|
||||
$rrd_options .= " CDEF:" . $g_defname . $i . "=" . $rrd['rra'] . $i . "," . $multiplier . ",*";
|
||||
$rrd_options .= " CDEF:" . $g_defname . $i . "max=" . $rrd['rra'] . $i . "max," . $multiplier . ",*";
|
||||
|
||||
|
||||
## If we've been passed a divider (divisor!) we make a CDEF for it.
|
||||
} elseif (is_numeric($divider))
|
||||
{
|
||||
|
@ -40,10 +40,10 @@ if (isset($config['allow_unauth_graphs']) && $config['allow_unauth_graphs'])
|
||||
{
|
||||
$auth = "1"; ## hardcode auth for all with config function
|
||||
} else {
|
||||
if (!$_SESSION['authenticated'])
|
||||
{
|
||||
graph_error("Session not authenticated");
|
||||
exit;
|
||||
if (!$_SESSION['authenticated'])
|
||||
{
|
||||
graph_error("Session not authenticated");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
@ -120,7 +120,7 @@ function graph_error($string)
|
||||
if ($error_msg) {
|
||||
graph_error($graph_error);
|
||||
} elseif (!$auth) {
|
||||
|
||||
|
||||
if ($width < 200)
|
||||
{
|
||||
graph_error("No Auth");
|
||||
|
@ -21,8 +21,8 @@ if (is_numeric($id))
|
||||
if(is_file($config['rrd_dir'] . "/" . $acc['hostname'] . "/" . safename("cip-" . $acc['ifIndex'] . "-" . $acc['mac'] . ".rrd")))
|
||||
{
|
||||
if($debug) { echo("exists"); }
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $acc['hostname'] . "/" . safename("cip-" . $acc['ifIndex'] . "-" . $acc['mac'] . ".rrd");
|
||||
$port = get_port_by_id($acc['interface_id']);
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $acc['hostname'] . "/" . safename("cip-" . $acc['ifIndex'] . "-" . $acc['mac'] . ".rrd");
|
||||
$port = get_port_by_id($acc['interface_id']);
|
||||
$device = device_by_id_cache($port['device_id']);
|
||||
$title = generate_device_link($device);
|
||||
$title .= " :: Port ".generate_port_link($port);
|
||||
|
@ -5,7 +5,7 @@ $i = 0;
|
||||
foreach (explode(",", $id) as $ifid)
|
||||
{
|
||||
$port = dbFetchRow("SELECT * FROM `ports` AS I, devices as D WHERE I.interface_id = ? AND I.device_id = D.device_id", array($ifid));
|
||||
if (is_file($config['rrd_dir'] . "/" . $port['hostname'] . "/port-" . safename($port['ifIndex'] . ".rrd")))
|
||||
if (is_file($config['rrd_dir'] . "/" . $port['hostname'] . "/port-" . safename($port['ifIndex'] . ".rrd")))
|
||||
{
|
||||
$rrd_list[$i]['filename'] = $config['rrd_dir'] . "/" . $port['hostname'] . "/port-" . safename($port['ifIndex'] . ".rrd");
|
||||
$rrd_list[$i]['descr'] = $port['hostname'] . " " . $port['ifDescr'];
|
||||
|
@ -38,7 +38,7 @@ if (1)
|
||||
|
||||
include("includes/graphs/generic_multi_seperated.inc.php");
|
||||
}
|
||||
elseif (is_file($config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename($port['ifIndex'] . ".rrd")))
|
||||
elseif (is_file($config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename($port['ifIndex'] . ".rrd")))
|
||||
{
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename($port['ifIndex'] . ".rrd");
|
||||
|
||||
|
@ -23,7 +23,7 @@ $rrd_options .= " AREA:sensor_min#ffffffff";
|
||||
# $rrd_options .= " AREA:sensorcold#CCCCFF";
|
||||
# $rrd_options .= " LINE1:sensor#cc0000:'" . str_replace(':','\:',str_replace('\*','*',quotemeta($sensor['sensor_descr_fixed'])))."'"; # Ugly hack :(
|
||||
|
||||
$rrd_options .= " LINE1.5:sensor#cc0000:'" . $sensor['sensor_descr_fixed']."'";
|
||||
$rrd_options .= " LINE1.5:sensor#cc0000:'" . $sensor['sensor_descr_fixed']."'";
|
||||
# $rrd_options .= " LINE1.5:sensorwarm#660000";
|
||||
$rrd_options .= " GPRINT:sensor_min:MIN:%4.1lfC";
|
||||
$rrd_options .= " GPRINT:sensor:LAST:%4.1lfC";
|
||||
|
@ -13,7 +13,7 @@ $rrd_options .= " COMMENT:' Size Free % Used\\n'";
|
||||
|
||||
$hostname = gethostbyid($storage['device_id']);
|
||||
|
||||
$colour="CC0000";
|
||||
$colour="CC0000";
|
||||
$colour_area="ffaaaa";
|
||||
|
||||
$descr = substr(str_pad($storage[storage_descr], 12),0,12);
|
||||
|
@ -2,18 +2,18 @@
|
||||
|
||||
if ($bg == $list_colour_b) { $bg = $list_colour_a; } else { $bg = $list_colour_b; }
|
||||
|
||||
if ($device['status'] == '0')
|
||||
if ($device['status'] == '0')
|
||||
{
|
||||
$class = "list-device-down";
|
||||
} else {
|
||||
$class = "list-device-down";
|
||||
} else {
|
||||
$class = "list-device";
|
||||
}
|
||||
if ($device['ignore'] == '1')
|
||||
if ($device['ignore'] == '1')
|
||||
{
|
||||
$class = "list-device-ignored";
|
||||
if ($device['status'] == '1')
|
||||
{
|
||||
$class = "list-device-ignored-up";
|
||||
if ($device['status'] == '1')
|
||||
{
|
||||
$class = "list-device-ignored-up";
|
||||
}
|
||||
}
|
||||
if ($device['disabled'] == '1')
|
||||
|
@ -2,18 +2,18 @@
|
||||
|
||||
if ($bg == $list_colour_b) { $bg = $list_colour_a; } else { $bg = $list_colour_b; }
|
||||
|
||||
if ($device['status'] == '0')
|
||||
if ($device['status'] == '0')
|
||||
{
|
||||
$class = "list-device-down";
|
||||
} else {
|
||||
$class = "list-device-down";
|
||||
} else {
|
||||
$class = "list-device";
|
||||
}
|
||||
if ($device['ignore'] == '1')
|
||||
if ($device['ignore'] == '1')
|
||||
{
|
||||
$class = "list-device-ignored";
|
||||
if ($device['status'] == '1')
|
||||
{
|
||||
$class = "list-device-ignored-up";
|
||||
if ($device['status'] == '1')
|
||||
{
|
||||
$class = "list-device-ignored-up";
|
||||
}
|
||||
}
|
||||
if ($device['disabled'] == '1')
|
||||
|
@ -9,7 +9,7 @@ $if_id = $port['interface_id'];
|
||||
|
||||
$port = ifLabel($port);
|
||||
|
||||
if($int_colour)
|
||||
if($int_colour)
|
||||
{
|
||||
$row_colour = $int_colour;
|
||||
} else {
|
||||
@ -40,7 +40,7 @@ unset ($break);
|
||||
|
||||
if ($port_details)
|
||||
{
|
||||
foreach (dbFetchRows("SELECT * FROM `ipv4_addresses` WHERE `interface_id` = ?", array($port['interface_id'])) as $ip)
|
||||
foreach (dbFetchRows("SELECT * FROM `ipv4_addresses` WHERE `interface_id` = ?", array($port['interface_id'])) as $ip)
|
||||
{
|
||||
echo("$break <a class=interface-desc href=\"javascript:popUp('/netcmd.php?cmd=whois&query=$ip[ipv4_address]')\">".$ip['ipv4_address']."/".$ip['ipv4_prefixlen']."</a>");
|
||||
$break = "<br />";
|
||||
@ -202,7 +202,7 @@ foreach (dbFetchRows("SELECT * FROM `pseudowires` WHERE `interface_id` = ?", arr
|
||||
#`interface_id`,`peer_device_id`,`peer_ldp_id`,`cpwVcID`,`cpwOid`
|
||||
$pw_peer_dev = dbFetchRow("SELECT * FROM `devices` WHERE `device_id` = ?", array($pseudowire['peer_device_id']));
|
||||
$pw_peer_int = dbFetchRow("SELECT * FROM `ports` AS I, pseudowires AS P WHERE I.device_id = ? AND P.cpwVcID = ? AND P.interface_id = I.interface_id", array($pseudowire['peer_device_id'], $pseudowire['cpwVcID']));
|
||||
|
||||
|
||||
$pw_peer_int = ifNameDescr($pw_peer_int);
|
||||
echo("$br<img src='images/16/arrow_switch.png' align=absmiddle><b> " . generate_port_link($pw_peer_int, makeshortif($pw_peer_int['label'])) ." on ". generate_device_link($pw_peer_dev, shorthost($pw_peer_dev['hostname'])) . "</b>");
|
||||
$br = "<br />";
|
||||
@ -223,7 +223,7 @@ if ($port['pagpGroupIfIndex'] && $port['pagpGroupIfIndex'] != $port['ifIndex'])
|
||||
|
||||
foreach(dbFetchRows("SELECT * FROM `ports_stack` WHERE `interface_id_low` = ? and `device_id` = ?", array($port['ifIndex'], $device['device_id'])) as $higher_if)
|
||||
{
|
||||
if($higher_if['interface_id_high'])
|
||||
if($higher_if['interface_id_high'])
|
||||
{
|
||||
$this_port = get_port_by_index_cache($device['device_id'], $higher_if['interface_id_high']);
|
||||
echo("$br<img src='images/16/arrow_divide.png' align=absmiddle> <strong>" . generate_port_link($this_port) . "</strong>");
|
||||
|
@ -61,10 +61,10 @@ foreach (dbFetchRows("SELECT * FROM `devices`") as $device)
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li><a href="devices/" class="drop"><img src="images/16/server.png" border="0" align="absmiddle" /> Devices</a>
|
||||
|
||||
<div class="dropdown_4columns"><!-- Begin 4 columns container -->
|
||||
@ -93,15 +93,15 @@ if ($_SESSION['userlevel'] >= '10') {
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="devices_chart" class="col_3" style="height: 300px";>
|
||||
|
||||
<div id="devices_chart" class="col_3" style="height: 300px";>
|
||||
</div>
|
||||
|
||||
<script class="code" type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
var data = [
|
||||
['Up', <?php echo($devices['up']); ?>],
|
||||
['Down', <?php echo($devices['down']); ?>],
|
||||
['Down', <?php echo($devices['down']); ?>],
|
||||
['Ignored', <?php echo($devices['ignored']); ?>],
|
||||
['Disabled', <?php echo($devices['disabled']); ?>]
|
||||
];
|
||||
@ -187,10 +187,10 @@ $(document).ready(function(){
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
</div><!-- End 4 columns container -->
|
||||
|
||||
</li><!-- End 4 columns Item -->
|
||||
|
||||
</div><!-- End 4 columns container -->
|
||||
|
||||
</li><!-- End 4 columns Item -->
|
||||
|
||||
<?php
|
||||
}
|
||||
@ -234,7 +234,7 @@ if ($config['show_locations'])
|
||||
<li><a href="ports/" class="drop"><img src="images/16/connect.png" border="0" align="absmiddle" /> Ports</a><!-- Begin Home Item -->
|
||||
|
||||
<div class="dropdown_4columns"><!-- Begin 2 columns container -->
|
||||
|
||||
|
||||
<div class="col_1">
|
||||
<ul>
|
||||
<li><a href="ports/"><img src="images/16/connect.png" border="0" align="absmiddle" /> All Ports</a></li>
|
||||
@ -294,10 +294,10 @@ if ($deleted_ports) { echo('<li><a href="deleted-ports/"><img src="images/16/cro
|
||||
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="ports_chart" class="col_3" style="height: 300px";>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script class="code" type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
@ -459,8 +459,8 @@ if ($_SESSION['userlevel'] >= '5' && ($routing_count['bgp']+$routing_count['ospf
|
||||
|
||||
|
||||
echo(' </ul>');
|
||||
?>
|
||||
|
||||
?>
|
||||
|
||||
</div><!-- End 4 columns container -->
|
||||
|
||||
</li><!-- End 4 columns Item -->
|
||||
@ -571,5 +571,5 @@ $netsnmp_version = shell_exec($config['snmpget'] . " --version");
|
||||
</div><!-- End 2 columns container -->
|
||||
|
||||
</li><!-- End Home Item -->
|
||||
|
||||
</ul>
|
||||
|
||||
</ul>
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
$affected = dbDelete('services', '`service_id` = ?', array($_POST['service']));
|
||||
|
||||
if($affected)
|
||||
if($affected)
|
||||
{
|
||||
$message .= $message_break . $rows . " service deleted!";
|
||||
$message_break .= "<br />";
|
||||
|
@ -38,11 +38,11 @@ foreach($_GET as $key=>$get_var) {
|
||||
$segments = explode('/', trim($_SERVER['PATH_INFO'], '/'));
|
||||
foreach($segments as $pos => $segment) {
|
||||
$segment = urldecode($segment);
|
||||
if($pos == "0")
|
||||
if($pos == "0")
|
||||
{
|
||||
$vars['page'] = $segment;
|
||||
} else {
|
||||
if(TRUE) // do this to keep everything working whilst we fiddle
|
||||
if(TRUE) // do this to keep everything working whilst we fiddle
|
||||
{
|
||||
if ($pos == "1")
|
||||
{
|
||||
@ -81,7 +81,7 @@ foreach($segments as $pos => $segment) {
|
||||
|
||||
foreach($_POST as $name => $value)
|
||||
{
|
||||
# if($value == "" || !isset($value))
|
||||
# if($value == "" || !isset($value))
|
||||
# {
|
||||
# } else {
|
||||
$vars[$name] = $value;
|
||||
@ -146,9 +146,9 @@ if ($config['page_refresh']) { echo("<meta http-equiv='refresh' content='".$conf
|
||||
<script type="text/javascript" src="js/jquery-1.5.2.min.js"></script>
|
||||
<script type="text/javascript" src="js/jquery-checkbox.js"></script>
|
||||
<script type="text/javascript" src="js/qtip/jquery.qtip-1.0.0-rc3.min.js"></script>
|
||||
<!--[if IE]>
|
||||
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
|
||||
<![endif]-->
|
||||
<!--[if IE]>
|
||||
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
|
||||
<![endif]-->
|
||||
<!--[if lt IE 9]><script language="javascript" type="text/javascript" src="js/jqplot/excanvas.js"></script><![endif]-->
|
||||
<script language="javascript" type="text/javascript" src="js/jqplot/jquery.jqplot.min.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="js/jqplot/jquery.jqplot.css" />
|
||||
@ -212,7 +212,7 @@ if ($config['page_refresh']) { echo("<meta http-equiv='refresh' content='".$conf
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
//-->
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
@ -231,7 +231,7 @@ function popUp(URL)
|
||||
|
||||
<?php
|
||||
|
||||
if(!$vars['bare'] == "yes") {
|
||||
if(!$vars['bare'] == "yes") {
|
||||
|
||||
include("includes/".$config['web_header']);
|
||||
|
||||
@ -246,7 +246,7 @@ if(!$vars['bare'] == "yes") {
|
||||
<?php
|
||||
|
||||
### To help debug the new URLs :)
|
||||
if($devel || $vars['devel'])
|
||||
if($devel || $vars['devel'])
|
||||
{
|
||||
echo("<pre>");
|
||||
print_r($_GET);
|
||||
|
@ -155,7 +155,7 @@ print_optionbar_end();
|
||||
<a href="http://www.facebook.com/pages/Observer/128354461353">Facebook</a>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
<h3>Observium is a Free, Open project. Please donate to support continued development.</h3>
|
||||
|
||||
<div style="margin-top:10px;">
|
||||
|
@ -18,13 +18,13 @@ else
|
||||
{
|
||||
if (!user_exists($_POST['new_username']))
|
||||
{
|
||||
|
||||
|
||||
if (isset($_POST['can_modify_passwd'])) {
|
||||
$_POST['can_modify_passwd'] = 1;
|
||||
} else {
|
||||
$_POST['can_modify_passwd'] = 0;
|
||||
}
|
||||
|
||||
|
||||
# FIXME: missing email field here on the form
|
||||
if (adduser($_POST['new_username'], $_POST['new_password'], $_POST['new_level'], '', $_POST['realname'], $_POST['can_modify_passwd']))
|
||||
{
|
||||
|
@ -61,7 +61,7 @@ if (bill_permitted($bill_id))
|
||||
$unixfrom = dbFetchCell("SELECT UNIX_TIMESTAMP('$datefrom')");
|
||||
$unixto = dbFetchCell("SELECT UNIX_TIMESTAMP('$dateto')");
|
||||
|
||||
$unix_prev_from = dbFetchCell("SELECT UNIX_TIMESTAMP('$lastfrom')");
|
||||
$unix_prev_from = dbFetchCell("SELECT UNIX_TIMESTAMP('$lastfrom')");
|
||||
$unix_prev_to = dbFetchCell("SELECT UNIX_TIMESTAMP('$lastto')");
|
||||
|
||||
echo("<font face=\"Verdana, Arial, Sans-Serif\"><h2>
|
||||
|
@ -18,18 +18,18 @@ if ($_POST['action'] == "delete_bill" && $_POST['confirm'] == "confirm")
|
||||
echo("<meta http-equiv='Refresh' content=\"2; url='bills/'\">");
|
||||
}
|
||||
|
||||
if ($_POST['action'] == "add_bill_port")
|
||||
{
|
||||
if ($_POST['action'] == "add_bill_port")
|
||||
{
|
||||
dbInsert(array('bill_id' => $_POST['bill_id'], 'port_id' => $_POST['interface_id']), 'bill_ports');
|
||||
}
|
||||
if ($_POST['action'] == "delete_bill_port")
|
||||
{
|
||||
if ($_POST['action'] == "delete_bill_port")
|
||||
{
|
||||
dbDelete('bill_ports', "`bill_id` = ? AND `port_id` = ?", array($bill_id, $_POST['interface_id']));
|
||||
}
|
||||
if ($_POST['action'] == "update_bill")
|
||||
{
|
||||
|
||||
if (dbUpdate(array('bill_name' => $_POST['bill_name'], 'bill_day' => $_POST['bill_day'], 'bill_gb' => $_POST['bill_gb'],
|
||||
if (dbUpdate(array('bill_name' => $_POST['bill_name'], 'bill_day' => $_POST['bill_day'], 'bill_gb' => $_POST['bill_gb'],
|
||||
'bill_cdr' => $_POST['bill_cdr'], 'bill_type' => $_POST['bill_type']), 'bills', '`bill_id` = ?', array($bill_id)))
|
||||
{
|
||||
print_message("Bill Properties Updated");
|
||||
|
@ -117,7 +117,7 @@ if (device_permitted($vars['device']) || $check_device == $vars['device'])
|
||||
|
||||
$device_routing_count['bgp'] = dbFetchCell("SELECT COUNT(*) FROM `bgpPeers` WHERE `device_id` = ?", array($device['device_id']));
|
||||
if ($device_routing_count['bgp']) { $routing_tabs[] = 'bgp'; }
|
||||
|
||||
|
||||
$device_routing_count['ospf'] = dbFetchCell("SELECT COUNT(*) FROM `ospf_ports` WHERE `device_id` = ?", array($device['device_id']));
|
||||
if ($device_routing_count['ospf']) { $routing_tabs[] = 'ospf'; }
|
||||
|
||||
@ -127,7 +127,7 @@ if (device_permitted($vars['device']) || $check_device == $vars['device'])
|
||||
$device_routing_count['vrf'] = @dbFetchCell("SELECT COUNT(*) FROM `vrfs` WHERE `device_id` = ?", array($device['device_id']));
|
||||
if($device_routing_count['vrf']) { $routing_tabs[] = 'vrf'; }
|
||||
|
||||
if (is_array($routing_tabs))
|
||||
if (is_array($routing_tabs))
|
||||
{
|
||||
echo('<li class="' . $select['routing'] . '">
|
||||
<a href="'.generate_device_url($device, array('tab' => 'routing')).'">
|
||||
@ -219,7 +219,7 @@ if (device_permitted($vars['device']) || $check_device == $vars['device'])
|
||||
}
|
||||
|
||||
if ($config['nfsen_enable'])
|
||||
{
|
||||
{
|
||||
if (!is_array($config['nfsen_rrds'])) { $config['nfsen_rrds'] = array($config['nfsen_rrds']); }
|
||||
foreach ($config['nfsen_rrds'] as $nfsenrrds)
|
||||
{
|
||||
|
@ -1,10 +1,5 @@
|
||||
<?php
|
||||
|
||||
## Who the fuck wrote this? it's like it was written by a retard challenged
|
||||
## to use as many string manipulation functions as possible.
|
||||
|
||||
|
||||
|
||||
# Load our list of available applications
|
||||
if ($handle = opendir($config['install_dir'] . "/includes/polling/applications/"))
|
||||
{
|
||||
|
@ -3,10 +3,10 @@
|
||||
if($_POST['toggle_poller'] && isset($config['poller_modules'][$_POST['toggle_poller']]))
|
||||
{
|
||||
$module = mres($_POST['toggle_poller']);
|
||||
if (isset($attribs['poll_'.$module]) && $attribs['poll_'.$module] != $config['poller_modules'][$_POST['toggle_poller']])
|
||||
if (isset($attribs['poll_'.$module]) && $attribs['poll_'.$module] != $config['poller_modules'][$_POST['toggle_poller']])
|
||||
{
|
||||
del_dev_attrib($device, 'poll_' . $module);
|
||||
} elseif ($config['poller_modules'][$_POST['toggle_poller']] == 0) {
|
||||
} elseif ($config['poller_modules'][$_POST['toggle_poller']] == 0) {
|
||||
set_dev_attrib($device, 'poll_' . $module, "1");
|
||||
} else {
|
||||
set_dev_attrib($device, 'poll_' . $module, "0");
|
||||
|
@ -14,7 +14,7 @@ if ($_POST['editing'])
|
||||
$update = array('community' => $_POST['community'], 'snmpver' => $_POST['snmpver'], 'port' => $_POST['port']);
|
||||
if ($_POST['timeout']) { $update['timeout'] = $_POST['timeout']; } else { $update['timeout'] = array(NULL); }
|
||||
if ($_POST['retries']) { $update['retries'] = $_POST['retries']; } else { $update['retries'] = array(NULL); }
|
||||
|
||||
|
||||
$rows_updated = dbUpdate($update, 'devices', '`device_id` = ?',array($device['device_id']));
|
||||
|
||||
if ($rows_updated > 0)
|
||||
|
@ -37,9 +37,9 @@ foreach ($config['graph_sections'] as $section)
|
||||
|
||||
echo(generate_link(ucfirst($type),$link_array,array('group'=>$type)));
|
||||
|
||||
if ($vars['group'] == $type)
|
||||
{
|
||||
echo("</span>");
|
||||
if ($vars['group'] == $type)
|
||||
{
|
||||
echo("</span>");
|
||||
}
|
||||
$sep = " | ";
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ foreach (dbFetchRows("SELECT * FROM `ucd_diskio` WHERE device_id = ? ORDER BY di
|
||||
$graph_array_zoom['height'] = "125";
|
||||
$graph_array_zoom['from'] = $config['time']['twoday'];
|
||||
$graph_array_zoom['to'] = $config['time']['now'];
|
||||
|
||||
|
||||
|
||||
echo("<tr bgcolor='$row_colour'><th>");
|
||||
echo(overlib_link($fs_url, $drive['diskio_descr'], generate_graph_tag($graph_array_zoom), NULL));
|
||||
|
@ -7,7 +7,7 @@ $datas = array(
|
||||
);
|
||||
|
||||
foreach ($datas as $name=>$type)
|
||||
{
|
||||
{
|
||||
$graph_title = $name;
|
||||
$graph_type = "device_".$type;
|
||||
include("includes/print-device-graph.php");
|
||||
|
@ -14,7 +14,7 @@ print_optionbar_start();
|
||||
|
||||
echo("Polling Interval: ");
|
||||
|
||||
foreach(array(0.25, 1, 2, 5, 15, 60) as $interval)
|
||||
foreach(array(0.25, 1, 2, 5, 15, 60) as $interval)
|
||||
{
|
||||
echo($thinger);
|
||||
if ($vars['interval'] == $interval) { echo("<span class='pagemenu-selected'>"); }
|
||||
|
@ -18,7 +18,7 @@ foreach(dbFetchRows("SELECT * FROM links AS L, ports AS I WHERE I.device_id = ?
|
||||
echo('<tr bgcolor="'.$bg_colour.'">');
|
||||
echo('<td><span style="font-weight: bold;">'.generate_port_link($neighbour).'</span><br />'.$neighbour['ifAlias'].'</td>');
|
||||
|
||||
if(is_numeric($neighbour['remote_interface_id']) && $neighbour['remote_interface_id'])
|
||||
if(is_numeric($neighbour['remote_interface_id']) && $neighbour['remote_interface_id'])
|
||||
{
|
||||
$remote_port = get_port_by_id($neighbour['remote_interface_id']);
|
||||
$remote_device = device_by_id_cache($remote_port['device_id']);
|
||||
|
@ -48,7 +48,7 @@ foreach (dbFetchRows("SELECT * FROM `cef_switching` WHERE `device_id` = ? ORDER
|
||||
|
||||
$interval = $cef['updated'] - $cef['updated_prev'];
|
||||
|
||||
if(!$entity['entPhysicalModelName'] && $entity['entPhysicalContainedIn'])
|
||||
if(!$entity['entPhysicalModelName'] && $entity['entPhysicalContainedIn'])
|
||||
{
|
||||
$parent_entity = dbFetchRow("SELECT * FROM `entPhysical` WHERE device_id = ? AND `entPhysicalIndex` = ?", array($device['device_id'], $entity['entPhysicalContainedIn']));
|
||||
$entity_descr = $entity['entPhysicalName'] . " (" . $parent_entity['entPhysicalModelName'] .")";
|
||||
|
@ -4,7 +4,7 @@ include("includes/geshi/geshi.php");
|
||||
|
||||
if ($_SESSION['userlevel'] >= "7")
|
||||
{
|
||||
|
||||
|
||||
if (!is_array($config['rancid_configs'])) { $config['rancid_configs'] = array($config['rancid_configs']); }
|
||||
|
||||
foreach ($config['rancid_configs'] as $configs)
|
||||
@ -12,13 +12,13 @@ if ($_SESSION['userlevel'] >= "7")
|
||||
if ($configs[strlen($configs)-1] != '/') { $configs .= '/'; }
|
||||
if (is_file($configs . $device['hostname'])) { $file = $configs . $device['hostname']; }
|
||||
}
|
||||
|
||||
|
||||
echo('<div style="clear: both;">');
|
||||
|
||||
print_optionbar_start('', '');
|
||||
|
||||
echo("<span style='font-weight: bold;'>Config</span> » ");
|
||||
|
||||
|
||||
if (!$_GET['optc']) {
|
||||
echo('<span class="pagemenu-selected">');
|
||||
echo("<a href='device/".$device['device_id']."/showconfig/'> Latest</a>");
|
||||
@ -26,29 +26,29 @@ if ($_SESSION['userlevel'] >= "7")
|
||||
} else {
|
||||
echo("<a href='device/".$device['device_id']."/showconfig/'> Latest</a>");
|
||||
}
|
||||
|
||||
|
||||
if (function_exists('svn_log')) {
|
||||
|
||||
|
||||
$sep = " | ";
|
||||
$svnlogs = svn_log($file, SVN_REVISION_HEAD, NULL, 5);
|
||||
$revlist = array();
|
||||
|
||||
|
||||
foreach ($svnlogs as $svnlog) {
|
||||
|
||||
|
||||
echo($sep);
|
||||
$revlist[] = $svnlog["rev"];
|
||||
|
||||
|
||||
if ($_GET['optc'] == $svnlog["rev"]) { echo('<span class="pagemenu-selected">'); }
|
||||
|
||||
|
||||
echo("<a href='device/".$device['device_id']."/showconfig/" . $svnlog["rev"] . "/'> r" . $svnlog["rev"] ." <small>". date("d M H:i", strtotime($svnlog["date"])) . "</small></a>");
|
||||
if ($_GET['optc'] == $svnlog["rev"]) { echo("</span>"); }
|
||||
|
||||
|
||||
$sep = " | ";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
print_optionbar_end();
|
||||
|
||||
|
||||
if (function_exists('svn_log') && in_array($_GET['optc'], $revlist)) {
|
||||
list($diff, $errors) = svn_diff($file, $_GET['optc']-1, $file, $_GET['optc']);
|
||||
if (!$diff) {
|
||||
@ -59,7 +59,7 @@ if ($_SESSION['userlevel'] >= "7")
|
||||
fclose($diff);
|
||||
fclose($errors);
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
$fh = fopen($file, 'r') or die("Can't open file");
|
||||
$text = fread($fh, filesize($file));
|
||||
|
@ -9,7 +9,7 @@ echo("
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/vlans/bits/'>Bits</a> |
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/vlans/pkts/'>Packets</a> |
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/vlans/nupkts/'>NU Packets</a> |
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/vlans/errors/'>Errors</a>
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/vlans/errors/'>Errors</a>
|
||||
");
|
||||
|
||||
print_optionbar_end();
|
||||
|
@ -130,7 +130,7 @@ foreach(dbFetch('SELECT `type` FROM `devices` AS D WHERE 1 GROUP BY `type` ORDER
|
||||
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="<?php echo(generate_url($vars)); ?>" title="Update the browser URL to reflect the search criteria." >Update URL</a> |
|
||||
<a href="<?php echo(generate_url($vars)); ?>" title="Update the browser URL to reflect the search criteria." >Update URL</a> |
|
||||
<a href="<?php echo(generate_url(array('page' => 'devices', 'section' => $vars['section'], 'bare' => $vars['bare']))); ?>" title="Reset critera to default." >Reset</a>
|
||||
<br />
|
||||
<input class="submit" type="submit" class="submit" value="Search">
|
||||
@ -141,7 +141,7 @@ foreach(dbFetch('SELECT `type` FROM `devices` AS D WHERE 1 GROUP BY `type` ORDER
|
||||
|
||||
<hr />
|
||||
|
||||
<?php
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
@ -168,7 +168,7 @@ foreach ($menu_options as $option => $text)
|
||||
|
||||
?>
|
||||
|
||||
|
|
||||
|
|
||||
|
||||
<span style="font-weight: bold;">Graphs</span> »
|
||||
|
||||
|
@ -82,7 +82,7 @@ if (filter_var($config['uptime_warning'], FILTER_VALIDATE_FLOAT) !== FALSE && $c
|
||||
{
|
||||
$sql = mysql_query("SELECT * FROM `devices` AS D WHERE D.status = '1' AND D.uptime < '" . $config['uptime_warning'] . "' AND D.ignore = 0");
|
||||
} else {
|
||||
$sql = mysql_query("SELECT * FROM `devices` AS D, devices_perms AS P WHERE D.device_id = P.device_id AND P.user_id = '" . $_SESSION['user_id'] . "' AND D.status = '1' AND D.uptime < '" .
|
||||
$sql = mysql_query("SELECT * FROM `devices` AS D, devices_perms AS P WHERE D.device_id = P.device_id AND P.user_id = '" . $_SESSION['user_id'] . "' AND D.status = '1' AND D.uptime < '" .
|
||||
$config['uptime_warning'] . "' AND D.ignore = 0");
|
||||
}
|
||||
|
||||
|
@ -7,11 +7,11 @@
|
||||
|
||||
echo("<table><tr>");
|
||||
|
||||
$dev_list = array('6' => 'Central Fileserver',
|
||||
'7' => 'NE61 Fileserver',
|
||||
$dev_list = array('6' => 'Central Fileserver',
|
||||
'7' => 'NE61 Fileserver',
|
||||
'34' => 'DE56 Fileserver');
|
||||
|
||||
foreach($dev_list as $device_id => $descr)
|
||||
foreach($dev_list as $device_id => $descr)
|
||||
{
|
||||
|
||||
echo("<td>");
|
||||
@ -139,9 +139,9 @@ while ($peer = mysql_fetch_array($sql))
|
||||
}
|
||||
}
|
||||
|
||||
if (filter_var($config['uptime_warning'], FILTER_VALIDATE_FLOAT) !== FALSE && $config['uptime_warning'] > 0)
|
||||
if (filter_var($config['uptime_warning'], FILTER_VALIDATE_FLOAT) !== FALSE && $config['uptime_warning'] > 0)
|
||||
{
|
||||
$sql = mysql_query("SELECT * FROM devices_attribs AS A, `devices` AS D WHERE
|
||||
$sql = mysql_query("SELECT * FROM devices_attribs AS A, `devices` AS D WHERE
|
||||
A.attrib_value < '" . $config['uptime_warning'] . "' AND A.attrib_type = 'uptime' AND A.device_id = D.device_id AND ignore = '0' AND disabled = '0'");
|
||||
while ($device = mysql_fetch_array($sql))
|
||||
{
|
||||
|
@ -74,7 +74,7 @@ while ($peer = mysql_fetch_assoc($sql)){
|
||||
|
||||
}
|
||||
|
||||
if (filter_var($config['uptime_warning'], FILTER_VALIDATE_FLOAT) !== FALSE && $config['uptime_warning'] > 0)
|
||||
if (filter_var($config['uptime_warning'], FILTER_VALIDATE_FLOAT) !== FALSE && $config['uptime_warning'] > 0)
|
||||
{
|
||||
$sql = mysql_query("SELECT * FROM `devices` AS D, devices_attribs AS A WHERE A.device_id = D.device_id AND A.attrib_type = 'uptime' AND A.attrib_value < '" . $config['uptime_warning'] . "'");
|
||||
while ($device = mysql_fetch_assoc($sql)){
|
||||
|
@ -7,7 +7,7 @@
|
||||
$nodes = array();
|
||||
|
||||
$uptimesql = "";
|
||||
if (filter_var($config['uptime_warning'], FILTER_VALIDATE_FLOAT) !== FALSE && $config['uptime_warning'] > 0)
|
||||
if (filter_var($config['uptime_warning'], FILTER_VALIDATE_FLOAT) !== FALSE && $config['uptime_warning'] > 0)
|
||||
{
|
||||
$uptimesql = " AND A.attrib_value < '" . $config['uptime_warning'] . "'";
|
||||
}
|
||||
@ -79,7 +79,7 @@ while ($peer = mysql_fetch_assoc($sql)){
|
||||
}
|
||||
}
|
||||
|
||||
if (filter_var($config['uptime_warning'], FILTER_VALIDATE_FLOAT) !== FALSE && $config['uptime_warning'] > 0)
|
||||
if (filter_var($config['uptime_warning'], FILTER_VALIDATE_FLOAT) !== FALSE && $config['uptime_warning'] > 0)
|
||||
{
|
||||
$sql = mysql_query("SELECT * FROM devices_attribs AS A, `devices` AS D WHERE A.attrib_value < '" . $config['uptime_warning'] . "' AND A.attrib_type = 'uptime' AND A.device_id = D.device_id AND ignore = '0' AND disabled = '0'");
|
||||
while ($device = mysql_fetch_assoc($sql)){
|
||||
|
@ -7,7 +7,7 @@
|
||||
$nodes = array();
|
||||
$param = array();
|
||||
$uptimesql = "";
|
||||
if (filter_var($config['uptime_warning'], FILTER_VALIDATE_FLOAT) !== FALSE && $config['uptime_warning'] > 0)
|
||||
if (filter_var($config['uptime_warning'], FILTER_VALIDATE_FLOAT) !== FALSE && $config['uptime_warning'] > 0)
|
||||
{
|
||||
$uptimesql = " AND A.attrib_value < ?";
|
||||
$param = array($config['uptime_warning']);
|
||||
@ -79,7 +79,7 @@ foreach (dbFetchRows("SELECT * FROM `devices` AS D, bgpPeers AS B WHERE bgpPeerA
|
||||
}
|
||||
}
|
||||
|
||||
if (filter_var($config['uptime_warning'], FILTER_VALIDATE_FLOAT) !== FALSE && $config['uptime_warning'] > 0)
|
||||
if (filter_var($config['uptime_warning'], FILTER_VALIDATE_FLOAT) !== FALSE && $config['uptime_warning'] > 0)
|
||||
{
|
||||
foreach (dbFetchRows("SELECT * FROM devices_attribs AS A, `devices` AS D WHERE A.attrib_value < ? AND A.attrib_type = 'uptime' AND A.device_id = D.device_id AND ignore = '0' AND disabled = '0'", array($config['uptime_warning'])) as $device){
|
||||
if (device_permitted($device['device_id']) && $device['attrib_value'] < $config['uptime_warning'] && $device['attrib_type'] == "uptime") {
|
||||
|
@ -8,7 +8,7 @@ if($_SESSION['widescreen'])
|
||||
{
|
||||
$graph_width=1700;
|
||||
$thumb_width=180;
|
||||
} else {
|
||||
} else {
|
||||
$graph_width=1075;
|
||||
$thumb_width=113;
|
||||
}
|
||||
@ -79,7 +79,7 @@ if (!$auth)
|
||||
|
||||
$graph_array['height'] = "300";
|
||||
$graph_array['width'] = $graph_width;
|
||||
|
||||
|
||||
echo generate_graph_js_state($graph_array);
|
||||
|
||||
echo("<div style='width: ".$graph_array['width']."; margin: auto;'>");
|
||||
|
@ -39,7 +39,7 @@ foreach ($datas as $texttype)
|
||||
echo($sep);
|
||||
if ($vars['metric'] == $metric)
|
||||
{
|
||||
echo("<span class='pagemenu-selected'>");
|
||||
echo("<span class='pagemenu-selected'>");
|
||||
}
|
||||
|
||||
echo(generate_link($type_text[$metric],$link_array,array('metric'=> $metric, 'view' => $vars['view'])));
|
||||
@ -72,16 +72,16 @@ if ($vars['view'] != "graphs")
|
||||
|
||||
echo(generate_link("No Graphs",$link_array,array('metric'=> $vars['metric'], 'view' => "detail")));
|
||||
|
||||
if ($vars['view'] != "graphs")
|
||||
{
|
||||
echo('</span>');
|
||||
if ($vars['view'] != "graphs")
|
||||
{
|
||||
echo('</span>');
|
||||
}
|
||||
|
||||
echo('</div>');
|
||||
|
||||
print_optionbar_end();
|
||||
|
||||
if (in_array($vars['metric'],array_keys($used_sensors))
|
||||
if (in_array($vars['metric'],array_keys($used_sensors))
|
||||
|| $vars['metric'] == 'processor'
|
||||
|| $vars['metric'] == 'storage'
|
||||
|| $vars['metric'] == 'mempool')
|
||||
|
@ -9,7 +9,7 @@ foreach (explode(",", $vars['type']) as $type)
|
||||
{
|
||||
$type_where .= " $or `port_descr_type` = ?";
|
||||
$or = "OR";
|
||||
$type_param[] = $type;
|
||||
$type_param[] = $type;
|
||||
}
|
||||
|
||||
$type_where .= ") ";
|
||||
|
@ -58,7 +58,7 @@ if ($_SESSION['userlevel'] >= '5')
|
||||
if (isset($_POST['string']) && strlen($_POST['string']))
|
||||
{
|
||||
$sql .= " AND E.entPhysicalDescr LIKE ?";
|
||||
$param[] = "%".$_POST['string']."%";
|
||||
$param[] = "%".$_POST['string']."%";
|
||||
}
|
||||
|
||||
if (isset($_POST['device_string']) && strlen($_POST['device_string']))
|
||||
|
@ -163,9 +163,9 @@ foreach ($menu_options as $option => $text)
|
||||
}
|
||||
?>
|
||||
|
||||
|
|
||||
|
|
||||
|
||||
<span style="font-weight: bold;">Graphs</span> »
|
||||
<span style="font-weight: bold;">Graphs</span> »
|
||||
|
||||
<?php
|
||||
|
||||
@ -193,7 +193,7 @@ foreach ($menu_options as $option => $text)
|
||||
echo('<div style="float: right;">');
|
||||
?>
|
||||
|
||||
<a href="<?php echo(generate_url($vars)); ?>" title="Update the browser URL to reflect the search criteria." >Update URL</a> |
|
||||
<a href="<?php echo(generate_url($vars)); ?>" title="Update the browser URL to reflect the search criteria." >Update URL</a> |
|
||||
|
||||
<?php
|
||||
if($vars['searchbar'] == "hide")
|
||||
|
@ -22,7 +22,7 @@ foreach (dbFetchRows("SELECT * FROM pseudowires AS P, ports AS I, devices AS D W
|
||||
$i++;
|
||||
}
|
||||
|
||||
$pw_b = dbFetchRow("SELECT * from `devices` AS D, `ports` AS I, `pseudowires` AS P WHERE D.device_id = ? AND D.device_id = I.device_id
|
||||
$pw_b = dbFetchRow("SELECT * from `devices` AS D, `ports` AS I, `pseudowires` AS P WHERE D.device_id = ? AND D.device_id = I.device_id
|
||||
AND P.cpwVcID = ? AND P.interface_id = I.interface_id", array($pw_a['peer_device_id'], $pw_a['cpwVcID']));
|
||||
|
||||
if (!port_permitted($pw_a['interface_id'])) { $skip = "yes"; }
|
||||
|
@ -170,7 +170,7 @@ else
|
||||
case 'prefixes_ipv6multicast':
|
||||
list(,$afisafi) = explode("_", $_GET['optc']);
|
||||
if (isset($peer['afisafi'][$afisafi])) { $peer['graph'] = 1; }
|
||||
case 'updates':
|
||||
case 'updates':
|
||||
$graph_array['type'] = "bgp_" . $_GET['optc'];
|
||||
$graph_array['id'] = $peer['bgpPeer_id'];
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
foreach ($datas as $type)
|
||||
{
|
||||
if($type != "overview")
|
||||
if($type != "overview")
|
||||
{
|
||||
if(is_file("pages/routing/overview/".mres($type).".inc.php")) {
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
if ($_SESSION['userlevel'] >= '5') {
|
||||
if ($_SESSION['userlevel'] >= '5') {
|
||||
|
||||
if(!isset($_GET['optb'])) { $_GET['optb'] = "all"; }
|
||||
if(!isset($_GET['optc'])) { $_GET['optc'] = "basic"; }
|
||||
@ -36,7 +36,7 @@ if ($_SESSION['userlevel'] >= '5') {
|
||||
if ($_GET['opta'] == "vrf" && $_GET['optc'] == "errors") { echo("<span class='pagemenu-selected'>"); }
|
||||
echo('<a href="routing/vrf/'.$_GET['optb'].'/errors/">Errors</a>');
|
||||
if ($_GET['opta'] == "vrf" && $_GET['optc'] == "errors") { echo("</span>"); }
|
||||
|
||||
|
||||
echo(" )");
|
||||
|
||||
print_optionbar_end();
|
||||
|
@ -43,14 +43,14 @@ $query = "SELECT * FROM `ports` AS P, `devices` AS D WHERE P.device_id = D.devic
|
||||
$query .= "AND `ifPhysAddress` LIKE ?";
|
||||
$param = array("%".str_replace(':','',mres($_POST['address']))."%");
|
||||
|
||||
if (is_numeric($_POST['device_id']))
|
||||
{
|
||||
$query .= " AND I.device_id = ?";
|
||||
$param[] = $_POST['device_id'];
|
||||
if (is_numeric($_POST['device_id']))
|
||||
{
|
||||
$query .= " AND I.device_id = ?";
|
||||
$param[] = $_POST['device_id'];
|
||||
}
|
||||
if ($_POST['interface'])
|
||||
{
|
||||
$query .= " AND I.ifDescr LIKE ?";
|
||||
if ($_POST['interface'])
|
||||
{
|
||||
$query .= " AND I.ifDescr LIKE ?";
|
||||
$param[] = $_POST['interface'];
|
||||
}
|
||||
$query .= " ORDER BY P.ifPhysAddress";
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php
|
||||
|
||||
print_optionbar_start();
|
||||
|
||||
@ -72,7 +72,7 @@ if ($_SESSION['userlevel'] >= '5')
|
||||
}
|
||||
}
|
||||
unset ($samehost);
|
||||
}
|
||||
}
|
||||
|
||||
echo("</table></div>");
|
||||
|
||||
|
@ -50,7 +50,7 @@ function getDates($dayofmonth)
|
||||
{
|
||||
$lastmonth = 10;
|
||||
$lastyear = $year - 1;
|
||||
} elseif ($lastmonth == 0)
|
||||
} elseif ($lastmonth == 0)
|
||||
{
|
||||
$lastmonth = 11;
|
||||
$lastyear = $year - 1;
|
||||
|
@ -3,7 +3,7 @@
|
||||
## Common Functions
|
||||
|
||||
function isCli() {
|
||||
|
||||
|
||||
if(php_sapi_name() == 'cli' && empty($_SERVER['REMOTE_ADDR'])) {
|
||||
return true;
|
||||
} else {
|
||||
@ -66,7 +66,7 @@ function get_sensor_rrd($device, $sensor)
|
||||
global $config;
|
||||
|
||||
# For IPMI, sensors tend to change order, and there is no index, so we prefer to use the description as key here.
|
||||
if ($config['os'][$device['os']]['sensor_descr'] || $sensor['poller_type'] == "ipmi")
|
||||
if ($config['os'][$device['os']]['sensor_descr'] || $sensor['poller_type'] == "ipmi")
|
||||
{
|
||||
$rrd_file = $config['rrd_dir']."/".$device['hostname']."/".safename("sensor-".$sensor['sensor_class']."-".$sensor['sensor_type']."-".$sensor['sensor_descr'] . ".rrd");
|
||||
} else {
|
||||
|
@ -3,25 +3,25 @@
|
||||
* Color.php
|
||||
*
|
||||
* PHP version 4
|
||||
*
|
||||
*
|
||||
* Copyright (c) 2007 Stefan Walk
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to
|
||||
* deal in the Software without restriction, including without limitation the
|
||||
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
* sell copies of the Software, and to permit persons to whom the Software is
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to
|
||||
* deal in the Software without restriction, including without limitation the
|
||||
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
* sell copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*
|
||||
* @category Console
|
||||
@ -68,11 +68,11 @@ $GLOBALS['_CONSOLE_COLOR_CODES'] = array (
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* A simple class to use ANSI Colorcodes.
|
||||
*
|
||||
* Of all the functions, you probably only want to use convert() and escape().
|
||||
* Of all the functions, you probably only want to use convert() and escape().
|
||||
* They are easier to use. However, if you want to access colorcodes more
|
||||
* directly, look into the other functions.
|
||||
*
|
||||
@ -87,14 +87,14 @@ class Console_Color
|
||||
|
||||
/**
|
||||
* Returns an ANSI-Controlcode
|
||||
*
|
||||
*
|
||||
* Takes 1 to 3 Arguments: either 1 to 3 strings containing the name of the
|
||||
* FG Color, style and BG color, or one array with the indices color, style
|
||||
* or background.
|
||||
*
|
||||
* @param mixed $color Optional.
|
||||
* Either a string with the name of the foreground
|
||||
* color, or an array with the indices 'color',
|
||||
* color, or an array with the indices 'color',
|
||||
* 'style', 'background' and corresponding names as
|
||||
* values.
|
||||
* @param string $style Optional name of the style
|
||||
@ -150,7 +150,7 @@ class Console_Color
|
||||
$colors = &$GLOBALS['_CONSOLE_COLOR_CODES'];
|
||||
return "\033[".$colors['color'][$name].'m';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a style controlcode
|
||||
*
|
||||
@ -164,7 +164,7 @@ class Console_Color
|
||||
$colors = &$GLOBALS['_CONSOLE_COLOR_CODES'];
|
||||
return "\033[".$colors['style'][$name].'m';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a BG color controlcode
|
||||
*
|
||||
@ -183,7 +183,7 @@ class Console_Color
|
||||
* Converts colorcodes in the format %y (for yellow) into ansi-control
|
||||
* codes. The conversion table is: ('bold' meaning 'light' on some
|
||||
* terminals). It's almost the same conversion table irssi uses.
|
||||
* <pre>
|
||||
* <pre>
|
||||
* text text background
|
||||
* ------------------------------------------------
|
||||
* %k %K %0 black dark grey black
|
||||
@ -273,13 +273,13 @@ class Console_Color
|
||||
|
||||
/**
|
||||
* Escapes % so they don't get interpreted as color codes
|
||||
*
|
||||
*
|
||||
* @param string $string String to escape
|
||||
*
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
function escape($string)
|
||||
function escape($string)
|
||||
{
|
||||
return str_replace('%', '%%', $string);
|
||||
}
|
||||
@ -292,7 +292,7 @@ class Console_Color
|
||||
* @acess public
|
||||
* @return string
|
||||
*/
|
||||
function strip($string)
|
||||
function strip($string)
|
||||
{
|
||||
return preg_replace('/\033\[[\d;]+m/', '', $string);
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ This code is covered by the MIT license http://en.wikipedia.org/wiki/MIT_License
|
||||
|
||||
By Alan Szlosek from http://www.greaterscope.net/projects/dbFacile
|
||||
|
||||
The non-OO version of dbFacile. It's a bit simplistic, but gives you the
|
||||
The non-OO version of dbFacile. It's a bit simplistic, but gives you the
|
||||
really useful bits in non-class form.
|
||||
|
||||
Usage
|
||||
@ -177,7 +177,7 @@ function dbFetchRows($sql, $parameters = array()) {
|
||||
$db_stats['fetchrows']++;
|
||||
|
||||
// no records, thus return empty array
|
||||
// which should evaluate to false, and will prevent foreach notices/warnings
|
||||
// which should evaluate to false, and will prevent foreach notices/warnings
|
||||
return array();
|
||||
}
|
||||
/*
|
||||
@ -318,7 +318,7 @@ function dbMakeQuery($sql, $parameters) {
|
||||
if($test == '?') {
|
||||
$query .= array_shift($questionParams);
|
||||
} else {
|
||||
$query .= $namedParams[ $test ];
|
||||
$query .= $namedParams[ $test ];
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -339,7 +339,7 @@ function dbPrepareData($data) {
|
||||
$value = array_shift($value);
|
||||
}
|
||||
// it's not right to worry about invalid fields in this method because we may be operating on fields
|
||||
// that are aliases, or part of other tables through joins
|
||||
// that are aliases, or part of other tables through joins
|
||||
//if(!in_array($key, $columns)) // skip invalid fields
|
||||
// continue;
|
||||
if($escape) {
|
||||
@ -384,7 +384,7 @@ function dbRollbackTransaction() {
|
||||
class dbIterator implements Iterator {
|
||||
private $result;
|
||||
private $i;
|
||||
|
||||
|
||||
public function __construct($r) {
|
||||
$this->result = $r;
|
||||
$this->i = 0;
|
||||
|
@ -116,7 +116,7 @@ $warn_colour_b = "#ffcccc";
|
||||
#$config['graph_colours']['blues'] = array("b5d7ff","6eb7ff","0064ff","0082ff","0019d5","0016cb","00007d"); ## Cold Blues
|
||||
|
||||
$config['graph_colours']['mixed'] = array('CC0000','008C00','4096EE','73880A','D01F3C','36393D','FF0084');
|
||||
$config['graph_colours']['oranges'] = array('E43C00','E74B00','EB5B00','EF6A00','F37900','F78800','FB9700','FFA700');
|
||||
$config['graph_colours']['oranges'] = array('E43C00','E74B00','EB5B00','EF6A00','F37900','F78800','FB9700','FFA700');
|
||||
$config['graph_colours']['greens'] = array('B6D14B','91B13C','6D912D','48721E','24520F','003300');
|
||||
$config['graph_colours']['pinks'] = array('D0558F','B34773','943A57','792C38','5C1F1E','401F10');
|
||||
$config['graph_colours']['blues'] = array('A0A0E5','8080BD','606096','40406F','202048','000033');
|
||||
@ -193,22 +193,22 @@ $config['bad_if'][] = "-shdsl";
|
||||
$config['bad_if'][] = "-aal5";
|
||||
$config['bad_if'][] = "-atm";
|
||||
$config['bad_if'][] = "container";
|
||||
$config['bad_if'][] = "async";
|
||||
$config['bad_if'][] = "plip";
|
||||
$config['bad_if'][] = "-physical";
|
||||
$config['bad_if'][] = "-signalling";
|
||||
$config['bad_if'][] = "container";
|
||||
$config['bad_if'][] = "unrouted";
|
||||
$config['bad_if'][] = "bri";
|
||||
$config['bad_if'][] = "-bearer";
|
||||
$config['bad_if'][] = "bluetooth";
|
||||
$config['bad_if'][] = "isatap";
|
||||
$config['bad_if'][] = "ras";
|
||||
$config['bad_if'][] = "qos";
|
||||
$config['bad_if'][] = "sonet/sdh";
|
||||
$config['bad_if'][] = "span rp";
|
||||
$config['bad_if'][] = "span sp";
|
||||
$config['bad_if'][] = "sslvpn";
|
||||
$config['bad_if'][] = "async";
|
||||
$config['bad_if'][] = "plip";
|
||||
$config['bad_if'][] = "-physical";
|
||||
$config['bad_if'][] = "-signalling";
|
||||
$config['bad_if'][] = "container";
|
||||
$config['bad_if'][] = "unrouted";
|
||||
$config['bad_if'][] = "bri";
|
||||
$config['bad_if'][] = "-bearer";
|
||||
$config['bad_if'][] = "bluetooth";
|
||||
$config['bad_if'][] = "isatap";
|
||||
$config['bad_if'][] = "ras";
|
||||
$config['bad_if'][] = "qos";
|
||||
$config['bad_if'][] = "sonet/sdh";
|
||||
$config['bad_if'][] = "span rp";
|
||||
$config['bad_if'][] = "span sp";
|
||||
$config['bad_if'][] = "sslvpn";
|
||||
$config['bad_if'][] = "pppoe-";
|
||||
|
||||
$config['bad_if_regexp'][] = "/serial[0-9]:/";
|
||||
|
@ -8,7 +8,7 @@ if ($debug) { print_r($cefs); }
|
||||
|
||||
if (is_array($cefs))
|
||||
{
|
||||
if (!is_array($entity_array))
|
||||
if (!is_array($entity_array))
|
||||
{
|
||||
echo("Caching OIDs: ");
|
||||
$entity_array = array();
|
||||
@ -31,10 +31,10 @@ if (is_array($cefs))
|
||||
echo(" | |-".$path.": ".$path_name['cefSwitchingPath']."\n");
|
||||
|
||||
|
||||
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `cef` WHERE `device_id` = '".$device['device_id']."' AND `entPhysicalIndex` = '".$entity."'
|
||||
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `cef` WHERE `device_id` = '".$device['device_id']."' AND `entPhysicalIndex` = '".$entity."'
|
||||
AND `afi` = '".$afi."' AND `cef_index` = '".$path."'"),0) != "1")
|
||||
{
|
||||
$sql = "INSERT INTO `cef` (`device_id`, `entPhysicalIndex`, `afi`, `cef_index`, `cef_path`)
|
||||
$sql = "INSERT INTO `cef` (`device_id`, `entPhysicalIndex`, `afi`, `cef_index`, `cef_path`)
|
||||
VALUES ('".$device['device_id']."', '".$entity."', '".$afi."', '".$path."', '".$path_name['cefSwitchingPath']."')";
|
||||
mysql_query($sql);
|
||||
echo("+");
|
||||
|
@ -124,7 +124,7 @@ function discover_sensor(&$valid, $class, $device, $oid, $index, $type, $descr,
|
||||
if (!$low_limit) { $low_limit = sensor_low_limit($class, $current); }
|
||||
|
||||
$insert = array('poller_type' => $poller_type, 'sensor_class' => $class, 'device_id' => $device['device_id'], 'sensor_oid' => $oid, 'sensor_index' => $index, 'sensor_type' => $type, 'sensor_descr' => $descr,
|
||||
'sensor_divisor' => $divisor, 'sensor_multiplier' => $multiplier, 'sensor_limit' => $high_limit, 'sensor_limit_warn' => $warn_limit, 'sensor_limit_low' => $low_limit,
|
||||
'sensor_divisor' => $divisor, 'sensor_multiplier' => $multiplier, 'sensor_limit' => $high_limit, 'sensor_limit_warn' => $warn_limit, 'sensor_limit_low' => $low_limit,
|
||||
'sensor_limit_low_warn' => $low_warn_limit, 'sensor_current' => $current, 'entPhysicalIndex' => $entPhysicalIndex, 'entPhysicalIndex_measured' => $entPhysicalIndex_measured );
|
||||
|
||||
$inserted = dbInsert($insert, 'sensors');
|
||||
@ -300,7 +300,7 @@ function discover_link($local_interface_id, $protocol, $remote_interface_id, $re
|
||||
{
|
||||
global $config, $debug, $link_exists;
|
||||
|
||||
if (dbFetchCell("SELECT COUNT(*) FROM `links` WHERE `remote_hostname` = ? AND `local_interface_id` = ? AND `protocol` = ? AND `remote_port` = ?",
|
||||
if (dbFetchCell("SELECT COUNT(*) FROM `links` WHERE `remote_hostname` = ? AND `local_interface_id` = ? AND `protocol` = ? AND `remote_port` = ?",
|
||||
array($remote_hostname, $local_interface_id, $protocol, $remote_port)) == "0")
|
||||
{
|
||||
|
||||
@ -335,7 +335,7 @@ function discover_storage(&$valid, $device, $index, $type, $mib, $descr, $size,
|
||||
$storage = dbFetchRow("SELECT * FROM `storage` WHERE `storage_index` = ? AND `device_id` = ? AND `storage_mib` = ?", array($index, $device['device_id'], $mib));
|
||||
if ($storage === FALSE || !count($storage))
|
||||
{
|
||||
$insert = dbInsert(array('device_id' => $device['device_id'], 'storage_descr' => $descr, 'storage_index' => $index, 'storage_mib' => $mib, 'storage_type' => $type,
|
||||
$insert = dbInsert(array('device_id' => $device['device_id'], 'storage_descr' => $descr, 'storage_index' => $index, 'storage_mib' => $mib, 'storage_type' => $type,
|
||||
'storage_units' => $units, 'storage_size' => $size, 'storage_used' => $used), 'storage');
|
||||
if ($debug) { mysql_error(); }
|
||||
echo("+");
|
||||
|
@ -5,7 +5,7 @@ if ($device['os'] == 'netbotz')
|
||||
$oids = snmp_walk($device, ".1.3.6.1.4.1.5528.100.4.1.2.1.4", "-Osqn", "");
|
||||
if ($debug) { echo($oids."\n"); }
|
||||
$oids = trim($oids);
|
||||
if ($oids)
|
||||
if ($oids)
|
||||
{
|
||||
echo("Netbotz ");
|
||||
foreach (explode("\n", $oids) as $data)
|
||||
|
@ -22,7 +22,7 @@ if ($config['enable_libvirt'] == '1' && $device['os'] == "linux" )
|
||||
{
|
||||
$uri = $method.'://' . $device['hostname'];
|
||||
}
|
||||
|
||||
|
||||
if (strstr($method,'ssh') && !$ssh_ok)
|
||||
{
|
||||
# Check if we are using SSH if we can log in without password - without blocking the discovery
|
||||
@ -31,7 +31,7 @@ if ($config['enable_libvirt'] == '1' && $device['os'] == "linux" )
|
||||
if ($ret != 255) { $ssh_ok = 1; }
|
||||
}
|
||||
|
||||
if ($ssh_ok || !strstr($method,'ssh'))
|
||||
if ($ssh_ok || !strstr($method,'ssh'))
|
||||
{
|
||||
# Fetch virtual machine list
|
||||
unset($domlist);
|
||||
@ -107,7 +107,7 @@ if ($config['enable_libvirt'] == '1' && $device['os'] == "linux" )
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# If we found VMs, don't cycle the other protocols anymore.
|
||||
if (count($libvirt_vmlist)) { break; }
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ if ($device['os'] == "netbotz")
|
||||
{
|
||||
discover_sensor($valid['sensor'], 'temperature', $device, $temperature_oid, $temperature_id, 'netbotz', $descr, '1', '1', NULL, NULL, NULL, NULL, $temperature);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -53,7 +53,7 @@ foreach($ipsec_array as $index => $tunnel)
|
||||
$updated = dbUpdate($db_update, 'ipsec_tunnels', '`tunnel_id` = ?', array($tunnels[$tunnel['cikeTunRemoteValue']]['tunnel_id']));
|
||||
}
|
||||
|
||||
if (is_numeric($tunnel['cipSecTunHcInOctets']) && is_numeric($tunnel['cipSecTunHcInDecompOctets']) &&
|
||||
if (is_numeric($tunnel['cipSecTunHcInOctets']) && is_numeric($tunnel['cipSecTunHcInDecompOctets']) &&
|
||||
is_numeric($tunnel['cipSecTunHcOutOctets']) && is_numeric($tunnel['cipSecTunHcOutUncompOctets']))
|
||||
{
|
||||
echo("HC ");
|
||||
|
@ -10,7 +10,7 @@ if ($debug) { print_r($cefs); }
|
||||
|
||||
if (is_array($cefs))
|
||||
{
|
||||
if (!is_array($entity_array))
|
||||
if (!is_array($entity_array))
|
||||
{
|
||||
echo("Caching OIDs: ");
|
||||
$entity_array = array();
|
||||
|
@ -9,7 +9,7 @@ function poll_sensor($device, $class, $unit)
|
||||
echo("Checking $class " . $sensor['sensor_descr'] . "... ");
|
||||
|
||||
if($class == "temperature")
|
||||
{
|
||||
{
|
||||
for ($i = 0;$i < 5;$i++) # Try 5 times to get a valid temp reading
|
||||
{
|
||||
if ($debug) echo("Attempt $i ");
|
||||
@ -32,13 +32,13 @@ function poll_sensor($device, $class, $unit)
|
||||
|
||||
#$rrd_file = $config['rrd_dir']."/".$device['hostname']."/".safename("sensor-".$sensor['sensor_class']."-".$sensor['sensor_type']."-".$sensor['sensor_index'] . ".rrd");
|
||||
|
||||
## FIXME - sensor name format change 2011/04/26 - remove this in $amount_of_time.
|
||||
## FIXME - sensor name format change 2011/04/26 - remove this in $amount_of_time.
|
||||
## We don't want to reduce performance forever because douchebags don't svn up!
|
||||
$old_rrd_file = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("$class-" . $sensor['sensor_descr'] . ".rrd");
|
||||
$old_rrd_file_b = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("$class-" . $sensor['sensor_index'] . ".rrd");
|
||||
if (is_file($old_rrd_file) && is_file($old_rrd_file_b))
|
||||
{
|
||||
rename($old_rrd_file, $rrd_file);
|
||||
if (is_file($old_rrd_file) && is_file($old_rrd_file_b))
|
||||
{
|
||||
rename($old_rrd_file, $rrd_file);
|
||||
unlink($old_rrd_file_b);
|
||||
} elseif (is_file($old_rrd_file)) {
|
||||
rename($old_rrd_file, $rrd_file);
|
||||
|
@ -27,7 +27,7 @@ if ($ipmi['host'] = get_dev_attrib($device,'ipmi_hostname'))
|
||||
|
||||
$rrd_file = get_sensor_rrd($device, $ipmisensors);
|
||||
|
||||
## FIXME - sensor name format change 2011/04/26 - remove this in $amount_of_time.
|
||||
## FIXME - sensor name format change 2011/04/26 - remove this in $amount_of_time.
|
||||
## We don't want to reduce performance forever because douchebags don't svn up!
|
||||
$old_rrd_file = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename($ipmisensors['sensor_class'].'-'.$ipmisensors['sensor_type'].'-'.$ipmisensors['sensor_index'] . ".rrd");
|
||||
|
||||
|
@ -30,7 +30,7 @@ if (count($vp_rows))
|
||||
$vp_update .= ":".$t_vp['juniAtmVpStatsInPackets'].":".$t_vp['juniAtmVpStatsOutPackets'];
|
||||
$vp_update .= ":".$t_vp['juniAtmVpStatsInPacketOctets'].":".$t_vp['juniAtmVpStatsOutPacketOctets'];
|
||||
$vp_update .= ":".$t_vp['juniAtmVpStatsInPacketErrors'].":".$t_vp['juniAtmVpStatsOutPacketErrors'];
|
||||
|
||||
|
||||
$rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("vp-" . $vp['ifIndex'] . "-".$vp['vp_id'].".rrd");
|
||||
|
||||
if ($debug) { echo("$rrd "); }
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
#Sentry3-MIB::towerModelNumber "CW-24V2-L30M"
|
||||
#Sentry3-MIB::towerModelNumber "CW-24V2-L30M"
|
||||
#Sentry3-MIB::systemVersion "Sentry Switched CDU Version 6.0g"
|
||||
#Sentry3-MIB::towerProductSN "ABEF0001561"
|
||||
|
||||
|
@ -113,7 +113,7 @@ foreach ($port_stats as $ifIndex => $port)
|
||||
$ports[$port['ifIndex']] = dbFetchRow("SELECT * FROM `ports` WHERE `interface_id` = ?", array($interface_id));
|
||||
echo("Adding: ".$port['ifName']."(".$ifIndex.")(".$ports[$port['ifIndex']]['interface_id'].")");
|
||||
#print_r($ports);
|
||||
} elseif ($ports[$ifIndex]['deleted'] == "1") {
|
||||
} elseif ($ports[$ifIndex]['deleted'] == "1") {
|
||||
dbUpdate(array('deleted' => '0'), 'ports', '`interface_id` = ?', array($ports[$ifIndex]['interface_id']));
|
||||
$ports[$ifIndex]['deleted'] = "0";
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ if ($config['enable_printers'])
|
||||
|
||||
#FIXME should report for toner out... :)
|
||||
|
||||
# Log toner swap
|
||||
# Log toner swap
|
||||
if ($tonerperc > $toner['toner_current'])
|
||||
{
|
||||
log_event('Toner ' . $toner['toner_descr'] . ' was replaced (new level: ' . $tonerperc . '%)', $device, 'toner', $toner['toner_id']);
|
||||
|
@ -45,7 +45,7 @@ if ($device['type'] == 'network' || $device['type'] == 'firewall')
|
||||
unset($wirelesscards);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($device['os'] == 'symbol' AND (stristr($device['hardware'],"AP")))
|
||||
{
|
||||
echo("Checking Symbol Wireless clients... ");
|
||||
|
@ -303,9 +303,9 @@ $rewrite_extreme_hardware = array (
|
||||
'.1.3.6.1.4.1.1916.2.79' => 'Summit X450e-48p',
|
||||
'.1.3.6.1.4.1.1916.2.62' => 'Black Diamond 8810',
|
||||
'.1.3.6.1.4.1.1916.2.67' => 'SummitStack',
|
||||
'.1.3.6.1.4.1.1916.2.100' => 'Summit x150-24t',
|
||||
'.1.3.6.1.4.1.1916.2.100' => 'Summit x150-24t',
|
||||
'.1.3.6.1.4.1.1916.2.114' => 'Summit x650-24x',
|
||||
'.1.3.6.1.4.1.1916.2.129' => 'NWI-e450a',
|
||||
'.1.3.6.1.4.1.1916.2.129' => 'NWI-e450a',
|
||||
'.1.3.6.1.4.1.1916.2.133' => 'Summit x480-48t',
|
||||
'.1.3.6.1.4.1.1916.2.141' => 'Summit x480-48x',
|
||||
);
|
||||
|
@ -41,7 +41,7 @@ function rrdtool($command, $file, $options)
|
||||
global $config, $debug;
|
||||
|
||||
$command = $config['rrdtool'] . " $command $file $options";
|
||||
if ($config['rrdcached'])
|
||||
if ($config['rrdcached'])
|
||||
{
|
||||
$command .= " --daemon " . $config['rrdcached'];
|
||||
}
|
||||
|
@ -7,10 +7,10 @@ function add_service($device, $service)
|
||||
{
|
||||
echo("$service ");
|
||||
|
||||
$insert = array('device_id' => $device['device_id'], 'service_ip' => $device['hostname'], 'service_type' => $service,
|
||||
$insert = array('device_id' => $device['device_id'], 'service_ip' => $device['hostname'], 'service_type' => $service,
|
||||
'service_desc' => "auto discovered: $service", 'service_param' => "", 'service_ignore' => "0");
|
||||
|
||||
return dbInsert($insert, 'services');
|
||||
return dbInsert($insert, 'services');
|
||||
}
|
||||
|
||||
|
||||
|
@ -7,10 +7,10 @@ $check = shell_exec($config['nagios_plugins'] . "/check_dns -H ".$nsquery." -s "
|
||||
|
||||
list($check, $time) = split("\|", $check);
|
||||
|
||||
if(strstr($check, "DNS OK: ")) {
|
||||
$status = '1';
|
||||
} else {
|
||||
$status = '0';
|
||||
if(strstr($check, "DNS OK: ")) {
|
||||
$status = '1';
|
||||
} else {
|
||||
$status = '0';
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -4,10 +4,10 @@ $check = shell_exec($config['nagios_plugins'] . "/check_ftp -H ".$service['hostn
|
||||
|
||||
list($check, $time) = split("\|", $check);
|
||||
|
||||
if(strstr($check, "FTP OK - ")) {
|
||||
$status = '1';
|
||||
} else {
|
||||
$status = '0';
|
||||
if(strstr($check, "FTP OK - ")) {
|
||||
$status = '1';
|
||||
} else {
|
||||
$status = '0';
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -4,10 +4,10 @@ $check = shell_exec($config['nagios_plugins'] . "/check_http -H ".$service['host
|
||||
|
||||
list($check, $time) = split("\|", $check);
|
||||
|
||||
if(strstr($check, "HTTP OK")) {
|
||||
$status = '1';
|
||||
} else {
|
||||
$status = '0';
|
||||
if(strstr($check, "HTTP OK")) {
|
||||
$status = '1';
|
||||
} else {
|
||||
$status = '0';
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -4,10 +4,10 @@ $check = shell_exec($config['nagios_plugins'] . "/check_imap -H ".$service['host
|
||||
|
||||
list($check, $time) = split("\|", $check);
|
||||
|
||||
if(strstr($check, "IMAP OK - ")) {
|
||||
$status = '1';
|
||||
} else {
|
||||
$status = '0';
|
||||
if(strstr($check, "IMAP OK - ")) {
|
||||
$status = '1';
|
||||
} else {
|
||||
$status = '0';
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -7,10 +7,10 @@ $check = shell_exec($config['nagios_plugins'] . "/check_mysql -H ".$service['hos
|
||||
|
||||
list($check, $time) = split("\|", $check);
|
||||
|
||||
if(strstr($check, "Uptime:")) {
|
||||
$status = '1';
|
||||
} else {
|
||||
$status = '0';
|
||||
if(strstr($check, "Uptime:")) {
|
||||
$status = '1';
|
||||
} else {
|
||||
$status = '0';
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -4,10 +4,10 @@ $check = shell_exec($config['nagios_plugins'] . "/check_pop -H ".$service['hostn
|
||||
|
||||
list($check, $time) = split("\|", $check);
|
||||
|
||||
if(strstr($check, "POP OK - ")) {
|
||||
$status = '1';
|
||||
} else {
|
||||
$status = '0';
|
||||
if(strstr($check, "POP OK - ")) {
|
||||
$status = '1';
|
||||
} else {
|
||||
$status = '0';
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -4,10 +4,10 @@ $check = shell_exec($config['nagios_plugins'] . "/check_simap -H ".$service['hos
|
||||
|
||||
list($check, $time) = split("\|", $check);
|
||||
|
||||
if(strstr($check, "SIMAP OK")) {
|
||||
$status = '1';
|
||||
} else {
|
||||
$status = '0';
|
||||
if(strstr($check, "SIMAP OK")) {
|
||||
$status = '1';
|
||||
} else {
|
||||
$status = '0';
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -4,10 +4,10 @@ $check = shell_exec($config['nagios_plugins'] . "/check_smtp -H ".$service['host
|
||||
|
||||
list($check, $time) = split("\|", $check);
|
||||
|
||||
if(strstr($check, "SMTP OK")) {
|
||||
$status = '1';
|
||||
} else {
|
||||
$status = '0';
|
||||
if(strstr($check, "SMTP OK")) {
|
||||
$status = '1';
|
||||
} else {
|
||||
$status = '0';
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -4,10 +4,10 @@ $check = shell_exec($config['nagios_plugins'] . "/check_spop -H ".$service['host
|
||||
|
||||
list($check, $time) = split("\|", $check);
|
||||
|
||||
if(strstr($check, "SPOP OK")) {
|
||||
$status = '1';
|
||||
} else {
|
||||
$status = '0';
|
||||
if(strstr($check, "SPOP OK")) {
|
||||
$status = '1';
|
||||
} else {
|
||||
$status = '0';
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -4,10 +4,10 @@ $check = shell_exec($config['nagios_plugins'] . "/check_ssh -H ".$service['hostn
|
||||
|
||||
list($check, $time) = split("\|", $check);
|
||||
|
||||
if(strstr($check, "SSH OK")) {
|
||||
$status = '1';
|
||||
} else {
|
||||
$status = '0';
|
||||
if(strstr($check, "SSH OK")) {
|
||||
$status = '1';
|
||||
} else {
|
||||
$status = '0';
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -6,10 +6,10 @@ $check = shell_exec($config['nagios_plugins'] . "/check_telnet -H ".$service['ho
|
||||
|
||||
list($check, $time) = split("\|", $check);
|
||||
|
||||
if(strstr($check, "TCP OK - ")) {
|
||||
$status = '1';
|
||||
} else {
|
||||
$status = '0';
|
||||
if(strstr($check, "TCP OK - ")) {
|
||||
$status = '1';
|
||||
} else {
|
||||
$status = '0';
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -16,7 +16,7 @@ function get_cache($host, $value){
|
||||
//If failed, try by IP
|
||||
if(!is_numeric($dev_cache[$host]['device_id'])) {
|
||||
$dev_cache[$host]['device_id'] = dbFetchCell('SELECT `device_id` FROM `ipv4_addresses` AS A, `ports` AS I WHERE A.ipv4_address = ? AND I.interface_id = A.interface_id', array($host));
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'os':
|
||||
$dev_cache[$host]['os'] = dbFetchCell('SELECT `os` FROM devices WHERE `device_id` = ?', array(get_cache($host, 'device_id')));
|
||||
@ -42,7 +42,7 @@ function process_syslog ($entry, $update) {
|
||||
echo('D-'.$bi);
|
||||
return $entry;
|
||||
}
|
||||
|
||||
|
||||
$entry['device_id'] = get_cache($entry['host'], 'device_id');
|
||||
if($entry['device_id']) {
|
||||
$os = get_cache($entry['host'], 'os');
|
||||
@ -137,7 +137,7 @@ function process_syslog ($entry, $update) {
|
||||
dbInsert(
|
||||
array(
|
||||
'device_id' => $entry['device_id'],
|
||||
'program' => $entry['program'],
|
||||
'program' => $entry['program'],
|
||||
'facility' => $entry['facility'],
|
||||
'priority' => $entry['priority'],
|
||||
'level' => $entry['level'],
|
||||
@ -149,7 +149,7 @@ function process_syslog ($entry, $update) {
|
||||
);
|
||||
unset($os);
|
||||
}
|
||||
return $entry;
|
||||
return $entry;
|
||||
}
|
||||
|
||||
?>
|
||||
|
8
irc.php
8
irc.php
@ -28,7 +28,7 @@ class observiumbot
|
||||
|
||||
|
||||
###
|
||||
# Get HELP!
|
||||
# Get HELP!
|
||||
###
|
||||
function help_info(&$irc, &$data)
|
||||
{
|
||||
@ -46,7 +46,7 @@ mysql_close();
|
||||
|
||||
|
||||
###
|
||||
# Get status on !version
|
||||
# Get status on !version
|
||||
###
|
||||
function version_info(&$irc, &$data)
|
||||
{
|
||||
@ -63,7 +63,7 @@ mysql_close();
|
||||
}
|
||||
|
||||
###
|
||||
# Get last eventlog entry
|
||||
# Get last eventlog entry
|
||||
###
|
||||
function log_info(&$irc, &$data)
|
||||
{
|
||||
@ -200,7 +200,7 @@ echo "LISTDEVICES\n";
|
||||
|
||||
|
||||
###
|
||||
# !status <dev prt srv> gives overall status
|
||||
# !status <dev prt srv> gives overall status
|
||||
###
|
||||
function status_info(&$irc, &$data)
|
||||
{
|
||||
|
@ -93,8 +93,8 @@ function CollectData($bill_id)
|
||||
|
||||
}
|
||||
|
||||
if($period < "0") {
|
||||
logfile("BILLING: negative period! id:$bill_id period:$period delta:$delta in_delta:$in_delta out_delta:$out_delta");
|
||||
if($period < "0") {
|
||||
logfile("BILLING: negative period! id:$bill_id period:$period delta:$delta in_delta:$in_delta out_delta:$out_delta");
|
||||
} else {
|
||||
dbInsert(array('bill_id' => $bill_id, 'timestamp' => $now, 'period' => $period, 'delta' => $delta, 'in_delta' => $in_delta, 'out_delta' => $out_delta), 'bill_data');
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user