Add remaining CpuUsage stats to Server_Stats

pull/3844/head
Isaac Connor 2024-02-26 13:54:48 -05:00
parent 6db5ec7374
commit ed472bcfd7
4 changed files with 44 additions and 2 deletions

View File

@ -711,7 +711,10 @@ CREATE TABLE `Server_Stats` (
`TimeStamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`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,

39
db/zm_update-1.37.55.sql Normal file
View File

@ -0,0 +1,39 @@
--
-- Add Cpu Usage stats to Server Status
--
SET @s = (SELECT IF(
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = DATABASE()
AND table_name = 'Server_Stats'
AND column_name = 'CpuNicePercent'
) > 0,
"SELECT 'Column CpuNicePercent already exists in Server_Stats'",
"ALTER TABLE Server_Stats 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 = 'Server_Stats'
AND column_name = 'CpuIdlePercent'
) > 0,
"SELECT 'Column CpuIdlePercent already exists in Server_Stats'",
"ALTER TABLE Server_Stats 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 = 'Server_Stats'
AND column_name = 'CpuUsagePercent'
) > 0,
"SELECT 'Column CpuUsagePercent already exists in Server_Stats'",
"ALTER TABLE Server_Stats ADD `CpuUsagePercent` DECIMAL(5,1) default NULL AFTER `CpuIdlePercent`"
));
PREPARE stmt FROM @s;
EXECUTE stmt;

View File

@ -18,7 +18,7 @@
%global zmtargetdistro %{?rhel:el%{rhel}}%{!?rhel:fc%{fedora}}
Name: zoneminder
Version: 1.37.54
Version: 1.37.55
Release: 2%{?dist}
Summary: A camera monitoring and analysis tool
Group: System Environment/Daemons

View File

@ -1 +1 @@
1.37.54
1.37.55