Add CpuUserPercent, CpuNicePercent, CpuSystemPercent, CpuIdlePercent, CpuUsagePercent to Servers table
parent
f9a1b6b4f4
commit
5fd7e9faf5
|
@ -683,6 +683,11 @@ CREATE TABLE `Servers` (
|
|||
`State_Id` int(10) unsigned,
|
||||
`Status` enum('Unknown','NotRunning','Running') NOT NULL default 'Unknown',
|
||||
`CpuLoad` DECIMAL(5,1) default NULL,
|
||||
`CpuUserPercent` DECIMAL(5,1) default NULL,
|
||||
`CpuNicePercent` DECIMAL(5,1) default NULL,
|
||||
`CpuSystemPercent` DECIMAL(5,1) default NULL,
|
||||
`CpuIdlePercent` DECIMAL(5,1) default NULL,
|
||||
`CpuUsagePercent` DECIMAL(5,1) default NULL,
|
||||
`TotalMem` bigint unsigned default null,
|
||||
`FreeMem` bigint unsigned default null,
|
||||
`TotalSwap` bigint unsigned default null,
|
||||
|
|
|
@ -0,0 +1,63 @@
|
|||
--
|
||||
-- Add Type column to Storage
|
||||
--
|
||||
|
||||
SET @s = (SELECT IF(
|
||||
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = DATABASE()
|
||||
AND table_name = 'Servers'
|
||||
AND column_name = 'CpuUserPercent'
|
||||
) > 0,
|
||||
"SELECT 'Column CpuUserPercent already exists in Servers'",
|
||||
"ALTER TABLE Servers ADD `CpuUserPercent` DECIMAL(5,1) default NULL AFTER `CpuLoad`"
|
||||
));
|
||||
|
||||
PREPARE stmt FROM @s;
|
||||
EXECUTE stmt;
|
||||
|
||||
SET @s = (SELECT IF(
|
||||
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = DATABASE()
|
||||
AND table_name = 'Servers'
|
||||
AND column_name = 'CpuNicePercent'
|
||||
) > 0,
|
||||
"SELECT 'Column CpuNicePercent already exists in Servers'",
|
||||
"ALTER TABLE Servers ADD `CpuNicePercent` DECIMAL(5,1) default NULL AFTER `CpuUserPercent`"
|
||||
));
|
||||
|
||||
PREPARE stmt FROM @s;
|
||||
EXECUTE stmt;
|
||||
|
||||
SET @s = (SELECT IF(
|
||||
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = DATABASE()
|
||||
AND table_name = 'Servers'
|
||||
AND column_name = 'CpuSystemPercent'
|
||||
) > 0,
|
||||
"SELECT 'Column CpuSystemPercent already exists in Servers'",
|
||||
"ALTER TABLE Servers ADD `CpuSystemPercent` DECIMAL(5,1) default NULL AFTER `CpuNicePercent`"
|
||||
));
|
||||
|
||||
PREPARE stmt FROM @s;
|
||||
EXECUTE stmt;
|
||||
|
||||
SET @s = (SELECT IF(
|
||||
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = DATABASE()
|
||||
AND table_name = 'Servers'
|
||||
AND column_name = 'CpuIdlePercent'
|
||||
) > 0,
|
||||
"SELECT 'Column CpuIdlePercent already exists in Servers'",
|
||||
"ALTER TABLE Servers ADD `CpuIdlePercent` DECIMAL(5,1) default NULL AFTER `CpuSystemPercent`"
|
||||
));
|
||||
|
||||
PREPARE stmt FROM @s;
|
||||
EXECUTE stmt;
|
||||
|
||||
SET @s = (SELECT IF(
|
||||
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = DATABASE()
|
||||
AND table_name = 'Servers'
|
||||
AND column_name = 'CpuUsagePercent'
|
||||
) > 0,
|
||||
"SELECT 'Column CpuUsagePercent already exists in Servers'",
|
||||
"ALTER TABLE Servers ADD `CpuUsagePercent` DECIMAL(5,1) default NULL AFTER `CpuIdlePercent`"
|
||||
));
|
||||
|
||||
PREPARE stmt FROM @s;
|
||||
EXECUTE stmt;
|
|
@ -18,7 +18,7 @@
|
|||
%global zmtargetdistro %{?rhel:el%{rhel}}%{!?rhel:fc%{fedora}}
|
||||
|
||||
Name: zoneminder
|
||||
Version: 1.37.51
|
||||
Version: 1.37.52
|
||||
Release: 2%{?dist}
|
||||
Summary: A camera monitoring and analysis tool
|
||||
Group: System Environment/Daemons
|
||||
|
|
|
@ -1 +1 @@
|
|||
1.37.51
|
||||
1.37.52
|
||||
|
|
Loading…
Reference in New Issue