fixes to new sensors setup

git-svn-id: http://www.observium.org/svn/observer/trunk@1533 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2010-07-29 20:34:31 +00:00
parent 1cddb998eb
commit 7b2fc2dbe1
28 changed files with 326 additions and 190 deletions
@@ -0,0 +1,9 @@
<?php
if(is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/netstats-icmp.rrd")) {
$graph_title = "ICMP Informational Statistics";
$graph_type = "device_icmp_informational";
include ("includes/print-device-graph.php");
}
?>
@@ -0,0 +1,9 @@
<?php
if(is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/netstats-icmp.rrd")) {
$graph_title = "ICMP Statistics";
$graph_type = "device_icmp";
include ("includes/print-device-graph.php");
}
?>
@@ -0,0 +1,13 @@
<?php
if(is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/netstats-ip.rrd")) {
$graph_title = "IP Statistics";
$graph_type = "device_ip";
include ("includes/print-device-graph.php");
$graph_title = "IP Fragmented Statistics";
$graph_type = "device_ip_fragmented";
include ("includes/print-device-graph.php");
}
?>
@@ -0,0 +1,13 @@
<?php
if(is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/netstats-snmp.rrd")) {
$graph_title = "SNMP Packets Statistics";
$graph_type = "device_snmp_packets";
include ("includes/print-device-graph.php");
$graph_title = "SNMP Message Type Statistics";
$graph_type = "device_snmp_statistics";
include ("includes/print-device-graph.php");
}
?>
@@ -0,0 +1,9 @@
<?php
if(is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/netstats-tcp.rrd")) {
$graph_title = "TCP Statistics";
$graph_type = "device_tcp";
include ("includes/print-device-graph.php");
}
?>
@@ -0,0 +1,9 @@
<?php
if(is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/netstats-udp.rrd")) {
$graph_title = "UDP Statistics";
$graph_type = "device_udp";
include ("includes/print-device-graph.php");
}
?>
+7 -7
View File
@@ -1,27 +1,27 @@
<?php
$sql = "SELECT * FROM `frequency` WHERE device_id = '" . mres($_GET['id']- . "' ORDER BY freq_descr";
$sql = "SELECT * FROM `sensors` WHERE device_id = '" . mres($_GET['id']- . "' AND `sensor_class` = 'freq' ORDER BY sensor_descr";
$query = mysql_query($sql);
echo("<table cellspacing=0 cellpadding=5 width=100%>");
$row = 1;
while($freq = mysql_fetch_array($query)) {
while($sensor = mysql_fetch_array($query)) {
if(!is_integer($row/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
echo("<tr class=list-large style=\"background-color: $row_colour; padding: 5px;\">
<td width=350>" . $freq['freq_descr'] . "</td>
<td>" . $freq['freq_current'] . "Hz</td>
<td>" . $freq['freq_limit_low'] . 'Hz - ' . $freq['freq_limit'] . "Hz</td>
<td>" . $freq['freq_notes'] . "</td>
<td width=350>" . $sensor['sensor_descr'] . "</td>
<td>" . $sensor['sensor_current'] . "Hz</td>
<td>" . $sensor['sensor_limit_low'] . 'Hz - ' . $sensor['sensor_limit'] . "Hz</td>
<td>" . $sensor['sensor_notes'] . "</td>
</tr>\n");
echo("<tr bgcolor=$row_colour><td colspan='4'>");
$graph_type = "sensor_frequency";
$graph_array['id'] = $freq['sensor_id'];
$graph_array['id'] = $sensor['sensor_id'];
$graph_array['type'] = $graph_type;
include("includes/print-quadgraphs.inc.php");
@@ -13,6 +13,7 @@ while($temp = mysql_fetch_array($query)) {
echo("<tr class=list-large style=\"background-color: $row_colour; padding: 5px;\">
<td width=350>" . $temp['sensor_descr'] . "</td>
<td width=350>" . $temp['sensor_type'] . "</td>
<td>" . print_temperature($temp['sensor_current'], $temp['sensor_limit']) . " &deg;C</td>
<td>" . $temp['sensor_limit'] . " &deg;C</td>
<td>" . $temp['sensor_notes'] . "</td>