1

I am using KVM with virt-manager to migrate the virtual machines from one system to another. VM Migraiton is successfully done and migration time is measured correctly. Now, I am stuck for how to measure downtime.

0

It is not easy to see when a system is stopped but dmesg -w will show something when you resume your system.

The best way might be having a logger running ind a console:

while : ; do sleep 1 ; date +%FT%T >> downtime.log ; done

and then look for missing logging.

You can also calculate downtime at the same time:

while : ; do sleep 1 ; NEW=$(date +%s) ; echo $(date +%FT%T) $((NEW-LST)) >> downtime.log ; LST=$NEW ; done

It is a bit longer so use a script:

#! /bin/bash
LST=$(date +%s)
while : ; do
  sleep 1
  NEW=$(date +%s)
  echo $(date +%FT%T) $((NEW-LST)) >> downtime.log
  LST=$NEW
done

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.