Difference between revisions of "Ganglia"

From ArchWiki
Jump to: navigation, search
(Mentioning the new ganglia-minimal package)
(2 intermediate revisions by 2 users not shown)
Line 2: Line 2:
 
Ganglia is a scalable distributed system monitor tool for high-performance computing systems such as clusters and grids. It allows the user to remotely view live or historical statistics (such as CPU load averages or network utilization) for all machines that are being monitored.
 
Ganglia is a scalable distributed system monitor tool for high-performance computing systems such as clusters and grids. It allows the user to remotely view live or historical statistics (such as CPU load averages or network utilization) for all machines that are being monitored.
  
Ganglia is available as the [https://aur.archlinux.org/packages/ganglia/ ganglia] package on the [[Arch User Repository|AUR]], along with the web frontend [https://aur.archlinux.org/packages/ganglia-web ganglia-web].
+
Ganglia is available as the {{AUR|ganglia}} package on the [[Arch User Repository|AUR]], along with the web frontend [https://aur.archlinux.org/packages/ganglia-web ganglia-web].  There is also a reduced-dependency version named {{AUR|ganglia-minimal}}, which would be appropriate on boxes where you don't require {{ic|gmetad}} and want to avoid pulling in {{ic|rrdtool}} as a dependency, which would in turn pull in Cairo and Mesa.
  
 
The [http://sourceforge.net/apps/trac/ganglia Ganglia Wiki] contains all the information you need to get started with Ganglia.
 
The [http://sourceforge.net/apps/trac/ganglia Ganglia Wiki] contains all the information you need to get started with Ganglia.
  
== Ganglia Web ==
+
== Ganglia Web Interface ==
  
First you need [https://aur.archlinux.org/packages/ganglia-web ganglia-web] from AUR:
+
The ganglia web frontend is available as the [https://aur.archlinux.org/packages/ganglia-web ganglia-web] package on the AUR.
  
yaourt -S ganglia-web
+
You will also need a [[:Category:Web_Server|web server]] with a working [[PHP]] setup. The following sections include some example setups.
  
Then you need a [[:Category:Web_Server|web server]] with a working [[PHP]] setup, the following sections include some example setups.
+
Make sure that the {{ic|open_basedir}} setting in your {{ic|/etc/php/php.ini}} includes {{ic|/usr/share/webapps}} and {{ic|/var/lib/ganglia}}.
As the [https://aur.archlinux.org/packages/ganglia-web ganglia-web] install script tells you, make sure that your <code>/etc/php/php.ini</code> <code>open_basedir</code> setting includes <code>/usr/share/webapps</code> and <code>/var/lib/ganglia</code>.
+
  
 +
=== [[Nginx]] with php-fpm ===
  
=== [[nginx]] with php-fpm ===
+
Firstly, install the required packages:
 
+
Installation of required packages:
+
  
 
  pacman -S nginx php-fpm
 
  pacman -S nginx php-fpm
  
This is a minimal configuration <code>/etc/nginx/nginx.conf</code>:
+
This is a minimal configuration for nginx:
  
events {
+
{{hc|/etc/nginx/nginx.conf|
  worker_connections  1024;
+
events {
}
+
  worker_connections 1024;
+
}
http {
+
  include mime.types;
+
  default_type application/octet-stream;
+
+
  upstream php {
+
    server unix:/run/php-fpm/php-fpm.sock;
+
  }
+
+
  server {
+
    listen 80 default_server;
+
   
+
    root /usr/share/webapps;
+
    index index.php;
+
+
    location ~ \.php$ {
+
      fastcgi_pass php;
+
      include fastcgi.conf;
+
    }
+
  }
+
}
+
  
Then start all required services:
+
http {
 +
  include mime.types;
 +
  default_type application/octet-stream;
  
systemctl start gmetad.service
+
  upstream php {
systemctl start gmond.service
+
    server unix:/run/php-fpm/php-fpm.sock;
systemctl start php-fpm.service
+
  }
systemctl start nginx.service
+
 
 +
  server {
 +
    listen 80 default_server;
 +
 
 +
    root /usr/share/webapps;
 +
    index index.php;
 +
 
 +
    location ~ \.php$ {
 +
      fastcgi_pass php;
 +
      include fastcgi.conf;
 +
    }
 +
  }
 +
}
 +
}}
 +
 
 +
Then start all required services:
  
Go to [http://localhost/ganglia/index.php your localhost ganglia page] and monitor the metrics.
+
systemctl start gmetad gmond php-fpm nginx
  
 +
Go to http://localhost/ganglia and check that your setup is working.
  
 
== Troubleshooting ==
 
== Troubleshooting ==

Revision as of 11:21, 31 December 2013

Ganglia is a scalable distributed system monitor tool for high-performance computing systems such as clusters and grids. It allows the user to remotely view live or historical statistics (such as CPU load averages or network utilization) for all machines that are being monitored.

Ganglia is available as the gangliaAUR package on the AUR, along with the web frontend ganglia-web. There is also a reduced-dependency version named ganglia-minimalAUR, which would be appropriate on boxes where you don't require gmetad and want to avoid pulling in rrdtool as a dependency, which would in turn pull in Cairo and Mesa.

The Ganglia Wiki contains all the information you need to get started with Ganglia.

Ganglia Web Interface

The ganglia web frontend is available as the ganglia-web package on the AUR.

You will also need a web server with a working PHP setup. The following sections include some example setups.

Make sure that the open_basedir setting in your /etc/php/php.ini includes /usr/share/webapps and /var/lib/ganglia.

Nginx with php-fpm

Firstly, install the required packages:

pacman -S nginx php-fpm

This is a minimal configuration for nginx:

/etc/nginx/nginx.conf
events {
  worker_connections  1024;
}

http {
  include mime.types;
  default_type application/octet-stream;

  upstream php {
    server unix:/run/php-fpm/php-fpm.sock;
  }

  server {
    listen 80 default_server;

    root /usr/share/webapps;
    index index.php;

    location ~ \.php$ {
      fastcgi_pass php;
      include fastcgi.conf;
    }
  }
}

Then start all required services:

systemctl start gmetad gmond php-fpm nginx

Go to http://localhost/ganglia and check that your setup is working.

Troubleshooting

Issues with IP-address binding or undesirable hostnames

If bind_hostname = yes in the udp_send_channel section of gmond.conf, the gmond daemon will determine which IP to bind to (and report in the XML data) by determining the IP address of the default hostname. You should be able to replicate this behaviour with one of these commands:

$ hostname -i
$ host $(hostname)

The hostname to report is determined by asking the system to look up a hostname for the chosen IP address, in order to ensure the hostname is that by which other machines on the network identify the monitored machine:

$ host <ip-address>

The hostname listed at the top of the list is the one that will be reported by gmond, and will appear in the web UI. You can influence the returned hostname by modifying your /etc/hosts or /etc/nsswitch.conf files. In particular, watch out for placing myhostname before dns on the hosts line in /etc/nsswitch.conf. This will cause gmond to attempt to bind to a UDP port on 127.0.0.1, and it will fail to load.

If you're not able to achieve the desired behaviour, the hostname can be overridden in the gmond.conf file by adding the following lines to the globals section:

globals {
  ...
  override_hostname = myhostname.mydomain
  override_ip = 127.0.0.2
}

References