Compare commits

...
Sign in to create a new pull request.

6 commits

Author SHA1 Message Date
Fedora Release Engineering
840bcc6f81 dist-git conversion 2010-07-29 14:58:06 +00:00
Bill Nottingham
a24c676d19 Fix typo that causes a failure to update the common directory. (releng
#2781)
2009-11-26 01:13:35 +00:00
Richard W.M. Jones
a15733e15c Some changes to the default configuration file suggested by SAP to make it
more CIM standards compliant.
2009-11-02 11:03:52 +00:00
Richard W.M. Jones
fd80342460 - New upstream based on git e9db007b.
- Fix segfault in vm-dump-metrics (RHBZ#529348).
- On error, vm-dump-metrics now exits with status code 1.
2009-10-16 16:10:59 +00:00
Richard W.M. Jones
a30bd027da - New upstream based on git ea2f772d.
- Update the configuration file based on upstream changes to how virsh has
    to be run.
- vhostmd should run non-root as user 'vhostmd'.
- Allow libvirt URI to be configured.
2009-10-15 17:53:57 +00:00
Kevin Fenzi
a9ddf11d09 Initialize branch F-11 for vhostmd 2009-10-15 17:22:51 +00:00
9 changed files with 115 additions and 113 deletions

View file

View file

@ -1,61 +0,0 @@
From c0cbeed281739194adfb9c43d01197a4f84d8d95 Mon Sep 17 00:00:00 2001
From: Richard Jones <rjones@redhat.com>
Date: Tue, 13 Oct 2009 11:18:49 +0100
Subject: [PATCH] Further changes to avoid using xenstore.
We missed two more places where libxenstore is used. This commit
changes the Makefiles to not link to xenstore when --without-xenstore
is given.
---
test/Makefile.am | 10 ++++++++--
vm-dump-metrics/Makefile.am | 5 ++++-
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/test/Makefile.am b/test/Makefile.am
index 42e6a59..fd2cd60 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -5,7 +5,10 @@ INCLUDES = \
noinst_PROGRAMS = test_static test_dyn
test_static_SOURCES = main.c
-test_static_LDADD = ../libmetrics/libmetrics.la $(LIBXML_LIBS) -lxenstore
+test_static_LDADD = ../libmetrics/libmetrics.la $(LIBXML_LIBS)
+if WITH_XENSTORE
+test_static_LDADD += -lxenstore
+endif
test_static_DEPENDENCIES = \
../libmetrics/libmetrics.h \
@@ -13,7 +16,10 @@ test_static_DEPENDENCIES = \
test_dyn_SOURCES = main.c
test_dyn_CFLAGS = -DUSE_DL_OPEN
-test_dyn_LDADD = ../libmetrics/libmetrics.la $(LIBXML_LIBS) -lxenstore
+test_dyn_LDADD = ../libmetrics/libmetrics.la $(LIBXML_LIBS)
+if WITH_XENSTORE
+test_dyn_LDADD += -lxenstore
+endif
test_dyn_DEPENDENCIES = \
../libmetrics/libmetrics.h \
diff --git a/vm-dump-metrics/Makefile.am b/vm-dump-metrics/Makefile.am
index c29a4cd..0cde35d 100644
--- a/vm-dump-metrics/Makefile.am
+++ b/vm-dump-metrics/Makefile.am
@@ -8,8 +8,11 @@ endif
sbin_PROGRAMS = vm-dump-metrics
vm_dump_metrics_SOURCES = main.c
-vm_dump_metrics_LDADD = ../libmetrics/libmetrics.la $(LIBXML_LIBS) -lxenstore
+vm_dump_metrics_LDADD = ../libmetrics/libmetrics.la $(LIBXML_LIBS)
vm_dump_metrics_LDFLAGS = -static
+if WITH_XENSTORE
+vm_dump_metrics_LDADD += -lxenstore
+endif
vm_dump_metrics_DEPENDENCIES = \
../libmetrics/libmetrics.h \
--
1.6.2.5

View file

@ -1,21 +0,0 @@
# Makefile for source rpm: vhostmd
# $Id$
NAME := vhostmd
SPECFILE = $(firstword $(wildcard *.spec))
define find-makefile-common
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
endef
MAKEFILE_COMMON := $(shell $(find-makefile-common))
ifeq ($(MAKEFILE_COMMON),)
# attept a checkout
define checkout-makefile-common
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
endef
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
endif
include $(MAKEFILE_COMMON)

View file

@ -1 +0,0 @@
vhostmd-0_4-0_1_git326f0012172_fc11:HEAD:vhostmd-0.4-0.1.git326f0012172.fc11.src.rpm:1255456588

View file

@ -1 +1 @@
3e96ae064b7accaea68160d48379c92f vhostmd-0.4.tar.bz2
139650528c154da52a65adedfb8e83cf vhostmd-0.4.tar.bz2

View file

@ -39,55 +39,112 @@ within the vm element.
</metric>
<metric type="string" context="host">
<name>VirtualizationVendor</name>
<action>echo Fedora</action>
<action>rpm -qi libvirt| grep Vendor: |awk '{print substr($0, index($0,$5)) }'</action>
</metric>
<!-- SAP "CIM" -->
<metric type="string" context="host">
<name>VirtualizationProductInfo</name>
<action>virsh version | grep API | gawk -F': ' '{print $2}'</action>
<name>VirtProductInfo</name>
<action>virsh -r CONNECT version | grep API | gawk -F': ' '{print $2}'</action>
</metric>
<!-- SAP "CIM" -->
<metric type="string" context="host">
<name>HostSystemInfo</name>
<action>hostname -s</action>
</metric>
<!-- SAP "CIM" -->
<metric type="uint32" context="host">
<name>TotalPhyCPUs</name>
<action>virsh nodeinfo | grep 'CPU(s):' | gawk -F': +' '{print $2}'</action>
<name>NumberOfPhysicalCPUsUtilized</name>
<action>virsh -r CONNECT nodeinfo | grep 'CPU(s):' | gawk -F': +' '{print $2}'</action>
</metric>
<metric type="uint32" context="host">
<name>NumCPUs</name>
<action>virsh nodeinfo | grep 'CPU(s):' | gawk -F': +' '{print $2}'</action>
<!-- SAP "CIM" -->
<metric type="uint64" context="host">
<name>MemoryAllocatedToVirtualServers</name>
<action>virsh -r CONNECT nodeinfo | grep 'Memory size:' | gawk -F' +' '{ printf "%d\n" $3/1024 }'</action>
</metric>
<!-- SAP "CIM" -->
<metric type="uint64" context="host">
<name>FreePhysicalMemory</name>
<action>
free|egrep -i '^[[:space:]]*(Mem:)' \
|awk 'BEGIN { sum = 0; }
{ sum += $4; }
END { printf "%10d\n", sum/1024; }'
</action>
</metric>
<metric type="uint64" context="host">
<name>TotalPhyMem</name>
<action>virsh nodeinfo | grep 'Memory size:' | gawk -F' +' '{print $3}'</action>
<name>UsedPhysicalMemory</name>
<action>
free|egrep -i '^[[:space:]]*(Mem:)' \
|awk 'BEGIN { sum = 0; }
{ sum += $3; }
END { printf "%10d\n", sum/1024; }'
</action>
</metric>
<!-- SAP "CIM" -->
<metric type="uint64" context="host">
<name>UsedMem</name>
<action>free | grep '^Mem:' | gawk '{print $3}'</action>
<name>FreeVirtualMemory</name>
<action>
free|egrep -i '^[[:space:]]*(Mem:|Swap:)' \
|awk 'BEGIN { sum = 0; }
{ sum += $4; }
END { printf "%10d\n", sum/1024; }'
</action>
</metric>
<!-- SAP "CIM" -->
<metric type="uint64" context="host">
<name>FreeMem</name>
<action>free | grep '^Mem:' | gawk '{print $4}'</action>
<name>UsedVirtualMemory</name>
<action>
free|egrep -i '^[[:space:]]*(Mem:|Swap:)' \
|awk 'BEGIN { sum = 0; }
{ sum += $3; }
END { printf "%10d\n", sum/1024; }'
</action>
</metric>
<metric type="uint64" context="host">
<name>PagedInMemory</name>
<action>echo "$((`vmstat -s | gawk '/pages paged in/ {print $1}'` / 1024))"</action>
</metric>
<!-- SAP "CIM" -->
<metric type="uint64" context="host">
<!-- TODO: CHECK -->
<name>PagedOutMemory</name>
<action>echo "$((`vmstat -s | gawk '/pages paged out/ {print $1}'` / 1024))"</action>
</metric>
<metric type="group" context="host">
<name>PageRates</name>
<action>pagerate.pl</action>
<!-- SAP "CIM" -->
<variable name="PageInRate" type="uint64"/>
<variable name="PageFaultRate" type="uint64"/>
</metric>
<!--<metric type="real64" context="host">
<name>TotalCPUTime</name>
<action>virsh dominfo 0 | sed 's/: */:/' | \
<name>TotalCPUTime</name>
<action>virsh -r CONNECT dominfo 0 | sed 's/: */:/' | \
gawk -F: '/CPU time/ {print $2;}'</action>
</metric>-->
<!-- SAP "CIM" -->
<metric type="real64" context="vm">
<name>TotalCPUTime</name>
<action>virsh dominfo NAME | sed 's/: */:/' | \
<action>virsh -r CONNECT dominfo NAME | sed 's/: */:/' | \
gawk -F: '/CPU time/ {print $2;}'</action>
</metric>
<metric type="uint32" context="vm">
<name>NumberOfAssignedPhysicalCPUs</name>
<action>virsh -r CONNECT dominfo NAME | grep 'CPU(s):' | gawk -F': +' '{print $2}'</action>
</metric>
<!-- SAP "CIM" -->
<metric type="uint64" context="vm">
<name>PhysicalMemoryAllocatedToVirtualSystem</name>
<action>virsh -r CONNECT dominfo NAME | grep 'Max memory:' | gawk -F' +' '{printf "%d\n", $3/1024}'</action>
</metric>
<!-- will only be supported by Fedora -->
<!-- <metric type="uint64" context="vm">
<name>UsedMem</name>
<action>virsh -r CONNECT dominfo NAME | grep 'Used memory:' | gawk -F' +' '{printf "%d\n", $3/1024}'</action>
</metric> -->
</metrics>
</vhostmd>
<!--
vi:ts=2:sw=2:expandtab:ignorecase:
-->
<!-- EOF -->

View file

@ -30,6 +30,12 @@ fi
if [ -n "$VHOSTMD_CONFIG" ]; then
ARGS="$ARGS --config $VHOSTMD_CONFIG"
fi
if [ -n "$VHOSTMD_USER" ]; then
ARGS="$ARGS --user $VHOSTMD_USER"
fi
if [ -n "$VHOSTMD_URI" ]; then
ARGS="$ARGS --connect $VHOSTMD_URI"
fi
lockfile=/var/lock/subsys/$prog

View file

@ -8,7 +8,7 @@
Summary: Virtualization host metrics daemon
Name: vhostmd
Version: 0.4
Release: 0.1.git326f0012172%{?dist}
Release: 0.6.gite9db007b%{?dist}
License: GPLv2+
Group: System Environment/Daemons
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
@ -16,24 +16,18 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
URL: http://gitorious.org/vhostmd
# Upstream tarball hosting is screwed at the moment. This release is
# a pre-release of 0.4, based on git 326f00121729760c0236ef1b56b905f85470c740
# with 'make dist' done by the packager.
# a pre-release of 0.4, based on the git commit names in the Release
# tag above, with 'make dist' done by the packager.
Source0: vhostmd-%{version}.tar.bz2
Source1: vhostmd.init
Source2: vhostmd.sysconfig
Source3: vhostmd.conf
# Fix --without-xenstore option. Patch posted upstream on 2009-10-13.
Patch0: 0001-Further-changes-to-avoid-using-xenstore.patch
BuildRequires: chrpath
BuildRequires: pkgconfig
BuildRequires: libxml2-devel
BuildRequires: libvirt-devel
# Used when we are patching autotools configuration.
BuildRequires: automake, autoconf, libtool
%if %{have_xen}
BuildRequires: xen-devel
%endif
@ -42,6 +36,7 @@ Requires(post): chkconfig
Requires(preun): chkconfig
Requires(preun): initscripts
Requires(postun): initscripts
Requires(pre): shadow-utils
%description
@ -74,9 +69,6 @@ Header and libraries necessary for metrics gathering development
%prep
%setup -q
%patch0 -p1
./autogen.sh
%build
%configure \
@ -144,6 +136,14 @@ fi
%postun -n vm-dump-metrics -p /sbin/ldconfig
%pre
getent group vhostmd >/dev/null || groupadd -r vhostmd
getent passwd vhostmd >/dev/null || \
useradd -r -g vhostmd -d %{_datadir}/vhostmd -s /sbin/nologin \
-c "Virtual Host Metrics Daemon" vhostmd
exit 0
%files
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING README
@ -183,6 +183,22 @@ fi
%changelog
* Mon Nov 2 2009 Richard W.M. Jones <rjones@redhat.com> - 0.4-0.6.gite9db007b
- Some changes to the default configuration file suggested by SAP to
make it more CIM standards compliant.
* Fri Oct 16 2009 Richard W.M. Jones <rjones@redhat.com> - 0.4-0.5.gite9db007b
- New upstream based on git e9db007b.
- Fix segfault in vm-dump-metrics (RHBZ#529348).
- On error, vm-dump-metrics now exits with status code 1.
* Thu Oct 15 2009 Richard W.M. Jones <rjones@redhat.com> - 0.4-0.2.gitea2f772d
- New upstream based on git ea2f772d.
- Update the configuration file based on upstream changes to how virsh
has to be run.
- vhostmd should run non-root as user 'vhostmd'.
- Allow libvirt URI to be configured.
* Tue Oct 13 2009 Richard W.M. Jones <rjones@redhat.com> - 0.4-0.1.git326f0012172
- Move to pre-release of 0.4, self-built tarball.
- Disable xenstore on non-x86 platforms.

View file

@ -3,3 +3,9 @@
# Override the default configuration file path.
#VHOSTMD_CONFIG=/path/to/vhostmd.conf
# Set the user that the daemon runs as after dropping root privs.
VHOSTMD_USER=vhostmd
# Set the libvirt URI.
VHOSTMD_URI=qemu:///system