labtech
Database
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
VirusScore
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(ROUND(100-((SUM(not h_stats.VirusScanEnabled) * (VirusDisabledWeight *.01)) + (SUM(not h_stats.VirusScanUpToDate)*(VirusOutDateWeight*.01)) + (SUM(h_stats.VirusScanMissing)*(VirusMissingWeight*.01)))/((Count(*) * (VirusDisabledWeight *.01)) + (Count(*)*(VirusOutDateWeight*.01)) + (Count(*)*(VirusMissingWeight*.01)))*100),100) as VirusScore 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