Friday, March 4, 2011

Installing Host sFlow on a FreeBSD server


The Host sFlow agent supports FreeBSD performance monitoring, providing a lightweight, scalable solution for monitoring large numbers of FreeBSD servers.

The following steps demonstrate how to install and configure the Host sFlow agent on a FreeBSD server, sending sFlow to an analyzer with IP address 10.0.0.50.

Note: If there are any firewalls between the FreeBSD servers and the sFlow analyzer, you need to ensure that packets to the sFlow analyzer (UDP port 6343) are permitted.

First go to the Host sFlow web site and download the sources, hsflowd-X.XX.tar.gz.

The following commands build and install the host sFlow agent:

tar -xzf hsflowd-X.XX.tar.gz
cd hsflowd-X.XX
make
make install
make schedule
/etc/rc.d/hsflowd start

The default configuration method for sFlow is DNS-SD; enter the following DNS settings in the site DNS server:

analyzer A 10.0.0.50

_sflow._udp SRV 0 0 6343 analyzer
_sflow._udp TXT (
"txtvers=1"
"polling=20"
"sampling=512"
)

Note: These changes must be made to the DNS zone file corresponding to the search domain in the FreeBSD server's /etc/resolv.conf file.

Once the sFlow settings are added to the DNS server, they will be automatically picked up by the Host sFlow agents. If you need to change sFlow settings, simply change them on the DNS server and the change will automatically be applied to all the FreeBSD systems in the data center.

Manual configuration is an option if you do not want to use DNS-SD. Edit the Host sFlow agent configuration file, /etc/hsflowd.conf, on each FreeBSD server:

sflow{
  DNSSD = off
  polling = 20
  sampling = 512
  collector{
   ip = 10.0.0.50
   udpport = 6343
  }
}

After editing the configuration file you will need to restart the Host sFlow agent:

/etc/rc.d/hsflowd restart

For a complete sFlow monitoring solution you should also collect sFlow from the switches connecting the servers to the network (see Hybrid server monitoring). The sFlow standard is designed to seamlessly integrate monitoring of networks and servers (see sFlow Host Structures).

An sFlow analyzer is needed to receive the sFlow and report on performance (see Choosing an sFlow analyzer). The free sFlowTrend analyzer is a great way to get started, see sFlowTrend adds server performance monitoring to see examples.

3 comments:

  1. I'll try your recommendations. Do I still need to download a Sflow analyzer?

    web hosting uk

    ReplyDelete
  2. You need an sFlow analyzer to convert the raw sFlow data into useful reports.

    ReplyDelete
  3. This comment has been removed by a blog administrator.

    ReplyDelete