/[sysadmin-cookbook]/recepies/lxc/lxc-watchdog.sh
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /recepies/lxc/lxc-watchdog.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 271 by dpavlin, Fri Sep 9 18:21:14 2011 UTC revision 272 by dpavlin, Fri Sep 9 18:27:11 2011 UTC
# Line 55  lxc_ip() { Line 55  lxc_ip() {
55    
56  lxc_status() {  lxc_status() {
57          ( find /var/lib/lxc/ -name "config" | cut -d/ -f5 | sort -u | while read name ; do          ( find /var/lib/lxc/ -name "config" | cut -d/ -f5 | sort -u | while read name ; do
58                  status=`lxc-info -n $name 2>/dev/null | grep state: | cut -d: -f2`                  status=`lxc-info -n $name 2>/dev/null | grep state: | cut -d: -f2`     # 0.7.5
59                    test -z "$status" && status=`lxc-info -n $name | sed -e 's/^.* is //'` # 0.7.2
60                  boot="-"                  boot="-"
61                  test -s /var/lib/lxc/$name/on_boot && boot="boot"                  test -s /var/lib/lxc/$name/on_boot && boot="boot"
62                  echo "$name $status $boot $(lxc_rootfs $name) $(lxc_ip $name) $(lxc_hostname $name)"                  echo "$name $status $boot $(lxc_rootfs $name) $(lxc_ip $name) $(lxc_hostname $name)"

Legend:
Removed from v.271  
changed lines
  Added in v.272

  ViewVC Help
Powered by ViewVC 1.1.26