Looking to expand on some manual MySQL queries to make gathering metric data for upper management easier. As I experienced before, the whole epoch thing is throwing me off. I am hoping @iJake @powellbc or other MySQL experts can asset me. I am looking to find all managed machines that have checked-in in the last 30 days. Here is what Ive come up with but its not quite right:
SELECT c.computer_name, FROM_UNIXTIME(cd.last_contact_time_epoch/1000,"%m/%d/%Y %h:%i") AS 'last check-in',FROM_UNIXTIME(cd.last_report_date_epoch/1000,"%m/%d/%Y %h:%i") AS 'last inventory update'
FROM computers c
JOIN computers_denormalized cd ON c.udid = cd.udid
WHERE cd.Is_Managed = 1 AND cd.last_contact_time_epoch <'2592004'
The 2592004 is what I've come up with for how many seconds there are in 30 days.
