labtech
Database
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
EventScore
Parameters
Name
Type
Mode
CID
int
IN
Definition
BEGIN Declare score int; Declare result int; Declare Total int; SELECT 1 As Result, 1 as Total, IFNULL(100-ROUND(((SUM(IF(h_stats.EventLogSystemErrors>EventLogSystemCount,1*(EventLogSystemWeight*.01),0)) + SUM(IF(h_stats.EventLogSecurityErrors>EventLogSecurityCount,1*(EventLogSecurityWeight*.01),0))+ SUM(IF(h_stats.EventLogApplicationErrors>EventLogAppCount,1*(EventLogAppWeight*.01),0)))/ ((Count(*) * (1*(EventLogSystemWeight*.01)))+(Count(*) * (1*(EventLogSecurityWeight*.01)))+(Count(*) * (1*(EventLogAppWeight*.01))) )) *100),100) as EventScore FROM managementScore,h_stats Join Computers Using (ComputerID) Where h_stats.StatDate>DATE_ADD(NOW(),interval -1 day) and Computers.ClientID=CID into @result,@total,@score; return @score; END