6.4. 验证 Insights 客户端存档
您可以验证存档文件的内容。通过检查存档文件,您可以确认将哪些数据发送到 Red Hat Insights for Red Hat Enterprise Linux。
如果使用 obfuscation 或 redaction,您可以在发送存档前检查存档。如果要保留存档文件,可以将其保存在系统中。
6.4.1. 在上传前验证存档
要在 Python SoS 脚本将其上传到 Red Hat Insights for Red Hat Enterprise Linux 前检查存档,请运行 Insights 客户端,然后在不上传文件的情况下保存文件。这可让您查看客户端发送给 Insights for Red Hat Enterprise Linux 的信息,并验证您的模糊或重操作设置。
归档文件存储在 /var/tmp/
目录中。当 insights-client
完成后,它会显示文件名。
先决条件
-
如果使用 redaction,请确保正确配置了
/etc/insights-client/remove.conf
文件。 -
如果使用混淆,请确保正确配置了
/etc/insights-client/insights-client.conf
文件。
流程
使用
--no-upload
选项输入insights-client
命令。[root@insights]# insights-client --no-upload
当应用 redaction 或 obfuscation 时,命令会显示信息性消息。
WARNING: Excluding data from files Starting to collect Insights data for ITC-4 WARNING: Skipping patterns found in remove.conf WARNING: Skipping command /bin/dmesg WARNING: Skipping command /bin/hostname WARNING: Skipping file /etc/cluster/cluster.conf WARNING: Skipping file /etc/hosts Archive saved at /var/tmp/qsINM9/insights-ITC-4-20190925180232.tar.gz
导航到临时存储目录,如在消息
中保存的归档
中所示。[root@insights]# cd /var/tmp/qsINM9/
解包压缩的
tar.gz
文件。[root@insights]# tar -xzf insights-ITC-4-20190925180232.tar.gz
该脚本创建一个包含文件的新目录。
6.4.2. 上传后验证 Insights 客户端存档
要保留一个存档副本,在 Python SoS 脚本将其上传到 Red Hat Insights for Red Hat Enterprise Linux 后进行检查,请运行 insights-client
,然后保存文件。这可让您验证客户端发送给 Insights for Red Hat Enterprise Linux 的信息,并验证您的模糊或重操作设置。
先决条件
-
如果使用 redaction,请确保正确配置了
/etc/insights-client/remove.conf
文件。 -
如果使用混淆,请确保正确配置了
/etc/insights-client/insights-client.conf
文件。
流程
使用
--keep-archive
选项输入insights-client
命令。[root@insights]# insights-client --keep-archive
命令显示信息性消息。
Starting to collect Insights data for ITC-4 Uploading Insights data. Successfully uploaded report from ITC-4 to account 6229994. Insights archive retained in /var/tmp/ozM8bY/insights-ITC-4-20190925181622.tar.gz
进入到在
Insights archive retained in
信息中的临时存储目录。[root@insights]# cd /var/tmp/ozM8bY/
解包压缩的
tar.gz
文件。[root@insights]# tar -xzf insights-ITC-4-20190925181622.tar.gz
该脚本创建一个包含文件的新目录。