#!/bin/sh
export Lang=en_US
export LC_ALL=en_US

echo "distro: centos6"
echo "release_string: `cat /etc/redhat-release 2>/dev/null`"
xm info
free -m | grep "Mem" | awk '{print "dom0_memory: " $2}'
threads_per_core=$(xl info  2>/dev/null | grep threads_per_core 2>/dev/null | awk '{print $3}' 2>/dev/null);
nr_cpus=$(xl info  2>/dev/null | grep nr_cpus 2>/dev/null | awk '{print $3}' 2>/dev/null);
echo "cores: $(($nr_cpus/$threads_per_core))";

# Reporting onapp-store-install (included into initrd) and onapp-hv-tools versions
[ -f /onapp/onapp-store-install.version ] && echo "storage_version: `cat /onapp/onapp-store-install.version`"
[ -f /onapp/onapp-hv-tools.version ] && echo "hv_tools_version: `cat /onapp/onapp-hv-tools.version`"
[ -f /onappstore/package-version.txt ] && echo "storage_package_version: `grep src.rpm /onappstore/package-version.txt | sed 's/^.\+:[[:space:]]\+\(.\+\)\.src\.rpm/\1/'`"

virsh version | grep 'Using library:' | sed 's/Using library: libvirt/libvirt_version:/g;'

exit 1
