Thursday, October 21, 2010

Installing Host sFlow on a Windows server


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

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

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

First go to the Host sFlow web site, http://host-sflow.sourceforge.net


Click on the DOWNLOAD NOW button.


If you are using a browser on the Windows server, you should automatically be offered the file hsflowd_windows_setup.msi, click on the Download Now! button to download this file.

Note: If the Windows install file isn't displayed, click on the View all files button and select the file from the list.


Click on the Run button to install the software on your current server. Otherwise, click Save to store the file and copy it to the target system.


Click on the Run button to confirm that you want to install the software.


Click the Next> button


Confirm the installation location and click the Next> button


Enter the IP address of your sFlow analyzer, in this case 10.0.0.50, then click the Next> button.


Click on the Next> button to confirm that you want to install the software.


The Host sFlow agent is now installed, click the Close button to finish.

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 data 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.

24 comments:

  1. Hello ,
    Is there any option updateing the collector from command line or script and not having the need to rerun the installation again ?

    ReplyDelete
  2. The collector is stored in the registry, so you should be able to change it using regedit, or through the command line:
    reg ADD HKLM\SYSTEM\CurrentControlSet\Services\hsflowd\Parameters /v collector /d ip.of.collector

    The hsflowd daemon needs to be restarted to pick up the new setting.

    ReplyDelete
    Replies
    1. Peter - is there a way to change the port number of the collector - we're using SolarWinds, and it's standard port is 2055 - I notice there is no registry entry for the port number - sure would help a lot! Thanks.

      Delete
    2. This comment has been removed by the author.

      Delete
    3. I would also like to know if it's possible to change the port used by Host sFlow from UDP Port 6343 to anything else?

      Delete
    4. Yes it is possible to change the sFlow port.
      If you are using the hsflowd-winxp--x86.msi, see http://sourceforge.net/p/host-sflow/code/413/tree/trunk/src/WindowsXP/hsflowd/hsflowd/INSTALL.WINDOWS
      3. [Optional] Configure the sFlow port: `reg ADD HKLM\SYSTEM\CurrentControlSet\Services\hsflowd\Parameters /v port /t REG_DWORD /d 6343

      If you are using hsflowd-win--x86.msi or hsflowd-win--x64.msi see
      http://sourceforge.net/p/host-sflow/code/413/tree/trunk/src/Windows/hsflowd/INSTALL.WINDOWS
      3. Required: configure the sFlow collector: `reg ADD HKLM\SYSTEM\CurrentControlSet\Services\hsflowd\Parameters\collector /v collector /d name.or.ip.of.collector
      If sFlow is to be sent to a non-standard UDP port, then append ":port" to the ip or hostname

      For this version you can also use DNS-SD to configure hsflowd.

      In both cases, restart the service for the change to take effect.

      Delete
  3. Thanks , That solve my problem !

    ReplyDelete
  4. I followed this guide and it worked great. I am using it to monitor server stats in ganglia but I was wondering if there was a way to expose other perfmon counters. The hosts I am monitoring run sql server and this provides a plethora of other counters I would like to track using sflow and ganglia.

    ReplyDelete
  5. There is currently an effort on sFlow.org to standardize database metrics. The goal is to define a core set of metrics that work for sql servers, mysql, etc. What are the metrics you find most useful?

    Once the standard metrics have been agreed, then hsflowd can be extended to export them for sql server.

    ReplyDelete
  6. Since you are using Ganglia as your collector, you could export the additional perfmon counters using gmetric. There is an implementation of gmetric for Python - it should be possible to query the perfmon counters using Python/PowerShell and export them in gmetric format.

    ReplyDelete
  7. I will look into gmetric, our primary ganglia gmond/gmetric server is linux so that shouldnt be too difficult. In terms of standard metrics for database servers.. that might be tough to expect for every database platform. Things that I like to watch are number of users connected, longest running transaction, number of transactions, stats on inserts/updates/deletes, reads from disk vs reads from memory, number of locks of different types, tracking each schema size, checkpoint frequency, number of idle sessions, number of waiting/blocked sessions, table scans vs index scans, custom query metrics for application specific info.. maybe others that are escaping me at the moment. SQL Server exposes many perfmon counters, it would be nice if I could edit a conf that allowed me to specify any perfmon counters that exist.

    ReplyDelete
  8. Hi,
    I installed hast sflow agent on a windows server, and installed ganglia on a ubuntu server.
    But ganglia only shows some basic information of this windows server, such aas os version, cpu number.
    It doesn't draw any graph of this windows server.(It draw the local ubuntu perfectly!)
    Does anybody meet the same problem?
    I need your help,thanks a lot!

    ReplyDelete
  9. There is a discussion on the host-sflow mailing list that may be relevant http://sourceforge.net/mailarchive/forum.php?thread_name=CA%2B3XN_KcpL7cXzLiNeGOYjbd6ZtsJ9tpbSSa4s6QsnRd7HEo8w%40mail.gmail.com&forum_name=host-sflow-discuss
    If your Windows server's hostname includes uppercase characters you have to configure Ganglia the case_sensitive_hostnames=false setting in conf_default.php for counters to be shown.

    ReplyDelete
    Replies
    1. Sonia,thank you very very very very much!!!
      It works perfectly now after I configured Ganglia the "case_sensitive_hostnames=false" .
      Hope more person who met the same problem can see this.

      Delete
    2. Yes! Thank you for this, fixed my world too

      Delete
    3. I got the same PR. THANK YOU VERY MUCH!
      My windows HOSTNAME is myname-PC!!!!

      Delete
  10. How can I force sFlow agent to send "custom host name" instead of host name from environment. I tried adding a REG_SZ registry entry "agentAddress" but it seems even after restart of the agent service it ignores that and send host name from host environment.

    ReplyDelete
  11. I assume that you are asking about the hostname exported in the host sFlow host_descr structure (see http://www.sflow.org/sflow_host.txt).
    The agentAddress setting controls the IP address that is used to uniquely identify the agent that is exporting the sFlow data, so this would not change the hostname exported in the host sFlow host_descr structure. Host sFlow for Windows uses the Microsoft function GetComputerNameEx (see http://msdn.microsoft.com/en-us/library/windows/desktop/ms724301(v=vs.85).aspx) to obtain the hostname of the system for which it is reporting data. So for the the Host sFlow agent to report a different hostname, then you must configure the system with a different hostname.

    ReplyDelete
  12. Hi,
    I've installed Host sFlow agents on two of my Windows servers. But those servers have several network interfaces each. And one IP address is shared between those servers. And now I have two identical sFlow agent IDs:

    "IPv4 agent xx.xx.xx.xx"

    So here is my question: How could I change Host sFlow agent IDs on my Windows servers manually?

    Thank you.

    ReplyDelete
  13. The host sFlow agent tries to select the most appropriate IP address associated with any of the adapters to use for the agent address. If this results in an undesirable address, then you can configure the agent address using the registry setting
    HKLM\SYSTEM\CurrentControlSet\Services\hsflowd\Parameters\agentAddress. After making changes to this registry setting you will need to restart the service. We have now documented this and other configuration parameters at http://host-sflow.sourceforge.net/host-sflow-win-config.php

    ReplyDelete
  14. Is there an option for a silent install so the host sFlow install can be automated?

    ReplyDelete
  15. Jon,

    You can install it silently using the following msi command:
    msiexec /q /i hsflowd-win-1.23.3-x64.msi
    (replacing the installer filename as appropriate).

    The /q option makes it silent.

    regards,
    Stuart

    ReplyDelete
  16. Is there a good guide with examples to adding new monitoring for sflow agent for windows? I find some architecture docs but very high level. I would like to add some custom top process monitoring but ideally modify some existing module which the agent can then run on a specified schedule. Any hint appreciated.

    ReplyDelete
    Replies
    1. The Host sFlow agent exports standard records defined by sFlow.org. For scaleability, the specifications try to summarize metrics rather than enumerate all the disks, processes, etc. on the host. Records are exported for resources that can be grouped into meaningful administrative units (Docker containers, virtual machines, etc.)

      Delete