Python based scripts for obtaining system information from Linux.

Overview

sysinfo

Python based scripts for obtaining system information from Linux.

  • Python2 and Python3 compatible
  • Output in JSON format
  • Simple scripts and extensible structure
  • Parallel commands execution
  • Output to stdout or file
  • Output can be processed by jq

Command-line arguments

usage: sysinfo.py [-h] [--all] [--error] [--info] [--list] [--output OUTPUT]
                  [--pool POOL] [--verbose]
                  [commands [commands ...]]

positional arguments:
  commands              Commands

optional arguments:
  -h, --help            show this help message and exit
  --all, -a             Execute all commands.
  --error, -e           Show only error outputs from commands.
  --info, -i            List all commands with command line arguments.
  --list, -l            List all commands.
  --output OUTPUT, -o OUTPUT
                        Path to the output file.
  --pool POOL, -p POOL  Pool size for parallel execution of commands. (default
                        value is 5)
  --verbose, -v         Add more info to output - options, commands, raw
                        command result.

Examples

Standart JSON output

python2 sysinfo.py lscpu
{
    "lscpu": {
        "output": {
            "architecture": "armv6l",
            "bogomips": "996.14",
            "byteOrder": "Little Endian",
            "coresPerSocket": "1",
            "cpuMaxMhz": "1000.0000",
            "cpuMinMhz": "700.0000",
            "cpus": "1",
            "flags": "half thumb fastmult vfp edsp java tls",
            "model": "7",
            "modelName": "ARM1176",
            "onLineCpusList": "0",
            "sockets": "1",
            "stepping": "r0p7",
            "threadsPerCore": "1",
            "vendorId": "ARM"
        }
    }
}

Get single value

python2 sysinfo.py lscpu | jq -r ".lscpu.output.modelName"
ARM1176

Output in CSV format

python2 sysinfo.py lsblk | jq -r ".lsblk.output[] | [.name, .label, .size,
.mountpoint] | @csv"
"mmcblk0","","14.6G",""
"mmcblk0boot0","","4M",""
"mmcblk0boot1","","4M",""
"mmcblk0p1","boot","256M","/boot"
"mmcblk0p2","rootfs","14.3G","/"

Resources

Available commands

blkid                     - Block device attributes
blockdev                  - Block device ioctls
busctl                    - Introspect the bus
chrt                      - Scheduling attributes of all the tasks (threads)
dev_disk                  - Disk devices mapping
df                        - Report file system disk space usage
dmidecode                 - Dumping all information from DMI (SMBIOS)
dmidecode_baseboard       - Dumping BASEBOARD information from DMI (SMBIOS)
dmidecode_bios            - Dumping BIOS information from DMI (SMBIOS)
dmidecode_cache           - Dumping CACHE information from DMI (SMBIOS)
dmidecode_chassis         - Dumping CHASSIS information from DMI (SMBIOS)
dmidecode_connector       - Dumping CONNECTOR information from DMI (SMBIOS)
dmidecode_memory          - Dumping MEMORY information from DMI (SMBIOS)
dmidecode_processor       - Dumping CHASSIS information from DMI (SMBIOS)
dmidecode_slot            - Dumping SLOT information from DMI (SMBIOS)
dmidecode_system          - Dumping SYSTEM information from DMI (SMBIOS)
dnf_installed             - DNF - list installed packages
dnf_repolist              - DNF - defined repositories
env                       - Environment variables
etc_default               - Default configuration for programs
etc_fstab                 - Filesystems mounted on boot
etc_group                 - Groups essential information
etc_hosts                 - Maps hostnames to IP addresses
etc_locale_gen            - Configuration file for locale-gen
etc_mtab                  - Currently mounted filesystems
etc_passwd                - Attributes of each user or account on a computer
etc_release               - OS release info
etc_shadow                - Shadow database of the passwd file
etc_timezone              - Timezone settings
fbset                     - Show frame buffer device settings
fbset_info                - Show frame buffer device information
findmnt                   - List all mounted filesytems
free                      - Amount of free and used memory in the system
getconf                   - Configuration variables for the current system and their values
groups                    - Group names
hardware_platform         - Hardware platform
hostnamectl               - Current system hostname and related information
ifconfig                  - List all interfaces which are currently available, even if down
jobs                      - Job names, if job control is active
kernel_name               - Kernel name
kernel_release            - Kernel release
kernel_version            - Kernel version
lsblk                     - Lists information about all block devices
lscpu                     - Information about the CPU architecture
lsmod                     - Show the status of modules in the Linux Kernel
lsns                      - Block device ioctls
lsof                      - Information about files opened by processes
lspci                     - List all PCI devices
lsusb                     - List USB devices
machine                   - Machine hardware name
modinfo                   - Information about a Linux Kernel modules
nodename                  - Network node hostname
operating_system          - Operating system
parted                    - Lists partition layout on all block devices
proc_cmdline              - Parameters passed to the kernel at the time it is started
proc_consoles             - Information about current consoles including tty
proc_cpuinfo              - Type of processor used by your system
proc_crypto               - Installed cryptographic ciphers used by the Linux kernel
proc_devices              - Installed cryptographic ciphers used by the Linux kernel
proc_diskstats            - I/O statistics of block devices
proc_dma                  - List of the registered ISA DMA channels in use
proc_filesystems          - List of the file system types currently supported by the kernel
proc_fs                   - File system parameters
proc_iomem                - Map of the system's memory for each physical device
proc_ioports              - List of currently registered port regions used for input or output communication with a device
proc_loadavg              - Load average in regard to both the CPU and IO over time
proc_locks                - Files currently locked by the kernel
proc_meminfo              - Reports a large amount of valuable information about the systems RAM usage
proc_modules              - List of all modules loaded into the kernel
proc_mounts               - List mounted filesystems (info provides from kernel)
proc_partitions           - Partition block allocation information
proc_scsi                 - List of every recognized SCSI device
proc_swaps                - Measures swap space and its utilization
proc_sys                  - Information about the system and kernel features
proc_uptime               - Information detailing how long the system has been on since its last restart
proc_version              - Version of the Linux kernel, the version of gcc used to compile the kernel, and the time of kernel compilation
proc_vmstat               - Detailed virtual memory statistics from the kernel
processor                 - Processor type
prtstat                   - Print statistics of a processes
ps                        - Report a snapshot of the current processes
python_pip_packages       - List available python modules
python_platform           - Probe the underlying platform's hardware, operating system, and Python interpreter version information
rpm                       - Querying all RPM packages
services                  - Service names
services_list             - Displays services with status
services_params           - Displays services with status
shell_alias               - Shell alias names
shell_all_commands        - Shell command names
shell_builtins            - Names of shell builtin commands
shell_exported_variables  - Names of exported shell variables
shell_variables           - Names of all shell variables
sysctl                    - Runtime kernel parameters
sysctl_system             - Runtime kernel parameters from all system configuration files
timedatectl               - System time and date
udevadm                   - Queries the udev database for device information stored in the udev database
udevadm_block_devices     - Queries the udev database for block device information stored in the udev database
users                     - User names
vmstat_disk               - Report disk statistics
vmstat_disk_sum           - Report some summary statistics about disk activity
vmstat_forks              - Displays the number of forks since boot
vmstat_stats              - Displays a table of various event counters and memory statistics
yum_installed             - YUM - list installed packages
yum_repolist              - YUM - defined repositories
Owner
Petr Vavrin
Petr Vavrin
Meaningful and minimalist release notes for developers

Managing manual release notes is hard. Therefore, everyone tends to generate release notes from commit messages. But, you won't get a meaningful release note at the end.

codezri 31 Dec 30, 2022
Simple python bot, that notifies about new manga chapters through Telegram.

Simple python bot, that notifies about new manga chapters through Telegram.

Dmitry Kopturov 1 Dec 05, 2021
Wordle is fun, so let's ruin it with computers.

ruin-wordle Wordle is fun, so let's ruin it with computers. Metrics This repository assesses two metrics about each algorithm: Success: how many of th

Charles Tapley Hoyt 11 Feb 11, 2022
A command line interface tool converting starknet warp transpiled outputs into readable cairo contracts.

warp-to-cairo warp-to-cairo is a simple tool converting starknet warp outputs (NethermindEth/warp) outputs into readable cairo contracts. The warp out

Michael K 5 Jun 10, 2022
Driving lessons made simpler. Custom scheduling API built with Python.

NOTE This is a mirror of a GitLab repository. Dryvo Dryvo is a unique solution for the driving lessons industry. Our aim is to save the teacher’s time

Adam Goldschmidt 595 Dec 05, 2022
Program to send ROM files to Turbo Everdrive; reverse-engineered and designed to be platform-independent

PCE_TurboEverdrive_USB What is this "TurboEverdrive USB" thing ? For those who have a TurboEverdrive v2.x from krikzz.com, there was originally an opt

David Shadoff 10 Sep 18, 2022
🛠️ Plugin to integrate Chuy with Poetry

Archived This is bundled with Chuy since v1.3.0. Poetry Chuy Plugin This plugin integrates Chuy with Poetry. Note: This only works in Poetry 1.2.0 or

Eliaz Bobadilla 4 Sep 24, 2021
A python script that will automate the boring task of login to the captive portal again and again

A python script that will automate the boring task of login to the captive portal again and again

Rakib Hasan 2 Feb 09, 2022
Simple Crud Python vs MySQL

Simple Crud Python vs MySQL The idea came when I was studying MySQ... A desire to create a python program that can give access to a "localhost" databa

Lucas 1 Jan 21, 2022
Alternative StdLib for Nim for Python targets

Alternative StdLib for Nim for Python targets, hijacks Python StdLib for Nim

Juan Carlos 100 Jan 01, 2023
A modern message based async agent framework

Munggoggo A modern message based async agent framework An asyncio based agent platform written in Python and based on RabbitMQ. Agents are isolated pr

24 Dec 28, 2022
Turn crypto miner on/off depending on powerwall charge level

Mining Crypto with Tesla Solar and Powerwalls This script turns a crypto miner on and off when the Tesla Powerwall level drops/rises above a certain t

Matt 1 Nov 09, 2021
Virtual Assistant Using Python

-Virtual-Assistant-Using-Python Virtual desktop assistant is an awesome thing. If you want your machine to run on your command like Jarvis did for Ton

Bade om 1 Nov 13, 2021
pgvector support for Python

pgvector-python pgvector support for Python Great for online recommendations 🎉 Supports Django, SQLAlchemy, Psycopg 2, Psycopg 3, and asyncpg Install

Andrew Kane 37 Dec 20, 2022
Simple python script for AD enumeration

AutoAD - Simple python script for AD enumeration This tool was created on my spare time to help fellow penetration testers in automating the basic enu

Mohammad Arman 28 Jun 21, 2022
Set up a sidechain for the XRPL quickly and easily

Sidechain Launch Kit Introduction This directory contains python scripts to tests and explore side chains. This document walks through the steps to se

Xpring Engineering 15 Dec 08, 2022
Lags valorant servers by rapidly picking up and throwing shorties.

Lags valorant servers by rapidly picking up and throwing shorties.

Eric Still 9 Dec 30, 2021
Python interface to IEX and IEX cloud APIs

Python interface to IEX Cloud Referral Please subscribe to IEX Cloud using this referral code. Getting Started Install Install from pip pip install py

IEX Cloud 41 Dec 21, 2022
Nmap script to detect a Microsoft Exchange instance version with OWA enabled.

Nmap script to detect a Microsoft Exchange instance version with OWA enabled.

Luciano Righetti 27 Nov 17, 2022
Python Commodore BBS multi-client

python-cbm-bbs-petscii Python Commodore BBS multi-client This is intended for commodore 64, c128 and most commodore compatible machines (as the new Co

7 Sep 16, 2022