git-svn-id: http://www.observium.org/svn/observer/trunk@237 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2008-04-14 09:32:54 +00:00
parent dce37e3bef
commit 14abbbd75f
9 changed files with 24 additions and 35 deletions

View File

@@ -122,7 +122,13 @@
$graph = cpugraphHP ($hostname . "/cpu.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
} elseif($os == "Snom") {
$graph = callsgraphSNOM ($hostname . "/data.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
} elseif($os == "ScreenOS") {
$graph = graph_netscreen_cpu ($hostname . "/data.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
} elseif($os == "Fortigate") {
$graph = graph_fortinet_cpu ($hostname . "/data.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
}
break;
case 'temp':
$graph = temp_graph ($_GET['id'], $graphfile, $from, $to, $width, $height, $title, $vertical);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 848 B

After

Width:  |  Height:  |  Size: 893 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 847 B

After

Width:  |  Height:  |  Size: 848 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 847 B

After

Width:  |  Height:  |  Size: 892 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 848 B

After

Width:  |  Height:  |  Size: 893 B

View File

@@ -123,7 +123,7 @@ echo("</td>");
}
}
unset($br);
}
# }
$sql = "SELECT network_id FROM ip6addr AS A, ip6networks AS N, interfaces AS I
WHERE A.interface_id = I.interface_id
@@ -137,8 +137,8 @@ echo("</td>");
$sql = "SELECT I.interface_id FROM ip6addr AS A, ip6networks AS N, interfaces AS I, devices AS D
WHERE A.interface_id = I.interface_id
AND A.network = N.cidr
AND N.network_id = '".$net['network_id']."' AND D.device_id = I.device_id and D.device_id != '".$device['device_id']."'";
AND A.network = N.cidr AND N.network_id = '".$net['network_id']."' AND D.device_id = I.device_id
AND D.device_id != '".$device['device_id']."' AND A.origin != 'linklayer' AND A.origin != 'wellknown'";
$new_query = mysql_query($sql);
while($new = mysql_fetch_array($new_query)) {
@@ -174,6 +174,8 @@ echo("</td>");
unset($int_links, $int_links_v6, $int_links_v4, $int_links_phys, $br);
}
echo("</td></tr>");
// If we're showing graphs, generate the graph and print the img tags

View File

@@ -13,7 +13,6 @@ include_once($config['install_dir'] . "/includes/ios.php");
include_once($config['install_dir'] . "/includes/unix.php");
include_once($config['install_dir'] . "/includes/windows.php");
include_once($config['install_dir'] . "/includes/procurve.php");
include_once($config['install_dir'] . "/includes/snom.php");
include_once($config['install_dir'] . "/includes/graphing.php");
include_once($config['install_dir'] . "/includes/print-functions.php");
include_once($config['install_dir'] . "/includes/billing-functions.php");

View File

@@ -2,43 +2,25 @@
include("snom-graphing.php");
function pollDeviceSNOM() {
function pollDeviceSNOM($device) {
global $device;
global $community;
$snmpver = $device['snmpver'];
$id = $device['device_id'];
$hostname = $device['hostname'];
$hardware = $device['hardware'];
$version = $device['version'];
$features = $device['features'];
$location = $device['location'];
global $config
$snmpdata = `snmpget -Ovq -$snmpver -c $community $hostname 1.3.6.1.2.1.7526.2.1.1 1.3.6.1.2.1.7526.2.1.2 1.3.6.1.2.1.7526.2.2.1 1.3.6.1.2.1.7526.2.2.2`;
$snmpdatab = `snmpget -Oqv -$snmpver -c $community $hostname 1.3.6.1.2.1.7526.2.5 1.3.6.1.2.1.7526.2.6`;
$snmpdata = shell_exec($config['snmpget'] . " -Ovq -".$device['snmpver']." -c ".$device['community']." ".$device['hostname']." 1.3.6.1.2.1.7526.2.1.1 1.3.6.1.2.1.7526.2.1.2 1.3.6.1.2.1.7526.2.2.1 1.3.6.1.2.1.7526.2.2.2");
$snmpdatab = shell_exec($config['snmpget'] . " -Oqv -".$device['snmpver']." -c ".$device['community']." ".$device['hostname']." 1.3.6.1.2.1.7526.2.5 1.3.6.1.2.1.7526.2.6");
list($rxbytes, $rxpkts, $txbytes, $txpkts) = explode("\n", $snmpdata);
list($calls, $registrations) = explode("\n", $snmpdatab);
$txbytes = 0 - $txbytes * 8;
$rxbytes = 0 - $rxbytes * 8;
echo("$rxbytes, $rxpkts, $txbytes, $txpkts, $calls, $registrations");
$rrdfile = "rrd/" . $hostname . "-data.rrd";
$rrdfile = "rrd/" . $device['hostname'] . "-data.rrd";
if(!is_file($rrdfile)) {
$woo = `rrdtool create $rrdfile \
DS:INOCTETS:COUNTER:600:U:100000000000 \
DS:OUTOCTETS:COUNTER:600:U:10000000000 \
DS:INPKTS:COUNTER:600:U:10000000000 \
DS:OUTPKTS:COUNTER:600:U:10000000000 \
DS:CALLS:COUNTER:600:U:10000000000 \
DS:REGISTRATIONS:COUNTER:600:U:10000000000 \
RRA:AVERAGE:0.5:1:600 \
RRA:AVERAGE:0.5:6:700 \
RRA:AVERAGE:0.5:24:775 \
RRA:AVERAGE:0.5:288:797 \
RRA:MAX:0.5:1:600 \
RRA:MAX:0.5:6:700 \
RRA:MAX:0.5:24:775 \
RRA:MAX:0.5:288:797`;
$woo = shell_exec($config['rrdtool'] . " create $rrdfile \
DS:INOCTETS:COUNTER:600:U:100000000000 DS:OUTOCTETS:COUNTER:600:U:10000000000 \
DS:INPKTS:COUNTER:600:U:10000000000 DS:OUTPKTS:COUNTER:600:U:10000000000 \
DS:CALLS:COUNTER:600:U:10000000000 DS:REGISTRATIONS:COUNTER:600:U:10000000000 \
RRA:AVERAGE:0.5:1:600 RRA:AVERAGE:0.5:6:700 RRA:AVERAGE:0.5:24:775 RRA:AVERAGE:0.5:288:797 \
RRA:MAX:0.5:1:600 RRA:MAX:0.5:6:700 RRA:MAX:0.5:24:775 RRA:MAX:0.5:288:797");
}
$rrdupdate = "N:$rxbytes:$txbytes:$rxpkts:$rxbytes:$calls:$registrations";

View File

@@ -263,12 +263,12 @@ while ($device = mysql_fetch_array($device_query)) {
if(is_file($old_uptimerrd) && !is_file($uptimerrd)) { rename($old_uptimerrd, $uptimerrd); echo("Moving $old_uptimerrd to $uptimerrd"); }
if(!is_file($uptimerrd)) {
$woo = `rrdtool create $uptimerrd \
$woo = shell_exec($config['rrdtool'] . " create $uptimerrd \
DS:uptime:GAUGE:600:0:U \
RRA:AVERAGE:0.5:1:600 \
RRA:AVERAGE:0.5:6:700 \
RRA:AVERAGE:0.5:24:775 \
RRA:AVERAGE:0.5:288:797`;
RRA:AVERAGE:0.5:288:797");
}
rrdtool_update($uptimerrd, "N:$uptime");