用Python写一个Linux巡检脚本

好的,下面是一个简单的Python脚本,可以用于巡检Linux系统的基本信息:

importplatform

def check_system_info():
    # 获取操作系统名称及版本
    os_name = platform.system()
    os_release = platform.release()
    print("操作系统名称: ", os_name)
    print("操作系统版本: ", os_release)
    
    # 获取系统的主机名
    host_name = platform.node()
    print(

猜你喜欢

转载自blog.csdn.net/weixin_42576410/article/details/129576143
今日推荐