title: Continuous check for VPN Connectivity - Python
body: <p>Is there any efficient way to check and report in a log file or on the console may be... when ever the VPN is disconnected?</p>
  
  <pre><code>import time
  print time.asctime( time.localtime(time.time()) )
  </code></pre>
  
  <p>Can print the time but I do not know what is the code to recursively find whether the VPN is active or not. Pinging it in a while(1) would be a stupid way to check if the connection is active or not. Any way to achieve this?</p>