Hi Guys,
We have a LabTech dataset but for some reason the gauge is not showing correct stats for Memory. Can anyone please review this query. The query shows "memory free" and not the usage.

SELECT
CONCAT(c.computerID, '_', csd.eventdate) as 'id',
c.computerid as 'computer_id',
c.name as 'computer_name',
l.name as 'location',
IF((locate('server',lower(c.os)) = 0), 'Workstation', 'Server') AS 'machine_type',
cli.name as 'company',
csd.eventdate as 'sample_date',
CAST(ROUND(csd.CPU/100,2) AS decimal(10,2)) as 'cpu_usage_pct',
CAST(ROUND(csd.MEM/100,2) AS decimal(10,2)) as 'memory_usage_pct',
CAST(csd.DataIN AS decimal(10,0)) as 'data_received_kb',
CAST(csd.DataOut AS decimal(10,0)) as 'data_sent_kb',
DATE_ADD(cast(c.lastcontact as datetime), INTERVAL TIMESTAMPDIFF(HOUR,CURRENT_TIMESTAMP, UTC_TIMESTAMP) HOUR) AS 'last_contact_date',
c.LastUsername AS 'last_user_logon',
c.os AS 'os_version'

FROM
computers c
INNER JOIN h_computerstatsdaily csd ON c.ComputerID = csd.ComputerID
INNER JOIN clients cli ON cli.ClientID = c.ClientID
LEFT JOIN locations l ON l.LocationID = c.LocationID

WHERE
csd.EventDate BETWEEN SYSDATE() - INTERVAL 60 DAY AND SYSDATE()

Didn't find what you were looking for?

New post
Would you like to vote for this feature?
0 out of 0 found this helpful

Comments

0 comments