Inventory search on last sync
Advanced Search has "Last Sync" as a criteria, but I can't figure out how to filter. EG, I'd like to find all computers that have not checked in for more than a day, so I tried Last Sync contains d, but that doesn't work. * doesn't work at all as a wild card - no results found. % kinda works, but not in a useful way. If I put % by itself, it returns all my PCs, but I can't use % with the characters d, h or any number.
Sorting without filtering isn't helpful because I want to filter the last sync, then order by computer name.
Any ideas? Thanks.
Answers (4)
I played with this some more and it looks like the Advanced Search does a comparison with the value in the database (even though it displays it as the relative difference). Knowing that I did a search for Last Sync < 2012-09-27% and got machines that haven't checked in since yesterday. The value is stored in the DB as yyyy-mm-dd hh:mm:ss so searching for Last Sync < 2012-09-27 15:% got even more specific to computers the checked in over one day ago (since it's is almost 4:00pm here as I'm writing this).
Comments:
-
Thanks, CS. That's the ticket. I had tried the < and the % separately, so putting them together did it. - tpr 12 years ago
I've never done this in advanced search, but you can create a report for this.
SELECT NAME, LAST_SYNC FROM MACHINE where (LAST_SYNC > CURDATE() - INTERVAL 1 DAY) order by name
Comments:
-
Thanks. I have a report that sorts by last date. It doesn't filter, but I can sort and filter the csv file. The reason I want to have it work in the advanced search is because it will simplify the work I need to do in kbox; for example, checking the non-syncing computers against another db before removing from kbox. - tpr 12 years ago
You could also use a Smart Label to do thi. Just take what dgullett gave you and create a Smart Label using that for the SQL query. Just change the last line to order by the sync, i.e.:
SELECT NAME, LAST_SYNC
FROM MACHINE
WHERE (LAST_SYNC > CURDATE() - INTERVAL 1 DAY)
ORDER BY LAST_SYNC
If you need help setting up a Smart Label, check this out:
K1000 Labels - Effective Organization & Process Flow Using Manual, Smart & LDAP Labels and Label Groups
http://www.itninja.com/blog/view/k1000-labels-effective-organization-process-flow-using-manual-smart-ldap-labels-and-label-groups
John
Comments:
-
But smart labels only apply when the machine syncs, so wouldn't this label never get applied to a machine? - chucksteel 12 years ago