Page 1 of 1

[SOLVED] List machines not seen since a certain date

Published: May 24, 2019 - 12:24
by sfonteneau

Code: Select all

SELECT h.uuid,h.computer_fqdn,install_date::date,version,h.listening_timestamp::timestamp,h.connected_users from hostsoftwares s
left join hosts h on h.uuid=s.host_id
where
 s.key='WAPT_is1'
and
 h.listening_timestamp<'20190115'                                    
Modify h.listening_timestamp<'20190115' for a specific date

Re: Listing machines not seen since a certain date

Published: Dec 11, 2022 - 09:13
by Mathieu
Hello,

I wanted to know if this query works correctly for you because for a little while now I have been getting an error during execution.

Re: Listing machines not seen since a certain date

Published: Dec 29, 2022 - 5:38 PM
by sfonteneau
Indeed, it no longer works after an update

listening_timestamp no longer exists, so I used last_seen_on

Code: Select all

SELECT h.uuid,h.computer_fqdn,install_date::date,version,h.last_seen_on::timestamp,h.connected_users from hostsoftwares s
left join hosts h on h.uuid=s.host_id
where
 s.key='WAPT_is1'
and
 h.last_seen_on<'20230101'                     
 

Re: [SOLVED] List machines not seen since a certain date

Published: January 5, 2023 - 10:36 PM
by julien.guyonnet
Good morning,

For a dynamic date 'D - 45 days'

Code: Select all

h.last_seen_on<TO_CHAR(CURRENT_DATE - 45, 'yyyymmdd')
Is it possible to use this query to filter the inventory tab?