diff --git a/database-update.sql b/database-update.sql index 96c30a6802..80ad5a4893 100644 --- a/database-update.sql +++ b/database-update.sql @@ -7,3 +7,4 @@ CREATE TABLE IF NOT EXISTS `device_graphs` ( `device_id` int(11) NOT NULL, `gr DROP TABLE IF EXISTS `graph_types`; CREATE TABLE IF NOT EXISTS `graph_types` ( `graph_type` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `graph_subtype` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `graph_section` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `graph_descr` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `graph_order` int(11) NOT NULL, KEY `graph_type` (`graph_type`), KEY `graph_subtype` (`graph_subtype`), KEY `graph_section` (`graph_section`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT INTO `graph_types` (`graph_type`, `graph_subtype`, `graph_section`, `graph_descr`, `graph_order`) VALUES('device', 'bits', 'netstats', 'Total Traffic', 0),('device', 'hr_users', 'system', 'Users Logged In', 0),('device', 'ucd_load', 'system', 'Load Averages', 0),('device', 'ucd_cpu', 'system', 'Detailed Processor Usage', 0),('device', 'ucd_memory', 'system', 'Detailed Memory Usage', 0),('device', 'netstat_tcp', 'netstats', 'TCP Statistics', 0),('device', 'netstat_icmp_info', 'netstats', 'ICMP Informational Statistics', 0),('device', 'netstat_icmp_stat', 'netstats', 'ICMP Statistics', 0),('device', 'netstat_ip', 'netstats', 'IP Statistics', 0),('device', 'netstat_ip_frag', 'netstats', 'IP Fragmentation Statistics', 0),('device', 'netstat_udp', 'netstats', 'UDP Statistics', 0),('device', 'netstat_snmp', 'netstats', 'SNMP Statistics', 0),('device', 'temperatures', 'system', 'Temperatures', 0),('device', 'mempools', 'system', 'Memory Pool Usage', 0),('device', 'processors', 'system', 'Processor Usage', 0),('device', 'storage', 'system', 'Filesystem Usage', 0),('device', 'hr_processes', 'system', 'Running Processes', 0),('device', 'uptime', 'system', 'System Uptime', ''),('device', 'ipsystemstats_ipv4', 'netstats', 'IPv4 Packet Statistics', 0),('device', 'ipsystemstats_ipv6_frag', 'netstats', 'IPv6 Fragmentation Statistics', 0),('device', 'ipsystemstats_ipv6', 'netstats', 'IPv6 Packet Statistics', 0),('device', 'ipsystemstats_ipv4_frag', 'netstats', 'IPv4 Fragmentation Statistics', 0),('device', 'fortigate_sessions', 'firewall', 'Active Sessions', ''), ('device', 'screenos_settings', 'firewall', 'Active Sessions', ''), ('device', 'fdb_count', 'system', 'MAC Addresses Learnt', '0'); +DROP TABLE `frequency`; diff --git a/html/includes/graphs/device/frequencies.inc.php b/html/includes/graphs/device/frequencies.inc.php index cada8049bf..e7a4ea21f1 100644 --- a/html/includes/graphs/device/frequencies.inc.php +++ b/html/includes/graphs/device/frequencies.inc.php @@ -6,7 +6,7 @@ $device = device_by_id_cache($id); $rrd_options .= " -l 0 -E "; $iter = "1"; -$sql = mysql_query("SELECT * FROM frequency where device_id = '$id'"); +$sql = mysql_query("SELECT * FROM sensors WHERE sensor_class='freq' AND device_id = '$id'"); $rrd_options .= " COMMENT:' Cur Min Max\\n'"; while($frequency = mysql_fetch_array($sql)) { @@ -39,15 +39,15 @@ while($frequency = mysql_fetch_array($sql)) $hostname = gethostbyid($frequency['device_id']); - $descr = substr(str_pad($frequency['freq_descr'], 15),0,15); - $rrd_filename = $config['rrd_dir'] . "/".$device['hostname']."/" . safename("freq-" . $frequency['freq_descr'] . ".rrd"); - $freq_id = $frequency['freq_id']; + $descr = substr(str_pad($frequency['sensor_descr'], 15),0,15); + $rrd_filename = $config['rrd_dir'] . "/".$device['hostname']."/" . safename("freq-" . $frequency['sensor_descr'] . ".rrd"); + $sensor_id = $frequency['sensor_id']; - $rrd_options .= " DEF:freq$freq_id=$rrd_filename:freq:AVERAGE"; - $rrd_options .= " LINE1:freq$freq_id#".$colour.":'" . $descr . "'"; - $rrd_options .= " GPRINT:freq$freq_id:AVERAGE:%5.2lfHz"; - $rrd_options .= " GPRINT:freq$freq_id:MIN:%5.2lfHz"; - $rrd_options .= " GPRINT:freq$freq_id:MAX:%5.2lfHz\\\\l"; + $rrd_options .= " DEF:freq$sensor_id=$rrd_filename:freq:AVERAGE"; + $rrd_options .= " LINE1:freq$sensor_id#".$colour.":'" . $descr . "'"; + $rrd_options .= " GPRINT:freq$sensor_id:AVERAGE:%5.2lfHz"; + $rrd_options .= " GPRINT:freq$sensor_id:MIN:%5.2lfHz"; + $rrd_options .= " GPRINT:freq$sensor_id:MAX:%5.2lfHz\\\\l"; $iter++; } diff --git a/html/includes/graphs/sensor/frequency.inc.php b/html/includes/graphs/sensor/frequency.inc.php index 9fb47ce748..a6ad07fa01 100644 --- a/html/includes/graphs/sensor/frequency.inc.php +++ b/html/includes/graphs/sensor/frequency.inc.php @@ -6,16 +6,16 @@ include("includes/graphs/common.inc.php"); $rrd_options .= " COMMENT:' Last Max\\n'"; - $frequency = mysql_fetch_array(mysql_query("SELECT * FROM frequency where freq_id = '".mres($_GET['id'])."'")); + $frequency = mysql_fetch_array(mysql_query("SELECT * FROM sensors where sensor_class='freq' AND sensor_id = '".mres($_GET['id'])."'")); $hostname = mysql_result(mysql_query("SELECT hostname FROM devices WHERE device_id = '" . $frequency['device_id'] . "'"),0); - $frequency['freq_descr_fixed'] = substr(str_pad($frequency['freq_descr'], 28),0,28); + $frequency['sensor_descr_fixed'] = substr(str_pad($frequency['sensor_descr'], 28),0,28); - $rrd_filename = $config['rrd_dir'] . "/".$hostname."/" . safename("freq-" . $frequency['freq_descr'] . ".rrd"); + $rrd_filename = $config['rrd_dir'] . "/".$hostname."/" . safename("freq-" . $frequency['sensor_descr'] . ".rrd"); $rrd_options .= " DEF:freq=$rrd_filename:freq:AVERAGE"; - $rrd_options .= " LINE1.5:freq#cc0000:'" . $frequency['freq_descr_fixed']."'"; + $rrd_options .= " LINE1.5:freq#cc0000:'" . $frequency['sensor_descr_fixed']."'"; $rrd_options .= " GPRINT:freq:LAST:%3.0lfHz"; $rrd_options .= " GPRINT:freq:MAX:%3.0lfHz\\\\l"; diff --git a/html/pages/device/health.inc.php b/html/pages/device/health.inc.php index 3e2164efa6..a9e367753a 100644 --- a/html/pages/device/health.inc.php +++ b/html/pages/device/health.inc.php @@ -10,7 +10,7 @@ $humidity = mysql_result(mysql_query("select count(*) from sensors WHERE sensor_ $fans = mysql_result(mysql_query("select count(*) from sensors WHERE sensor_class='fanspeed' AND device_id = '" . $device['device_id'] . "'"), 0); $volts = mysql_result(mysql_query("select count(*) from sensors WHERE sensor_class='voltage' AND device_id = '" . $device['device_id'] . "'"), 0); $current = mysql_result(mysql_query("select count(*) from sensors WHERE sensor_class='current' AND device_id = '" . $device['device_id'] . "'"), 0); -$freqs = mysql_result(mysql_query("select count(*) from frequency WHERE device_id = '" . $device['device_id'] . "'"), 0); +$freqs = mysql_result(mysql_query("select count(*) from sensors WHERE sensor_class='freq' AND device_id = '" . $device['device_id'] . "'"), 0); $datas[] = 'overview'; if ($processor) { $datas[] = 'processors'; } diff --git a/html/pages/device/health/frequencies.inc.php b/html/pages/device/health/frequencies.inc.php index 98e7eedb1e..036be198ed 100644 --- a/html/pages/device/health/frequencies.inc.php +++ b/html/pages/device/health/frequencies.inc.php @@ -1,6 +1,6 @@ "); diff --git a/html/pages/device/overview/current.inc.php b/html/pages/device/overview/current.inc.php index a503a5d556..3c3f6ce1e1 100644 --- a/html/pages/device/overview/current.inc.php +++ b/html/pages/device/overview/current.inc.php @@ -2,7 +2,6 @@ $graph_type = "sensor_current"; -unset($current_seperator); if($total = mysql_result(mysql_query("SELECT count(sensor_id) from sensors WHERE sensor_class='current' AND device_id = '" . $device['device_id'] . "'"),0)) { $rows = round($total / 2,0); echo("
Frequencies
");
- echo("
|