<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://t2bwiki.iihe.ac.be/index.php?action=history&amp;feed=atom&amp;title=MonitoringvHostswithGanglia</id>
	<title>MonitoringvHostswithGanglia - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://t2bwiki.iihe.ac.be/index.php?action=history&amp;feed=atom&amp;title=MonitoringvHostswithGanglia"/>
	<link rel="alternate" type="text/html" href="https://t2bwiki.iihe.ac.be/index.php?title=MonitoringvHostswithGanglia&amp;action=history"/>
	<updated>2026-04-20T09:54:04Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://t2bwiki.iihe.ac.be/index.php?title=MonitoringvHostswithGanglia&amp;diff=180&amp;oldid=prev</id>
		<title>Maintenance script: Created page with &quot; == Goal == We would like to show the status of the so-called &quot;dom-machines&quot; (KVM vHosts) in Ganglia.  == Installation and configuration of gmond (SL6) == You first have t...&quot;</title>
		<link rel="alternate" type="text/html" href="https://t2bwiki.iihe.ac.be/index.php?title=MonitoringvHostswithGanglia&amp;diff=180&amp;oldid=prev"/>
		<updated>2015-08-26T12:28:48Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot; == Goal == We would like to show the status of the so-called &amp;quot;dom-machines&amp;quot; (KVM vHosts) in Ganglia.  == Installation and configuration of gmond (SL6) == You first have t...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
== Goal ==&lt;br /&gt;
We would like to show the status of the so-called &amp;quot;dom-machines&amp;quot; (KVM vHosts) in Ganglia.&lt;br /&gt;
&lt;br /&gt;
== Installation and configuration of gmond (SL6) ==&lt;br /&gt;
You first have to add the yum-repo sl6_addons. Put this content in the a file /etc/yup.repos.d/sl6_addons.repo :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[sl6_addons]&lt;br /&gt;
name=sl6_addons&lt;br /&gt;
baseurl=http://qrproxy.wn.iihe.ac.be:80/cb9/20140313/sl6_addons&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgcheck=0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
And then :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
yum install ganglia-gmond&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You must then adapt /etc/ganglia/gmond.conf so that it contains the following :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
cluster {&lt;br /&gt;
 name = &amp;quot;vHosts&amp;quot;&lt;br /&gt;
 owner = &amp;quot;unspecified&amp;quot;&lt;br /&gt;
 latlong = &amp;quot;unspecified&amp;quot;&lt;br /&gt;
 url = &amp;quot;unspecified&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
host {&lt;br /&gt;
 location = &amp;quot;unspecified&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
udp_send_channel {&lt;br /&gt;
 host = dom04.wn.iihe.ac.be&lt;br /&gt;
 port = 8649&lt;br /&gt;
 ttl = 1&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
udp_recv_channel {&lt;br /&gt;
 port = 8649&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
tcp_accept_channel {&lt;br /&gt;
 port = 8649&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check that this line is present in the /etc/ganglia/gmetad.conf on the Ganglia server (gangliat2b) :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data_source &amp;quot;vHosts&amp;quot; dom04.wn.iihe.ac.be:8649&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(From these configurations, you see that we use dom04 as a collector for the data coming from the vHosts.)&lt;br /&gt;
&lt;br /&gt;
Restart gmond :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
service gmond restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Gathering info about resources available/used by VMs ==&lt;br /&gt;
The idea is to use a Python module to collect the information on the vHosts. In details (we have done the following on dom10) :&lt;br /&gt;
#Install RPM gmond-gmond-python :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
yum install ganglia-gmond-modules-python&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
 2. We will use/adapt the xenstats files that are found [https://github.com/ganglia/gmond_python_modules/tree/master/xenstats here]. These codes/configurations need to be adapted because they were written for Xen, and we actually use KVM. For the sake of simplicity, you will find the adapted files in attachments to this page. Copy them to these path :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/etc/ganglia/conf.d/kvmstats.pyconf&lt;br /&gt;
/usr/lib64/ganglia/python_modules/kvmstats.py&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 3. Since the module python (kvmstats.py) is doing the equivalent of :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
virsh -c qemu+ssh://root@localhost/system list --all&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
it means you are using ssh, and so, you must add the public SSH key of the vHost into its own .ssh/authorized_keys :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat ~/.ssh/id_rsa.pub &amp;gt;&amp;gt; ~/.ssh/authorized_keys&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Once it is done, run the command &amp;quot;virsh -c ...&amp;quot; above at least one time, so that an entry is added in .ssh/known_hosts.&lt;br /&gt;
 4. Restart gmond :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
service gmond restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{TracNotice|{{PAGENAME}}}}&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>