commit
61ced997ec
@ -0,0 +1 @@
|
|||||||
|
SOURCES/vhostmd-1.1.tar.gz
|
@ -0,0 +1 @@
|
|||||||
|
93e6bbbf15be248e7da222d377d2b98fb4c2be24 SOURCES/vhostmd-1.1.tar.gz
|
@ -0,0 +1,42 @@
|
|||||||
|
From 83cc269f6892852be94467cea771b3ad1da8a369 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Jim Fehlig <jfehlig@suse.com>
|
||||||
|
Date: Tue, 8 Oct 2019 20:56:18 -0600
|
||||||
|
Subject: [PATCH] Relax virtio requirement in config file
|
||||||
|
|
||||||
|
When the virtio transport was introduced the schema was changed to
|
||||||
|
require a <virtio> transport in vhostmd.conf. When updating existing
|
||||||
|
deployments without a virtio transport specified in vhostmd.conf,
|
||||||
|
vhostmd fails to start
|
||||||
|
|
||||||
|
/usr/sbin/vhostmd -d
|
||||||
|
/etc/vhostmd/vhostmd.conf:41: element globals: validity error : Element
|
||||||
|
globals content does not follow the DTD, expecting (disk , virtio ,
|
||||||
|
update_period , path , transport+), got (disk update_period path transport )
|
||||||
|
validate_config_file(): Failed to validate :/etc/vhostmd/vhostmd.conf
|
||||||
|
Config file: /etc/vhostmd/vhostmd.conf, fails DTD validation
|
||||||
|
|
||||||
|
Relax the requirement for virtio transport in the schema. With the
|
||||||
|
introduction of multiple transports perhaps the others shoud be optional
|
||||||
|
as well, but requiring virtio is clearly a regression.
|
||||||
|
|
||||||
|
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
|
||||||
|
---
|
||||||
|
vhostmd.dtd | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/vhostmd.dtd b/vhostmd.dtd
|
||||||
|
index db417fd..888270e 100644
|
||||||
|
--- a/vhostmd.dtd
|
||||||
|
+++ b/vhostmd.dtd
|
||||||
|
@@ -9,7 +9,7 @@ Virtual Host Metrics Daemon (vhostmd). Configuration file DTD
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!ELEMENT vhostmd (globals,metrics)>
|
||||||
|
-<!ELEMENT globals (disk,virtio,update_period,path,transport+)>
|
||||||
|
+<!ELEMENT globals (disk,virtio*,update_period,path,transport+)>
|
||||||
|
|
||||||
|
<!ELEMENT disk (name,path,size)>
|
||||||
|
<!ELEMENT name (#PCDATA)>
|
||||||
|
--
|
||||||
|
2.24.1
|
||||||
|
|
@ -0,0 +1,431 @@
|
|||||||
|
<?xml version="1.0" ?>
|
||||||
|
<!DOCTYPE vhostmd SYSTEM "vhostmd.dtd">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
|
||||||
|
Configuration file for virtual host metrics daemon (vhostmd).
|
||||||
|
|
||||||
|
A better, less noisy, more minimal configuration file
|
||||||
|
which doesn't depend on Xen.
|
||||||
|
|
||||||
|
Supported metric types are: int32, uint32, int64, uint64, real32,
|
||||||
|
real64, and string.
|
||||||
|
|
||||||
|
A metric's value is set to the output produced by executing its action.
|
||||||
|
|
||||||
|
'action' can include the special token NAME, in which case the name of
|
||||||
|
the vm currently under inspection is substituted for NAME. Only useful
|
||||||
|
within the vm element.
|
||||||
|
|
||||||
|
-->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 1 2 3 4 5 6 -->
|
||||||
|
<!-- 678901234567890123456789012345678901234567890123456789012345678 -->
|
||||||
|
|
||||||
|
|
||||||
|
<!--
|
||||||
|
We sometimes use the following awk form to filter the output of the
|
||||||
|
virsh command (mostly `virsh -r CONNECT dominfo NAME' - use
|
||||||
|
`virsh -r dominfo <dom id>' to test on the commandline) into a standard
|
||||||
|
format like
|
||||||
|
|
||||||
|
ID:6
|
||||||
|
NAME:ls3055v0
|
||||||
|
UUID:955c3b65-d013-547f-321b-9fea65439c40
|
||||||
|
OS_TYPE:hvm
|
||||||
|
STATE:running
|
||||||
|
CPU(S):4
|
||||||
|
CPU_TIME:433016.4:S
|
||||||
|
MAX_MEMORY:20000000:KB
|
||||||
|
USED_MEMORY:16384000:KB
|
||||||
|
AUTOSTART:disable
|
||||||
|
|
||||||
|
We do this to extract numbers out of physical quantities in a reliable
|
||||||
|
way.
|
||||||
|
-->
|
||||||
|
<!--
|
||||||
|
|awk -F ':' '
|
||||||
|
function mkvarnam(s) { # UPPER_CASE_UNDERSCORE
|
||||||
|
sub("(^[[:space:]]+|[[:space:]]+$)", "", s); # trim
|
||||||
|
gsub("[[:space:]]+", "_", s); s = toupper(s);
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
function filt_phys(s, sep, num, unit) { # 42.0 KM
|
||||||
|
sub("(^[[:space:]]+|[[:space:]]+$)", "", s); # trim
|
||||||
|
if ( s ~ /^[0-9]*\.?[0-9]+[[:space:]]*[[:alpha:]]+$/ )
|
||||||
|
{
|
||||||
|
num = s; unit = s;
|
||||||
|
sub("[[:space:]]*[[:alpha:]]+$", "", num);
|
||||||
|
sub("^[0-9]*[.]?[0-9]+[[:space:]]*", "", unit);
|
||||||
|
return num sep toupper(unit);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/:/ {
|
||||||
|
d1 = substr($0, 1, index($0, ":") - 1);
|
||||||
|
rest = substr($0, index($0, ":") + 1);
|
||||||
|
printf("%s:%s\n", mkvarnam(d1), filt_phys(rest, ":"));
|
||||||
|
}' \
|
||||||
|
-->
|
||||||
|
|
||||||
|
<vhostmd>
|
||||||
|
<globals>
|
||||||
|
<disk>
|
||||||
|
<name>host-metrics-disk</name>
|
||||||
|
<path>/dev/shm/vhostmd0</path>
|
||||||
|
<!-- must be between [128 KB, 256 MB] in size -->
|
||||||
|
<size unit="k">256</size>
|
||||||
|
</disk>
|
||||||
|
<virtio>
|
||||||
|
<max_channels>1024</max_channels>
|
||||||
|
<expiration_time>15</expiration_time>
|
||||||
|
</virtio>
|
||||||
|
<update_period>60</update_period>
|
||||||
|
<path>/bin:/sbin:/usr/bin:/usr/sbin:/usr/share/vhostmd/scripts</path>
|
||||||
|
<transport>vbd</transport>
|
||||||
|
<!-- <transport>xenstore</transport> -->
|
||||||
|
<transport>virtio</transport>
|
||||||
|
</globals>
|
||||||
|
<metrics>
|
||||||
|
<metric type="string" context="host">
|
||||||
|
<name>HostName</name>
|
||||||
|
<action>hostname</action>
|
||||||
|
</metric>
|
||||||
|
<metric type="uint64" context="host">
|
||||||
|
<name>Time</name>
|
||||||
|
<action>date +%s</action>
|
||||||
|
</metric>
|
||||||
|
<metric type="string" context="host">
|
||||||
|
<name>VirtualizationVendor</name>
|
||||||
|
<action>
|
||||||
|
rpm -q --queryformat "%{VENDOR}\n" libvirt | sort -u
|
||||||
|
</action>
|
||||||
|
</metric>
|
||||||
|
<!-- SAP "CIM" -->
|
||||||
|
<metric type="string" context="host">
|
||||||
|
<name>VirtProductInfo</name>
|
||||||
|
<action>
|
||||||
|
virsh -r CONNECT version \
|
||||||
|
|awk -F ':' '
|
||||||
|
function mkvarnam(s) { # UPPER_CASE_UNDERSCORE
|
||||||
|
sub("(^[[:space:]]+|[[:space:]]+$)", "", s); # trim
|
||||||
|
gsub("[[:space:]]+", "_", s); s = toupper(s);
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
function filt_phys(s, sep, num, unit) { # 42.0 KM
|
||||||
|
sub("(^[[:space:]]+|[[:space:]]+$)", "", s); # trim
|
||||||
|
if ( s ~ /^[0-9]*\.?[0-9]+[[:space:]]*[[:alpha:]]+$/ )
|
||||||
|
{
|
||||||
|
num = s; unit = s;
|
||||||
|
sub("[[:space:]]*[[:alpha:]]+$", "", num);
|
||||||
|
sub("^[0-9]*[.]?[0-9]+[[:space:]]*", "", unit);
|
||||||
|
return num sep toupper(unit);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/:/ {
|
||||||
|
d1 = substr($0, 1, index($0, ":") - 1);
|
||||||
|
rest = substr($0, index($0, ":") + 1);
|
||||||
|
printf("%s:%s\n", mkvarnam(d1), filt_phys(rest, ":"));
|
||||||
|
}' \
|
||||||
|
| awk -F: '$1 == "USING_API" { print $2; }'
|
||||||
|
</action>
|
||||||
|
</metric>
|
||||||
|
<!-- SAP "CIM" -->
|
||||||
|
<metric type="string" context="host">
|
||||||
|
<name>HostSystemInfo</name>
|
||||||
|
<action>hostname -s</action>
|
||||||
|
</metric>
|
||||||
|
<!-- SAP "XCIM" -->
|
||||||
|
<metric type="uint32" context="host">
|
||||||
|
<name>NumberOfPhysicalCPUs</name>
|
||||||
|
<!-- physical CPUs usable by the virtual machines -->
|
||||||
|
<!-- SAP "CIM" uses "NumberOfPhysicalCPUsUtilized" -->
|
||||||
|
<!-- which means something different, i.e. -->
|
||||||
|
<!-- "physical CPUs used by the virtual machines" -->
|
||||||
|
<!-- but may be calculated (on client side) by -->
|
||||||
|
<!-- Delta TotalCPUTime / Delta ElapsedTime -->
|
||||||
|
<action>
|
||||||
|
virsh -r CONNECT nodeinfo \
|
||||||
|
|awk -F ':' '
|
||||||
|
function mkvarnam(s) { # UPPER_CASE_UNDERSCORE
|
||||||
|
sub("(^[[:space:]]+|[[:space:]]+$)", "", s); # trim
|
||||||
|
gsub("[[:space:]]+", "_", s); s = toupper(s);
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
function filt_phys(s, sep, num, unit) { # 42.0 KM
|
||||||
|
sub("(^[[:space:]]+|[[:space:]]+$)", "", s); # trim
|
||||||
|
if ( s ~ /^[0-9]*\.?[0-9]+[[:space:]]*[[:alpha:]]+$/ )
|
||||||
|
{
|
||||||
|
num = s; unit = s;
|
||||||
|
sub("[[:space:]]*[[:alpha:]]+$", "", num);
|
||||||
|
sub("^[0-9]*[.]?[0-9]+[[:space:]]*", "", unit);
|
||||||
|
return num sep toupper(unit);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/:/ {
|
||||||
|
d1 = substr($0, 1, index($0, ":") - 1);
|
||||||
|
rest = substr($0, index($0, ":") + 1);
|
||||||
|
printf("%s:%s\n", mkvarnam(d1), filt_phys(rest, ":"));
|
||||||
|
}' \
|
||||||
|
| awk -F: '$1 == "CPU(S)" { print $2; }'
|
||||||
|
</action>
|
||||||
|
</metric>
|
||||||
|
<!-- SAP "CIM" -->
|
||||||
|
<metric type="uint64" context="host">
|
||||||
|
<name>MemoryAllocatedToVirtualServers</name>
|
||||||
|
<!-- physical memory used by the virtual machines, -->
|
||||||
|
<!-- (_not_ physical memory usable by the virtual -->
|
||||||
|
<!-- machines) -->
|
||||||
|
<action>
|
||||||
|
free|egrep -i '^[[:space:]]*(Mem:)' \
|
||||||
|
| awk 'BEGIN { sum = 0; }
|
||||||
|
{ sum += $3; }
|
||||||
|
END { printf "%d\n", sum/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 "%d\n", sum/1024; }'
|
||||||
|
</action>
|
||||||
|
</metric>
|
||||||
|
<!-- SAP "CIM" -->
|
||||||
|
<metric type="uint64" context="host">
|
||||||
|
<name>FreeVirtualMemory</name>
|
||||||
|
<action>
|
||||||
|
free|egrep -i '^[[:space:]]*(Mem:|Swap:)' \
|
||||||
|
| awk 'BEGIN { sum = 0; }
|
||||||
|
{ sum += $4; }
|
||||||
|
END { printf "%d\n", sum/1024; }'
|
||||||
|
</action>
|
||||||
|
</metric>
|
||||||
|
<!-- SAP "CIM" -->
|
||||||
|
<metric type="uint64" context="host">
|
||||||
|
<name>UsedVirtualMemory</name>
|
||||||
|
<action>
|
||||||
|
free|egrep -i '^[[:space:]]*(Mem:|Swap:)' \
|
||||||
|
| awk 'BEGIN { sum = 0; }
|
||||||
|
{ sum += $3; }
|
||||||
|
END { printf "%d\n", sum/1024; }'
|
||||||
|
</action>
|
||||||
|
</metric>
|
||||||
|
<!-- SAP "XCIM" -->
|
||||||
|
<metric type="uint64" context="host">
|
||||||
|
<name>PagedInMemory</name>
|
||||||
|
<action>
|
||||||
|
vmstat -s | awk 'BEGIN {
|
||||||
|
cmd = "getconf PAGESIZE";
|
||||||
|
cmd | getline pagesize;
|
||||||
|
close(cmd);
|
||||||
|
}
|
||||||
|
/pages swapped in/ {
|
||||||
|
printf "%d\n", $1 / 1024 * pagesize / 1024;
|
||||||
|
}'
|
||||||
|
</action>
|
||||||
|
</metric>
|
||||||
|
<!-- SAP "CIM" -->
|
||||||
|
<metric type="uint64" context="host">
|
||||||
|
<name>PagedOutMemory</name>
|
||||||
|
<action>
|
||||||
|
vmstat -s | awk 'BEGIN {
|
||||||
|
cmd = "getconf PAGESIZE";
|
||||||
|
cmd | getline pagesize;
|
||||||
|
close(cmd);
|
||||||
|
}
|
||||||
|
/pages swapped out/ {
|
||||||
|
printf "%d\n", $1 / 1024 * pagesize / 1024;
|
||||||
|
}'
|
||||||
|
</action>
|
||||||
|
</metric>
|
||||||
|
<!-- SAP "CIM" -->
|
||||||
|
<metric type="real64" context="host">
|
||||||
|
<name>TotalCPUTime</name>
|
||||||
|
<action>
|
||||||
|
awk '
|
||||||
|
function user_hz( hz)
|
||||||
|
{
|
||||||
|
cmd = "getconf CLK_TCK";
|
||||||
|
cmd | getline;
|
||||||
|
hz = $1;
|
||||||
|
close(cmd);
|
||||||
|
|
||||||
|
return hz;
|
||||||
|
}
|
||||||
|
|
||||||
|
BEGIN {
|
||||||
|
USER_HZ = user_hz();
|
||||||
|
TotalCPUTime = 0;
|
||||||
|
|
||||||
|
while ( 0 < ( getline < "/proc/stat" ) )
|
||||||
|
{
|
||||||
|
if ( "cpu" == $1 )
|
||||||
|
{
|
||||||
|
TotalCPUTime = $2 + $3 + $4;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
close("/proc/stat");
|
||||||
|
|
||||||
|
#printf "USER_HZ = %d\n", USER_HZ | "cat 1>&2";
|
||||||
|
TotalCPUTime /= USER_HZ;
|
||||||
|
printf "%f\n", TotalCPUTime;
|
||||||
|
|
||||||
|
#close("cat 1>&2");
|
||||||
|
}'
|
||||||
|
</action>
|
||||||
|
</metric>
|
||||||
|
<!-- SAP "CIM" -->
|
||||||
|
<metric type="real64" context="vm">
|
||||||
|
<name>TotalCPUTime</name>
|
||||||
|
<action>
|
||||||
|
virsh -r CONNECT dominfo NAME \
|
||||||
|
|awk -F ':' '
|
||||||
|
function mkvarnam(s) { # UPPER_CASE_UNDERSCORE
|
||||||
|
sub("(^[[:space:]]+|[[:space:]]+$)", "", s); # trim
|
||||||
|
gsub("[[:space:]]+", "_", s); s = toupper(s);
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
function filt_phys(s, sep, num, unit) { # 42.0 KM
|
||||||
|
sub("(^[[:space:]]+|[[:space:]]+$)", "", s); # trim
|
||||||
|
if ( s ~ /^[0-9]*\.?[0-9]+[[:space:]]*[[:alpha:]]+$/ )
|
||||||
|
{
|
||||||
|
num = s; unit = s;
|
||||||
|
sub("[[:space:]]*[[:alpha:]]+$", "", num);
|
||||||
|
sub("^[0-9]*[.]?[0-9]+[[:space:]]*", "", unit);
|
||||||
|
return num sep toupper(unit);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/:/ {
|
||||||
|
d1 = substr($0, 1, index($0, ":") - 1);
|
||||||
|
rest = substr($0, index($0, ":") + 1);
|
||||||
|
printf("%s:%s\n", mkvarnam(d1), filt_phys(rest, ":"));
|
||||||
|
}' \
|
||||||
|
| awk -F: '$1 == "CPU_TIME" { print $2; }'
|
||||||
|
</action>
|
||||||
|
</metric>
|
||||||
|
<!-- SAP "CIM" -->
|
||||||
|
<metric type="uint32" context="vm">
|
||||||
|
<name>ResourceProcessorLimit</name>
|
||||||
|
<action>
|
||||||
|
virsh -r CONNECT dominfo NAME \
|
||||||
|
|awk -F ':' '
|
||||||
|
function mkvarnam(s) { # UPPER_CASE_UNDERSCORE
|
||||||
|
sub("(^[[:space:]]+|[[:space:]]+$)", "", s); # trim
|
||||||
|
gsub("[[:space:]]+", "_", s); s = toupper(s);
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
function filt_phys(s, sep, num, unit) { # 42.0 KM
|
||||||
|
sub("(^[[:space:]]+|[[:space:]]+$)", "", s); # trim
|
||||||
|
if ( s ~ /^[0-9]*\.?[0-9]+[[:space:]]*[[:alpha:]]+$/ )
|
||||||
|
{
|
||||||
|
num = s; unit = s;
|
||||||
|
sub("[[:space:]]*[[:alpha:]]+$", "", num);
|
||||||
|
sub("^[0-9]*[.]?[0-9]+[[:space:]]*", "", unit);
|
||||||
|
return num sep toupper(unit);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/:/ {
|
||||||
|
d1 = substr($0, 1, index($0, ":") - 1);
|
||||||
|
rest = substr($0, index($0, ":") + 1);
|
||||||
|
printf("%s:%s\n", mkvarnam(d1), filt_phys(rest, ":"));
|
||||||
|
}' \
|
||||||
|
| awk -F: '$1 == "CPU(S)" { print $2; }'
|
||||||
|
</action>
|
||||||
|
</metric>
|
||||||
|
<!-- SAP "CIM" -->
|
||||||
|
<metric type="uint64" context="vm">
|
||||||
|
<name>ResourceMemoryLimit</name>
|
||||||
|
<action>
|
||||||
|
virsh -r CONNECT dominfo NAME \
|
||||||
|
|awk -F ':' '
|
||||||
|
function mkvarnam(s) { # UPPER_CASE_UNDERSCORE
|
||||||
|
sub("(^[[:space:]]+|[[:space:]]+$)", "", s); # trim
|
||||||
|
gsub("[[:space:]]+", "_", s); s = toupper(s);
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
function filt_phys(s, sep, num, unit) { # 42.0 KM
|
||||||
|
sub("(^[[:space:]]+|[[:space:]]+$)", "", s); # trim
|
||||||
|
if ( s ~ /^[0-9]*\.?[0-9]+[[:space:]]*[[:alpha:]]+$/ )
|
||||||
|
{
|
||||||
|
num = s; unit = s;
|
||||||
|
sub("[[:space:]]*[[:alpha:]]+$", "", num);
|
||||||
|
sub("^[0-9]*[.]?[0-9]+[[:space:]]*", "", unit);
|
||||||
|
return num sep toupper(unit);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/:/ {
|
||||||
|
d1 = substr($0, 1, index($0, ":") - 1);
|
||||||
|
rest = substr($0, index($0, ":") + 1);
|
||||||
|
printf("%s:%s\n", mkvarnam(d1), filt_phys(rest, ":"));
|
||||||
|
}' \
|
||||||
|
| awk -F: '$1 == "MAX_MEMORY" { print int($2/1024); }'
|
||||||
|
</action>
|
||||||
|
</metric>
|
||||||
|
<!-- SAP "CIM" -->
|
||||||
|
<metric type="uint64" context="vm">
|
||||||
|
<name>PhysicalMemoryAllocatedToVirtualSystem</name>
|
||||||
|
<action>
|
||||||
|
virsh -r CONNECT dominfo NAME \
|
||||||
|
|awk -F ':' '
|
||||||
|
function mkvarnam(s) { # UPPER_CASE_UNDERSCORE
|
||||||
|
sub("(^[[:space:]]+|[[:space:]]+$)", "", s); # trim
|
||||||
|
gsub("[[:space:]]+", "_", s); s = toupper(s);
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
function filt_phys(s, sep, num, unit) { # 42.0 KM
|
||||||
|
sub("(^[[:space:]]+|[[:space:]]+$)", "", s); # trim
|
||||||
|
if ( s ~ /^[0-9]*\.?[0-9]+[[:space:]]*[[:alpha:]]+$/ )
|
||||||
|
{
|
||||||
|
num = s; unit = s;
|
||||||
|
sub("[[:space:]]*[[:alpha:]]+$", "", num);
|
||||||
|
sub("^[0-9]*[.]?[0-9]+[[:space:]]*", "", unit);
|
||||||
|
return num sep toupper(unit);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/:/ {
|
||||||
|
d1 = substr($0, 1, index($0, ":") - 1);
|
||||||
|
rest = substr($0, index($0, ":") + 1);
|
||||||
|
printf("%s:%s\n", mkvarnam(d1), filt_phys(rest, ":"));
|
||||||
|
}' \
|
||||||
|
| awk -F: '$1 == "USED_MEMORY" { print int($2/1024); }'
|
||||||
|
</action>
|
||||||
|
</metric>
|
||||||
|
</metrics>
|
||||||
|
</vhostmd>
|
||||||
|
<!--
|
||||||
|
vi:ts=2:sw=2:expandtab:ignorecase:nu:ruler
|
||||||
|
-->
|
||||||
|
<!-- EOF -->
|
@ -0,0 +1,332 @@
|
|||||||
|
%global have_xen 0
|
||||||
|
|
||||||
|
Summary: Virtualization host metrics daemon
|
||||||
|
Name: vhostmd
|
||||||
|
Version: 1.1
|
||||||
|
Release: 5%{?dist}
|
||||||
|
License: GPLv2+
|
||||||
|
|
||||||
|
URL: https://github.com/vhostmd/vhostmd
|
||||||
|
|
||||||
|
Source0: https://github.com/vhostmd/vhostmd/archive/v%{version}/%{name}-%{version}.tar.gz
|
||||||
|
Source1: vhostmd.conf
|
||||||
|
|
||||||
|
# Prevents updates from previous versions with the old config file
|
||||||
|
# from breaking (RHBZ#1782897).
|
||||||
|
# https://github.com/vhostmd/vhostmd/commit/83cc269f6892852be94467cea771b3ad1da8a369
|
||||||
|
Patch1: 0001-Relax-virtio-requirement-in-config-file.patch
|
||||||
|
|
||||||
|
BuildRequires: gcc
|
||||||
|
BuildRequires: chrpath
|
||||||
|
BuildRequires: perl-generators
|
||||||
|
BuildRequires: pkgconfig
|
||||||
|
BuildRequires: libxml2-devel
|
||||||
|
BuildRequires: libvirt-devel
|
||||||
|
BuildRequires: autoconf, automake, libtool
|
||||||
|
BuildRequires: git
|
||||||
|
%{?systemd_requires}
|
||||||
|
BuildRequires: systemd
|
||||||
|
|
||||||
|
%if %{have_xen}
|
||||||
|
BuildRequires: xen-devel
|
||||||
|
%endif
|
||||||
|
|
||||||
|
# This is hopefully temporary, but required to run vhostmd.xml as
|
||||||
|
# currently written. For more information see:
|
||||||
|
# https://bugzilla.redhat.com/show_bug.cgi?id=1897130
|
||||||
|
Requires: libvirt
|
||||||
|
|
||||||
|
|
||||||
|
%description
|
||||||
|
vhostmd provides a "metrics communication channel" between a host and
|
||||||
|
its hosted virtual machines, allowing limited introspection of host
|
||||||
|
resource usage from within virtual machines.
|
||||||
|
|
||||||
|
|
||||||
|
%package -n vm-dump-metrics
|
||||||
|
Summary: Virtualization host metrics dump
|
||||||
|
|
||||||
|
|
||||||
|
%description -n vm-dump-metrics
|
||||||
|
Executable to dump all available virtualization host metrics to stdout
|
||||||
|
or a file.
|
||||||
|
|
||||||
|
|
||||||
|
%package -n vm-dump-metrics-devel
|
||||||
|
Summary: Virtualization host metrics dump development
|
||||||
|
Requires: vm-dump-metrics = %{version}-%{release}
|
||||||
|
Requires: pkgconfig
|
||||||
|
|
||||||
|
|
||||||
|
%description -n vm-dump-metrics-devel
|
||||||
|
Header and libraries necessary for metrics gathering development
|
||||||
|
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%autosetup -S git
|
||||||
|
|
||||||
|
|
||||||
|
%build
|
||||||
|
autoreconf -i
|
||||||
|
%configure \
|
||||||
|
%if %{have_xen} == 0
|
||||||
|
--without-xenstore \
|
||||||
|
%endif
|
||||||
|
--with-init-script=systemd \
|
||||||
|
--enable-shared --disable-static
|
||||||
|
make %{_smp_mflags}
|
||||||
|
|
||||||
|
|
||||||
|
%install
|
||||||
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
|
||||||
|
make DESTDIR=$RPM_BUILD_ROOT install
|
||||||
|
|
||||||
|
rm $RPM_BUILD_ROOT%{_libdir}/libmetrics.la
|
||||||
|
|
||||||
|
chrpath --delete $RPM_BUILD_ROOT%{_sbindir}/vm-dump-metrics
|
||||||
|
|
||||||
|
# Remove docdir - we'll make a proper one ourselves.
|
||||||
|
rm -r $RPM_BUILD_ROOT%{_docdir}/vhostmd
|
||||||
|
|
||||||
|
# Remove metric.dtd from /etc.
|
||||||
|
rm $RPM_BUILD_ROOT%{_sysconfdir}/vhostmd/metric.dtd
|
||||||
|
|
||||||
|
# The default configuration file is great for Xen, not so great
|
||||||
|
# for anyone else. Replace it with one which is better for libvirt
|
||||||
|
# users.
|
||||||
|
rm $RPM_BUILD_ROOT%{_sysconfdir}/vhostmd/vhostmd.conf
|
||||||
|
cp %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/vhostmd/vhostmd.conf
|
||||||
|
|
||||||
|
%if 0%{?rhel}
|
||||||
|
# Remove Perl script (https://bugzilla.redhat.com/show_bug.cgi?id=749875)
|
||||||
|
rm $RPM_BUILD_ROOT%{_datadir}/vhostmd/scripts/pagerate.pl
|
||||||
|
%endif
|
||||||
|
|
||||||
|
|
||||||
|
%pre
|
||||||
|
# UID:GID 112:112 reserved, see RHBZ#534109.
|
||||||
|
getent group vhostmd >/dev/null || groupadd -g 112 -r vhostmd
|
||||||
|
getent passwd vhostmd >/dev/null || \
|
||||||
|
useradd -u 112 -r -g vhostmd -d %{_datadir}/vhostmd -s /sbin/nologin \
|
||||||
|
-c "Virtual Host Metrics Daemon" vhostmd
|
||||||
|
exit 0
|
||||||
|
|
||||||
|
|
||||||
|
%post
|
||||||
|
%systemd_post vhostmd.service
|
||||||
|
|
||||||
|
|
||||||
|
%preun
|
||||||
|
%systemd_preun vhostmd.service
|
||||||
|
|
||||||
|
|
||||||
|
%postun
|
||||||
|
%systemd_postun_with_restart vhostmd.service
|
||||||
|
|
||||||
|
|
||||||
|
%files
|
||||||
|
%doc AUTHORS ChangeLog COPYING README
|
||||||
|
%doc mdisk.xml metric.dtd vhostmd.dtd vhostmd.xml
|
||||||
|
|
||||||
|
%{_sbindir}/vhostmd
|
||||||
|
|
||||||
|
%dir %{_sysconfdir}/vhostmd
|
||||||
|
%config(noreplace) %{_sysconfdir}/vhostmd/vhostmd.conf
|
||||||
|
%config %{_sysconfdir}/vhostmd/vhostmd.dtd
|
||||||
|
|
||||||
|
%{_unitdir}/vhostmd.service
|
||||||
|
|
||||||
|
%dir %{_datadir}/vhostmd
|
||||||
|
%dir %{_datadir}/vhostmd/scripts
|
||||||
|
%if !0%{?rhel}
|
||||||
|
%{_datadir}/vhostmd/scripts/pagerate.pl
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%{_mandir}/man8/vhostmd.8.gz
|
||||||
|
|
||||||
|
|
||||||
|
%files -n vm-dump-metrics
|
||||||
|
%doc COPYING
|
||||||
|
%{_sbindir}/vm-dump-metrics
|
||||||
|
%{_libdir}/libmetrics.so.0
|
||||||
|
%{_libdir}/libmetrics.so.0.0.0
|
||||||
|
%{_mandir}/man1/vm-dump-metrics.1.gz
|
||||||
|
|
||||||
|
|
||||||
|
%files -n vm-dump-metrics-devel
|
||||||
|
%doc README
|
||||||
|
%{_libdir}/libmetrics.so
|
||||||
|
%dir %{_includedir}/vhostmd
|
||||||
|
%{_includedir}/vhostmd/libmetrics.h
|
||||||
|
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Tue Dec 01 2020 Richard W.M. Jones <rjones@redhat.com> - 1.1-5.el8
|
||||||
|
- Add Requires libvirt
|
||||||
|
resolves: rhbz#1897130
|
||||||
|
|
||||||
|
* Fri Jan 31 2020 Richard W.M. Jones <rjones@redhat.com> - 1.1-4.el8
|
||||||
|
- Prevent updates from previous versions from breaking
|
||||||
|
resolves: rhbz#1782897
|
||||||
|
|
||||||
|
* Mon Nov 25 2019 Richard W.M. Jones <rjones@redhat.com> - 1.1-3.el8
|
||||||
|
- Fix URL
|
||||||
|
resolves: rhbz#1775565
|
||||||
|
|
||||||
|
* Mon Nov 25 2019 Richard W.M. Jones <rjones@redhat.com> - 1.1-2.el8
|
||||||
|
- Fix vhostmd.conf
|
||||||
|
related: rhbz#1689213
|
||||||
|
|
||||||
|
* Thu Aug 29 2019 Richard W.M. Jones <rjones@redhat.com> - 1.1-1.el8.1
|
||||||
|
- Upstream version 1.1.
|
||||||
|
- Remove patches, since all included 1.1.
|
||||||
|
resolves: 1689213
|
||||||
|
|
||||||
|
* Thu Mar 21 2019 Richard W.M. Jones <rjones@redhat.com> - 0.5-19
|
||||||
|
- Add gating tests resolves: rhbz#1682784
|
||||||
|
|
||||||
|
* Tue Oct 16 2018 Richard W.M. Jones <rjones@redhat.com> - 0.5-19
|
||||||
|
- Include all upstream patches since 0.5.
|
||||||
|
- Enable systemd init scripts (RHBZ#1592400).
|
||||||
|
|
||||||
|
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.5-18
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
||||||
|
|
||||||
|
* Thu Jul 05 2018 Richard W.M. Jones <rjones@redhat.com> - 0.5-17
|
||||||
|
- Remove ldconfig
|
||||||
|
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/SU3LJVDZ7LUSJGZR5MS72BMRAFP3PQQL/
|
||||||
|
|
||||||
|
* Fri Feb 09 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.5-16
|
||||||
|
- Escape macros in %%changelog
|
||||||
|
|
||||||
|
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.5-15
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
|
||||||
|
|
||||||
|
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.5-14
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
|
||||||
|
|
||||||
|
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.5-13
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
|
||||||
|
|
||||||
|
* Fri Feb 05 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.5-12
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
|
||||||
|
|
||||||
|
* Tue Jan 26 2016 Richard Jones <rjones@redhat.com> - 0.5-11
|
||||||
|
- Remove useless defattr in files section.
|
||||||
|
|
||||||
|
* Fri Jun 19 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-10
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
|
||||||
|
|
||||||
|
* Mon Aug 18 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-9
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
|
||||||
|
|
||||||
|
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-8
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
|
||||||
|
|
||||||
|
* Sat Aug 03 2013 Petr Pisar <ppisar@redhat.com> - 0.5-7
|
||||||
|
- Perl 5.18 rebuild
|
||||||
|
|
||||||
|
* Mon Jul 29 2013 Richard W.M. Jones <rjones@redhat.com> - 0.5-6
|
||||||
|
- Completely disable Xen. APIs seem to have changed incompatibly.
|
||||||
|
- Add commits from upstream since 0.5.
|
||||||
|
- Remove pagerate.pl when building on RHEL.
|
||||||
|
- Modernize the spec file.
|
||||||
|
|
||||||
|
* Wed Jul 17 2013 Petr Pisar <ppisar@redhat.com> - 0.5-5
|
||||||
|
- Perl 5.18 rebuild
|
||||||
|
|
||||||
|
* Thu May 23 2013 Richard W.M. Jones <rjones@redhat.com> - 0.5-4
|
||||||
|
- Disable Xen support on RHEL >= 6 (RHBZ#927853).
|
||||||
|
|
||||||
|
* Fri Feb 15 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-3
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
|
||||||
|
|
||||||
|
* Sun Jul 22 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-2
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
|
||||||
|
|
||||||
|
* Mon Jan 16 2012 Richard W.M. Jones <rjones@redhat.com> - 0.5-1
|
||||||
|
- New upstream version 0.5.
|
||||||
|
- Remove -ldl patch which is now upstream.
|
||||||
|
|
||||||
|
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4-13
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
|
||||||
|
|
||||||
|
* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4-12
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
|
||||||
|
|
||||||
|
* Fri Jul 23 2010 Richard W.M. Jones <rjones@redhat.com> - 0.4-11
|
||||||
|
- /etc/sysconfig/vhostmd: Default to KVM.
|
||||||
|
|
||||||
|
* Tue Jul 13 2010 Richard W.M. Jones <rjones@redhat.com> - 0.4-10
|
||||||
|
- Patch Makefile.in directly so we don't need to run autotools.
|
||||||
|
|
||||||
|
* Tue Jul 6 2010 Richard W.M. Jones <rjones@redhat.com> - 0.4-9
|
||||||
|
- Updated vhostmd.conf from Dr. Joachim Schneider at SAP.
|
||||||
|
- Run aclocal.
|
||||||
|
|
||||||
|
* Tue Apr 27 2010 Richard W.M. Jones <rjones@redhat.com> - 0.4-6
|
||||||
|
- Updated vhostmd.conf file which enables TotalCPUTime metric.
|
||||||
|
|
||||||
|
* Tue Feb 16 2010 Richard W.M. Jones <rjones@redhat.com> - 0.4-5
|
||||||
|
- Add a patch to link tests explicitly with -ldl (RHBZ#565096).
|
||||||
|
|
||||||
|
* Thu Dec 10 2009 Richard W.M. Jones <rjones@redhat.com> - 0.4-2
|
||||||
|
- Fix the PagedOutMemory and PagedInMemory stats to report MB instead
|
||||||
|
of pages (fixes supplied by Joachim Schneider).
|
||||||
|
|
||||||
|
* Wed Dec 9 2009 Richard W.M. Jones <rjones@redhat.com> - 0.4-1
|
||||||
|
- vhostmd didn't chdir ("/") when daemonizing. Fixed in this 0.4 release.
|
||||||
|
|
||||||
|
* Tue Nov 17 2009 Richard W.M. Jones <rjones@redhat.com> - 0.4-0.9.gite9db007b
|
||||||
|
- Add a timestamp to the metrics.
|
||||||
|
- Fix a typo in MemoryAllocatedToVirtualServers metric
|
||||||
|
(https://bugzilla.redhat.com/show_bug.cgi?id=532070#c7)
|
||||||
|
- %%{_sysconfdir}/sysconfig/vhostmd: Use libvirt default URI
|
||||||
|
(https://bugzilla.redhat.com/show_bug.cgi?id=537828)
|
||||||
|
- %%{_sysconfdir}/init.d/vhostmd: If using libvirt's default URI, then pass
|
||||||
|
the root URI to vhostmd (the default URI changes in some circumstances
|
||||||
|
when vhostmd switches to the non-root user).
|
||||||
|
|
||||||
|
* Wed Nov 11 2009 Richard W.M. Jones <rjones@redhat.com> - 0.4-0.8.gite9db007b
|
||||||
|
- Use fixed UID:GID 112:112 (RHBZ#534109).
|
||||||
|
|
||||||
|
* Tue Nov 10 2009 Richard W.M. Jones <rjones@redhat.com> - 0.4-0.7.gite9db007b
|
||||||
|
- vm-dump-metrics-devel package should require version and release of
|
||||||
|
base package.
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
- Add patch to fix --without-xenstore option.
|
||||||
|
- Use have_xen RPM macro.
|
||||||
|
|
||||||
|
* Mon Oct 12 2009 Richard W.M. Jones <rjones@redhat.com> - 0.3-3
|
||||||
|
- Remove metric.dtd file from /etc (fixes rpmlint warning), but
|
||||||
|
vhostmd.dtd has to remain because it is needed to validate the
|
||||||
|
XML configuration file.
|
||||||
|
- Remove ExclusiveArch, instead conditionally depend on xen-devel.
|
||||||
|
- Use a better, less noisy, more minimal configuration file which
|
||||||
|
doesn't depend on Xen.
|
||||||
|
|
||||||
|
* Thu Oct 8 2009 Richard W.M. Jones <rjones@redhat.com> - 0.3-1
|
||||||
|
- New upstream version 0.3.
|
||||||
|
|
||||||
|
* Fri Aug 14 2009 Richard W.M. Jones <rjones@redhat.com> - 0.2-1
|
||||||
|
- Initial packaging for Fedora, based on SuSE package.
|
Loading…
Reference in new issue