Commit 3b750e77 authored by Leigh Stoller's avatar Leigh Stoller

Database changes to support RF monitoring.

* Change freq to floats (from bigint), we deal in MHZ only, using
  fractional amounts.

* Add a table to track notifications of violations, I expect this is one
  of those daemons that is capable of generating an email blizzard, if
  power cycle fails for some reason.
parent 7a6b36d8
......@@ -2884,12 +2884,24 @@ DROP TABLE IF EXISTS `interfaces_rf_limit`;
CREATE TABLE `interfaces_rf_limit` (
`node_id` varchar(32) NOT NULL DEFAULT '',
`iface` text NOT NULL,
`freq_low` bigint(12) NOT NULL DEFAULT '0',
`freq_high` bigint(12) NOT NULL DEFAULT '0',
`freq_low` float NOT NULL DEFAULT '0',
`freq_high` float NOT NULL DEFAULT '0',
`power` float NOT NULL DEFAULT '0',
PRIMARY KEY (`node_id`,`iface`(128),`freq_low`,`freq_high`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `node_rf_reports`
--
DROP TABLE IF EXISTS `node_rf_reports`;
CREATE TABLE `node_rf_reports` (
`node_id` varchar(32) NOT NULL DEFAULT '',
`tstamp` datetime NOT NULL default '0000-00-00 00:00:00',
`report` text NOT NULL,
PRIMARY KEY (`node_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `ipport_ranges`
--
......
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
if (!DBTableExists("node_rf_reports")) {
DBQueryFatal("CREATE TABLE `node_rf_reports` ( ".
" `node_id` varchar(32) NOT NULL DEFAULT '', ".
" `tstamp` datetime NOT NULL default '0000-00-00 00:00:00',".
" `report` text NOT NULL, ".
" PRIMARY KEY (`node_id`) ".
") ENGINE=MyISAM DEFAULT CHARSET=latin1");
}
my $type = DBSlotType("interfaces_rf_limit", "freq_low");
if ($type =~ /bigint/) {
DBQueryFatal("alter table interfaces_rf_limit change freq_low ".
" `freq_low` float NOT NULL DEFAULT '0'");
}
$type = DBSlotType("interfaces_rf_limit", "freq_high");
if ($type =~ /bigint/) {
DBQueryFatal("alter table interfaces_rf_limit change freq_high ".
" `freq_high` float NOT NULL DEFAULT '0'");
}
return 0;
}
1;
# Local Variables:
# mode:perl
# End:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment