Adding gmond as a service in Cygwin

If for some reason you have Windows running as part of a cluster, like as a node in a Selenium Grid, it is nice to be able to monitor it. A frequently used monitoring suite for clusters is Ganglia. Ganglia, unfortunately, doesn’t have a native Windows binary. Thankfully, it can be compiled and installed in Cygwin. The instructions for doing so are included in the Ganglia tarball (in README.WIN). Instructions that aren’t included are how to run gmond as a Windows service.

After installing Ganglia, you can add gmond as a Windows service by doing the following:

  1. Ensure you have cygrunsrv installed
  2. Ensure you have properly configured gmond
    • by default the config file is at /etc/ganglia/gmond.conf – we’ll assume this
  3. Run:
    • cygrunsrv -I gmond --path /usr/sbin/gmond.exe -a "-f -c /etc/ganglia/gmond.conf"
    • cygrunsrv -S gmond

The service should now be listed in the services MMC, and will be running as the SYSTEM user. You can change this to another user if you wish.