Hello,
I would like to retrieve the logs from the "Installation Logs for package ***" to more easily audit my infrastructure. The goal is to create a CSV file named "Machine;Installation Logs for package ***".
I have tried to perform this operation via a query in the reporting system as well as through the API, but I haven't found a solution.
I am currently using Enterprise version 2.2.0.11720.
Thank you in advance for your help.
[RESOLVED] Package installation logs
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
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
Good morning,
I can offer you this:
Would that suit you?
Yours sincerely
I can offer you this:
Code: Select all
SELECT
h.computer_name AS Machine,
h.computer_fqdn AS FQDN,
p.name AS Package_Name,
p.install_status AS Installation_Status,
p.install_date AS Installation_Date,
p.install_output AS Installation_Logs
FROM
hostpackagesstatus p
JOIN
hosts h
ON
p.host_id = h.uuid
WHERE
p.install_status IS NOT NULL
ORDER BY
h.computer_name, p.install_date;Yours sincerely
Hello Jarnaud,
Great, that's perfect!
Is it possible to retrieve this request via the API? (I haven't seen this feature).
Something like this: https://wapt.myserveur.local/api/v3/reporting?id=3
Great, that's perfect!
Is it possible to retrieve this request via the API? (I haven't seen this feature).
Something like this: https://wapt.myserveur.local/api/v3/reporting?id=3
- Attachments
-
- api.png (8.46 KB) Viewed 5147 times
Hello Emeric,
Of course, it's possible.
https://www.wapt.fr/fr/doc/wapt-api.htm ... rting-exec
I'll let you customize the username and password of a WAPT server user.
And you need to replace 2 with your SQL query number (you can see the SQL query IDs in the reporting tab in the left panel), for example:
Best regards
Of course, it's possible.
https://www.wapt.fr/fr/doc/wapt-api.htm ... rting-exec
Code: Select all
import os
import json
import logging
import waptlicences
import requests
import sys
sys.path.append('/opt/wapt')
from common import get_requests_client_cert_session
from common import Wapt
WAPT = Wapt()
ini_wapt_path = WAPT.config_filename
w = Wapt(config_filename=ini_wapt_path)
# WAPT Conf
wapt_url = w.waptserver.server_url
user = "reporting"
password = "password"
def run_report():
t = waptlicences.waptserver_login(ini_wapt_path,user,password)
session = get_requests_client_cert_session(wapt_url,
cert=(t['client_certificate'],t['client_private_key'],t['client_private_key_password']),
verify=w.waptserver.verify_cert
)
session.cookies.set(t['session_cookies'][0]['Name'], t['session_cookies'][0]['Value'], domain=t['session_cookies'][0]['Domain'])
t= None
url = f'{wapt_url}/api/v3/reporting_exec?id=19'
response = session.get(url)
data = response.json()
return data['result']
print(run_report())I'll let you customize the username and password of a WAPT server user.
And you need to replace 2 with your SQL query number (you can see the SQL query IDs in the reporting tab in the left panel), for example:
Code: Select all
url = f'{wapt_url}/api/v3/reporting_exec?id=2- dcardon
- WAPT Expert
- Messages: 1929
- Registration: June 18, 2014 - 09:58
- Location: Saint Sébastien sur Loire
- Contact :
Hello Emeric,
regarding your WAPT version, version 2.2 is no longer supported and it would be best to upgrade to 2.5 or even 2.6.
Regards,
Denis
regarding your WAPT version, version 2.2 is no longer supported and it would be best to upgrade to 2.5 or even 2.6.
Regards,
Denis
Denis Cardon - Tranquil IT
Share your experiences on WAPT! Send us your blog and article URLs in the "Your Opinion of the forum, and we'll feature them on the WAPT
Share your experiences on WAPT! Send us your blog and article URLs in the "Your Opinion of the forum, and we'll feature them on the WAPT
