Django项目:CMDB(服务器硬件资产自动采集系统)--10--06CMDB测试Linux系统采集硬件数据的命令05

cd /py/AutoClient/bin

python3 auto-client.py

/usr/local/python3/bin/pip install requests

python3 auto-client.py

https://www.bejson.com/

 {
    'os_platform': 'Linux',
    'os_version': '\S',
    'hostname': 'DKL18U83RFAQI3G',
    'cpu': {
        'status': True,
        'message': None,
        'data': {
            'cpu_count': 1,
            'cpu_physical_count': 1,
            'cpu_model': ' Intel(R) Celeron(R) CPU        E3500  @ 2.70GHz'
        },
        'error': None
    },
    'disk': {
        'status': False,
        'message': None,
        'data': None,
        'error': None
    },
    'main_board': {
        'status': True,
        'message': None,
        'data': {
            'manufacturer': 'innotek GmbH',
            'model': 'VirtualBox',
            'sn': '0'
        },
        'error': None
    },
    'memory': {
        'status': True,
        'message': None,
        'data': {
            '/dev/dm-1': {
                'slot': '/dev/dm-1',
                'model': 'partition',
                'capacity': '820',
                'USED': '8K',
                'PRIO': '-1'
            }
        },
        'error': None
    },
    'nic': {
        'status': True,
        'message': None,
        'data': {
            'enp0s8': {
                'up': True,
                'hwaddr': '08:00:27:75:03:bb',
                'ipaddrs': '192.168.80.76',
                'netmask': '255.255.255.0'
            }
        },
        'error': None
    }
}
all
原文地址:https://www.cnblogs.com/ujq3/p/9245767.html