If I search for an asset it nicely shows the scan history in date and time, with the IPv4 as well as the hostname for each time it was scanned. I am trying to work out if I can pull this for all assets as an SQL query, instead of going into each asset and downloading the CSV equivalent for the scan history of said asset. I tried to combine a lot of other query statements together, and I’ll admit my SQL knowledge is somewhat poor as you’ll see, so my apologies upfront.
SELECT
scan.scan_id AS “Scan ID”,
scan.scan_name AS “Scan Name”,
scan.started AS “Time Scan Started”,
scan.finished AS “Time Scan Finished”,
status.description AS “Scan Completion Status”,
type.description AS “Scan Description”
FROM fact_asset AS fa
JOIN dim_asset AS da ON fa.asset_id = da.asset_id
da.ip_address AS “IP_Address”,
da.mac_address AS “MAC_Address”,
da.host_name AS “DNS_Hostname”
from dim_scan scan
join dim_scan_status status on status.status_id=scan.status_Id
join dim_scan_type type on type.type_id=scan.type_id
ORDER BY ds.name ASC