<div dir="ltr">Hi Michal,<div><br></div><div><span style="font-family:arial,sans-serif;font-size:13px">virConnectOpen is for connecting to a host right..?</span><br></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br>
</span></div><div><span style="font-family:arial,sans-serif;font-size:13px">I want to check the host status, whether the connection to the host is active or not..</span></div><div><span style="font-family:arial,sans-serif;font-size:13px">for that purpose we have to use </span>virConnectIsAlive()</div>
<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div>I'm using libvirt python bindings,<br></div><div>here is the function defnintion.</div><div><br></div><div><div>    def isAlive(self):</div>
<div>        """Determine if the connection to the hypervisor is still alive</div><div>        </div><div>        A connection will be classed as alive if it is either local, or running</div><div>        over a channel (TCP or UNIX socket) which is not closed. """</div>
<div>        ret = libvirtmod.virConnectIsAlive(self._o)</div><div>        if ret == -1: raise libvirtError ('virConnectIsAlive() failed', conn=self)</div><div>        return ret</div></div><div><br></div><div>Once if you connect to a host thereafter it is always giving status as 1(true), no matter whether the connection is broken or not..</div>
<div><br></div><div>-Sijo</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jun 13, 2014 at 1:47 PM, Michal Privoznik <span dir="ltr"><<a href="mailto:mprivozn@redhat.com" target="_blank">mprivozn@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On 11.06.2014 14:30, Sijo Jose wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Hi,<br>
Using libvirt how can we check the status of a remote/local host machine..<br>
isAlive() method is giving true even if the internet connection is broken OR<br>
  libvirt demon in the remote machine is being stopped.<br>
<br>
so isAlive() does not seems to be handy,<br>
<br>
Is there some other way to get the status of remote host..?<br>
</blockquote>
<br></div></div>
Isn't virConnectOpen*() enough? If it returns NULL then you can tell by error message what went wrong.<span class="HOEnZb"><font color="#888888"><br>
<br>
Michal<br>
</font></span></blockquote></div><br></div>