projects
/
sysadmin-cookbook
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fdb104a
)
show ip and hostname in status
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Wed, 26 May 2010 10:19:05 +0000
(10:19 +0000)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Wed, 26 May 2010 10:19:05 +0000
(10:19 +0000)
git-svn-id: svn://svn.rot13.org/sysadmin-cookbook@216
191e9f34
-6774-4a6d-acfc-
7664dacd4a2a
recepies/lxc/lxc-watchdog.sh
patch
|
blob
|
history
diff --git
a/recepies/lxc/lxc-watchdog.sh
b/recepies/lxc/lxc-watchdog.sh
index
0218bb1
..
39d0ec7
100755
(executable)
--- a/
recepies/lxc/lxc-watchdog.sh
+++ b/
recepies/lxc/lxc-watchdog.sh
@@
-44,8
+44,10
@@
lxc_rootfs() {
lxc_status() {
( find /var/lib/lxc/ -name "config" | cut -d/ -f5 | sort -u | xargs -i lxc-info -n {} | sed "s/'//g" | while read name is status ; do
boot="-"
+ hostname=`cat $(lxc_rootfs $name)/etc/hostname`
+ ip=`grep address $(lxc_rootfs $name)/etc/network/interfaces | sed 's/.*address //'`
test -s /var/lib/lxc/$name/on_boot && boot="boot"
- echo "$name $status $boot $(lxc_rootfs $name)"
+ echo "$name $status $boot $(lxc_rootfs $name)
$ip $hostname
"
done ) | column -t
}