[SOLVED] List machines not seen since a certain date

Share your SQL query ideas for reporting in the WAPT Enterprise console here
Forum Rules
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
Locked
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

May 24, 2019 - 12:24

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
User avatar
Mathieu
Messages: 91
Registration: August 18, 2016 - 10:24

December 11, 2022 - 09:13

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.
Attachments
Query error
Query error
2022-12-11_09h12_07.png (4.72 KB) Viewed 11112 times
- WAPT 2.2.3.12463 Enterprise
- Debian 9.9
- Windows 10 21H2 & Windows 11 22h2
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

December 29, 2022 - 5:38 PM

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'                     
 
julien.guyonnet
Messages: 12
Registration: Apr 21, 2021 - 10:38

January 5, 2023 - 10:36 PM

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?
Locked