


CREATE TABLE IF NOT EXISTS `ATVstats` (
  `timestamp` timestamp NOT NULL,
  `RPL` smallint(6) NOT NULL,
  `deviceName` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `temperature` int(11) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `memTot` int(11) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `memFree` int(11) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `memAv` int(11) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `memPogo` int(11) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `memAtlas` int(11) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cpuSys` int(11) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cpuUser` int(11) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cpuL5` float COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cpuL10` float COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cpuL15` float COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cpuPogoPct` float COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cpuApct` float COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `diskSysPct` int(11) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `diskDataPct` int(11) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
PRIMARY KEY (`deviceName`,`timestamp`,`RPL`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `ATVlogs` (
  `timestamp` datetime NOT NULL,
  `deviceName` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `reboot` int(11) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `a_pogoStarted` int(11) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `a_injection` int(11) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `a_ptcLogin` int(11) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `a_atlasCrash` int(11) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `a_rdmError` int(11) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `m_noInternet` int(11) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `m_noConfig` int(11) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `m_noLicense` int(11) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `m_atlasDied` int(11) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `m_pogoDied` int(11) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `m_deviceOffline` int(11) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `m_noRDM` int(11) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `m_noFocus` int(11) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `m_unknown` int(11) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
PRIMARY KEY (`deviceName`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `ATVMonitor` (
  `timestamp` datetime NOT NULL,
  `deviceName` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `issue` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `action` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `script` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
