Automated Asset Collection for CMDB Using Puppet Facter and Assets_Report
This article explains how to build an automated CMDB asset collection system by extending Puppet's Facter with custom plugins, using a custom Report Processor to post data to an AutoBank service, and deploying a Python/Django API server for storage and retrieval.
Many companies create a CMDB before building an automation platform; the first step is modeling and data collection, typically done either by manually entering a small amount of static data or by programmatically gathering the majority of data. Car Home adopts a "Puppet Facter script" combined with periodic automatic collection, and the implementation has been open‑sourced on GitHub as the Assets_Report project.
Puppet is a client/server configuration‑management tool. Its companion tool, Facter, runs on agents to collect facts, but the built‑in facts are limited. To gather deeper hardware information, the authors extended Facter and added a custom Report Processor on the Puppet Master, which forwards the collected facts to AutoBank (the internal CMDB) via HTTP.
The solution consists of two main components: the assets_report Puppet module, which includes the Report Processor and custom Facter plugins deployed on the Master, and an api_server written in Python/Django that receives the posted facts and stores them in a database. The API server is a demo implementation and is not intended for production use.
The custom Facter plugin provides additional hardware facts such as CPU count and model, memory size and slots, NIC IP/MAC/model (supporting multiple IPs per NIC), RAID card details, disk information, OS type and version, and server vendor/SN. It also implements a cache mechanism that, when no asset data has changed, reports only a not_modify flag to reduce database load.
Supported operating systems are 64‑bit CentOS 6, CentOS 7, and Windows 2008 R2. Supported server vendors include HP, DELL, and CISCO.
Installation steps: place the module in /etc/puppet/modules , add the module path to puppet.conf , and configure site.pp so that all nodes install the assets_report module. After configuration, the collection tool is automatically distributed to agents and runs on the next Puppet Agent execution.
The report component is configured via assets_report/lib/puppet/reports/report_setting.yaml . The API server requires installing dependencies on a CentOS/RedHat system, initializing the database (refer to the Django documentation), and starting the HTTP API service.
To use the system, manually trigger a Puppet Agent run or let the daemon run; the agent will collect assets, the Report Processor will post them to the API server’s port 80, and the data will appear in the database.
The article concludes that while many organizations develop similar asset‑collection tools to handle diverse hardware and OS environments, open‑sourcing this solution can reduce duplicated effort and invite community contributions to maintain a universal toolset for automated configuration data collection.
HomeTech
HomeTech tech sharing
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.