Page MenuHomec4science

get_hostid.sh
No OneTemporary

File Metadata

Created
Sun, Nov 10, 20:02

get_hostid.sh

#!/bin/sh
nova usage 1> /dev/null || exit
for i in $(nova list | grep Running | awk '{print $2}'); do
data=$(nova show $i)
echo -n "$data" | grep hostId | awk '{print $4}' | tr -d "\n"
echo -n " "
echo -n "$data" | grep ' name' | awk '{print $4}' | tr -d "\n"
echo
done

Event Timeline