Feature Friday #16: host info report

Posted by Nick Anderson
June 28, 2024

Did you know the Masterfiles Policy Framework (MPF) ships with a host info report?

That’s right, you can simply run cf-agent --bundlesequence host_info_report and a report will be generated.

command
cf-agent --bundlesequence host_info_report
output
R: Host info report generated and available at '/var/cfengine/reports/host_info_report.txt'

It’s packed with information about the specific host.

Let’s peek:

command
head -n 9 /var/cfengine/reports/host_info_report.txt
output
# Host Information
Generated: Fri Feb 23 19:54:13 2024

## Identity
Fully Qualified Hostname: hub.example.com
Host ID: SHA=41ebb680d136f82c57af6ee1a7b938c093fe8d773bf320213eae1c476dad4fb0

## CFEngine
Version: CFEngine Enterprise 3.21.4

Here are the section headers:

command
grep ^# /var/cfengine/reports/host_info_report.txt
output
# Host Information
## Identity
## CFEngine
## OS
## Hardware
## Network
### Interfaces
### IPv4 TCP Ports listening
## Policy
### Inventory
#### Variables tagged for inventory
### Enterprise maintanance bundles available

Running with the show_software class defined will add information about installed packages

command
cf-agent --bundlesequence host_info_report --define show_software
output
R: Host info report generated and available at '/var/cfengine/reports/host_info_report.txt'
command
grep -A3 "^## Software" /var/cfengine/reports/host_info_report.txt
output
## Software
[yum] hypervvssd: version 0-0.34.20180415git.el7, arch x86_64
[yum] grub2-common: version 2.02-0.81.el7.centos, arch noarch
[yum] grub2-tools-extra: version 2.02-0.81.el7.centos, arch x86_64

Happy Friday! 🎉