check_libvirt_hosts.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:igmonplugins 作者: innogames 项目源码 文件源码
def main():
    try:
        conn = openReadOnly(None)
    except libvirtError as error:
        print('WARNING: could not connect to libvirt: ' + str(error))
        exit(1)

    inactive_domains = [d for d in conn.listAllDomains() if not d.isActive()]
    if inactive_domains:
        print('WARNING: ' + ', '.join(
            '{} is defined but not running'.format(d.name())
            for d in inactive_domains
        ))
        exit(1)

    print('OK: all defined domains are running')
    exit(0)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号