This is a basic application that can gather information from remote hosts. The information it can gather includes:
- Kernel log from
/var/log/messages
- List of all installed packages and their versions as reported by
yum
- Kernel version of the remote host as reported by
uname -r
- Detailed hardware information as reported by
lshw
- Status of currently running processes as reported by
ps -aux
It generates log files per information element and then bundles them together into a ZIP archive. Each remote host has its own archive.
The application accepts a configuration file which includes information about the remote hosts as well as indicators as to what information to collect.
A sample configuration file can look as follows:
[DEFAULT]
info_type=var_log,ps_aux,packages,hw_details,kernel_version
[192.168.10.10]
username=root
password=s0m3p4ssw0rd
[192.168.10.16]
username=root
password=s0m3p4ssw0rd
Each host has its own section with the username and password specified. Since a typical use case of this application is in off-site locations, passwords can be safely written in a configuration file and then deleted upon conclusion of the information gathering activity.
- Install the dependencies of the application.
pip3 install -r requirements.txt
- Prepare a configuration file as suggested, say named
config-file.ini
. - Run the application.
python3 main.py config-file.ini