This patch configures collectd on the host and wui appliance so that it logs performance data via unicast to the wui appliance. The collectd server is specified via dns srv records the same as other services. Signed-off-by: Ian Main <imain at redhat.com> diff --git a/ovirt-host-creator/common-post.ks b/ovirt-host-creator/common-post.ks index ac3cca1..5ac50c6 100644 --- a/ovirt-host-creator/common-post.ks +++ b/ovirt-host-creator/common-post.ks @@ -156,6 +156,12 @@ start() { fi fi + find_srv collectd tcp + if [ -f /etc/collectd.conf.in ]; then + sed -e s/@COLLECTD_SERVER@/$SRV_HOST/ -e s/@COLLECTD_PORT@/$SRV_PORT/ /etc/collectd.conf.in > /etc/collectd.conf + service collectd restart + fi + success echo } @@ -231,9 +237,9 @@ EOF cp /etc/issue /etc/issue.net -echo "Setting up collectd" +echo "Setting up collectd configuration" # setup collectd configuration -cat > /etc/collectd.conf << \EOF +cat > /etc/collectd.conf.in << \EOF LoadPlugin logfile LoadPlugin network LoadPlugin libvirt @@ -247,7 +253,7 @@ LoadPlugin cpu </Plugin> <Plugin network> - Server "224.0.0.1" + Server "@COLLECTD_SERVER@" @COLLECTD_PORT@ </Plugin> EOF diff --git a/wui-appliance/common-install.ks b/wui-appliance/common-install.ks index 10cccd0..dfea0b2 100644 --- a/wui-appliance/common-install.ks +++ b/wui-appliance/common-install.ks @@ -5,7 +5,7 @@ rootpw --iscrypted Xa8QeYfWrtscM firewall --disabled authconfig --enableshadow --enablemd5 selinux --disabled -services --disabled=iptables,yum-updatesd,libvirtd,bluetooth,cups,gpm,pcscd,NetworkManager,NetworkManagerDispatcher --enabled=ntpd,httpd,postgresql,ovirt-wui,tgtd,nfs +services --disabled=iptables,yum-updatesd,libvirtd,bluetooth,cups,gpm,pcscd,NetworkManager,NetworkManagerDispatcher --enabled=ntpd,httpd,postgresql,ovirt-wui,tgtd,nfs,collectd timezone --utc America/New_York text diff --git a/wui-appliance/wui-devel-x86_64.ks b/wui-appliance/wui-devel-x86_64.ks index 52e05c3..c7ccdd7 100644 --- a/wui-appliance/wui-devel-x86_64.ks +++ b/wui-appliance/wui-devel-x86_64.ks @@ -81,6 +81,30 @@ chmod +x /etc/dhclient-exit-hooks # make sure that we get a kerberos principal on every boot echo "/etc/cron.hourly/ovirtadmin.cron" >> /etc/rc.d/rc.local +# make collectd.conf. +cat > /etc/collectd.conf << \EOF +LoadPlugin network +LoadPlugin logfile +LoadPlugin rrdtool + +<Plugin logfile> + LogLevel info + File STDOUT +</Plugin> + +<Plugin network> + Listen "0.0.0.0" +</Plugin> + +<Plugin rrdtool> + DataDir "/var/lib/collectd/rrd" + CacheTimeout 120 + CacheFlush 900 +</Plugin> + +EOF + + cat > /etc/init.d/ovirt-wui-dev-first-run << \EOF #!/bin/bash # @@ -151,6 +175,7 @@ start() { -W _ovirt._tcp,management.priv.ovirt.org,80 \ -W _ipa._tcp,management.priv.ovirt.org,8089 \ -W _ldap._tcp,managment.priv.ovirt.org,389 \ + -W _collectd._tcp,management.priv.ovirt.org,25826 \ --enable-tftp --tftp-root=/tftpboot -M pxelinux.0 \ -O option:router,192.168.50.1 -O option:ntp-server,192.168.50.2 \ -R -S 192.168.122.1
Alan Pevec
2008-Apr-24 20:51 UTC
[Ovirt-devel] [PATCH] Setup collectd for performance stats
Ian Main wrote:> This patch configures collectd on the host and wui appliance so that it logs performance data via unicast to the wui appliance. The collectd server is specified via dns srv records the same as other services. > > Signed-off-by: Ian Main <imain at redhat.com>ACK just few questions in-line> diff --git a/ovirt-host-creator/common-post.ks b/ovirt-host-creator/common-post.ks > index ac3cca1..5ac50c6 100644 > --- a/ovirt-host-creator/common-post.ks > +++ b/ovirt-host-creator/common-post.ks > @@ -156,6 +156,12 @@ start() { > fi > fi > > + find_srv collectd tcp > + if [ -f /etc/collectd.conf.in ]; thenNot sure how could we recover in case SRV lookup fails, but just in case: + if [ -f /etc/collectd.conf.in -a $SRV_HOST -a $SRV_PORT ]; then> +<Plugin network> > + Listen "0.0.0.0" > +</Plugin>Is there any security on collectd's listening port or anyone can connect? Not critical if we require separate management network