6.2. 验证 Insights 客户端存档
您可以验证存档文件的内容。通过检查存档文件,您可以确认将哪些数据发送到红帽。
如果使用模糊或 redaction,您可以在上传前检查存档。如果要保留存档文件,可以将其保存在系统中。
6.2.1. 上传前验证存档
要在 Python 数据清理脚本上传到 Red Hat Enterprise Linux 的 Red Hat Insights 前检查存档,请使用-- no-upload 选项运行
命令,然后在不上传该文件的情况下保存文件。这可让您查看客户端发送到 Red Hat Enterprise Linux 的 Insights 的信息,并验证您的模糊处理或 redaction 设置。
insights-
client
归档文件存储在 /var/tmp/
目录中。当 insights-client
完成后,它会显示文件名。
先决条件
-
确保
/etc/insights-client/insights-client.conf
文件已被正确配置。
流程
使用--
no-upload 选项输入
命令。insights-
clientCopy to Clipboard Copied! Toggle word wrap Toggle overflow insights-client --no-upload
[root@insights]# insights-client --no-upload
当应用了红色或模糊处理时,命令会显示信息性消息。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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
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
导航到临时存储目录,如
位于消息的 Archive
所示。Copy to Clipboard Copied! Toggle word wrap Toggle overflow cd /var/tmp/qsINM9/
[root@insights]# cd /var/tmp/qsINM9/
解包压缩的
tar.gz
文件。Copy to Clipboard Copied! Toggle word wrap Toggle overflow tar -xzf insights-ITC-4-20190925180232.tar.gz
[root@insights]# tar -xzf insights-ITC-4-20190925180232.tar.gz
该脚本创建一个包含文件的新目录。
6.2.2. 上传后验证 Insights 客户端存档
要在 Python 数据清理脚本将其上传到 Red Hat Enterprise Linux 的 Red Hat Insights 后保存存档的副本,请运行 insights-client
,然后保存文件。这可让您验证客户端发送到 Red Hat Enterprise Linux 的 Insights 的信息,并验证您的模糊或 redaction 设置。
先决条件
-
确保
/etc/insights-client/insights-client.conf
文件已被正确配置。
流程
使用--
keep-archive 选项输入
命令。insights-
clientCopy to Clipboard Copied! Toggle word wrap Toggle overflow insights-client --keep-archive
[root@insights]# insights-client --keep-archive
命令显示信息性消息。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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
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
信息中的临时存储目录。Copy to Clipboard Copied! Toggle word wrap Toggle overflow cd /var/tmp/ozM8bY/
[root@insights]# cd /var/tmp/ozM8bY/
解包压缩的
tar.gz
文件。Copy to Clipboard Copied! Toggle word wrap Toggle overflow tar -xzf insights-ITC-4-20190925181622.tar.gz
[root@insights]# tar -xzf insights-ITC-4-20190925181622.tar.gz
该脚本创建一个包含文件的新目录。