{"id":11150,"date":"2019-03-09T22:33:01","date_gmt":"2019-03-09T22:33:01","guid":{"rendered":"http:\/\/www.appservgrid.com\/paw92\/?p=11150"},"modified":"2019-03-09T22:33:01","modified_gmt":"2019-03-09T22:33:01","slug":"setting-up-real-time-monitoring-with-ganglia-for-grids-and-clusters-of-linux-servers","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/09\/setting-up-real-time-monitoring-with-ganglia-for-grids-and-clusters-of-linux-servers\/","title":{"rendered":"Setting Up Real-Time Monitoring with \u2018Ganglia\u2019 for Grids and Clusters of Linux Servers"},"content":{"rendered":"<p>Ever since system administrators have been in charge of managing servers and groups of machines, tools like monitoring applications have been their best friends. You will probably be familiar with tools like\u00a0<a href=\"https:\/\/www.tecmint.com\/install-nagios-in-linux\/\" target=\"_blank\" rel=\"noopener\">Nagios<\/a>,\u00a0<a href=\"https:\/\/www.tecmint.com\/install-and-configure-zabbix-monitoring-on-debian-centos-rhel\/\" target=\"_blank\" rel=\"noopener\">Zabbix<\/a>,\u00a0<a href=\"https:\/\/www.tecmint.com\/install-icinga-in-centos-7\/\" target=\"_blank\" rel=\"noopener\">Icinga<\/a>, and\u00a0<strong>Centreon<\/strong>. While those are the heavyweights of monitoring, setting them up and fully taking advantage of their features may be somewhat difficult for new users.<\/p>\n<p>In this article we will introduce you to\u00a0<strong>Ganglia<\/strong>, a monitoring system that is easily scalable and allows to view a wide variety of system metrics of Linux servers and clusters (plus graphs) in real time.<\/p>\n<div id=\"attachment_21020\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/06\/Install-Gangila-Monitoring-in-Linux.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-21020\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/06\/Install-Gangila-Monitoring-in-Linux.png\" alt=\"Install Gangila Monitoring in Linux\" width=\"720\" height=\"345\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Install Gangila Monitoring in Linux<\/p>\n<\/div>\n<p><strong>Ganglia<\/strong>\u00a0lets you set up\u00a0<strong>grids<\/strong>\u00a0(locations) and\u00a0<strong>clusters<\/strong>\u00a0(groups of servers) for better organization.<\/p>\n<p>Thus, you can create a grid composed of all the machines in a remote environment, and then group those machines into smaller sets based on other criteria.<\/p>\n<p>In addition, Ganglia\u2019s web interface is optimized for mobile devices, and also allows you to export data en\u00a0<code>.csv<\/code>and\u00a0<code>.json<\/code>\u00a0formats.<\/p>\n<p>Our test environment will consist of a central\u00a0<strong>CentOS 7<\/strong>\u00a0server (IP address\u00a0<strong>192.168.0.29<\/strong>) where we will install\u00a0<strong>Ganglia<\/strong>, and an\u00a0<strong>Ubuntu 14.04<\/strong>\u00a0machine (<strong>192.168.0.32<\/strong>), the box that we want to monitor through Ganglia\u2019s web interface.<\/p>\n<p>Throughout this guide we will refer to the\u00a0<strong>CentOS 7<\/strong>\u00a0system as the master node, and to the Ubuntu box as the monitored machine.<\/p>\n<h3>Installing and Configuring Ganglia<\/h3>\n<p>To install the monitoring utilities in the the\u00a0<strong>master node<\/strong>, follow these steps:<\/p>\n<p><strong>1.<\/strong>\u00a0Enable the\u00a0<a href=\"https:\/\/www.tecmint.com\/how-to-enable-epel-repository-for-rhel-centos-6-5\/\" target=\"_blank\" rel=\"noopener\">EPEL repository<\/a>\u00a0and then install Ganglia and related utilities from there:<\/p>\n<pre># yum update &amp;&amp; yum install epel-release\r\n# yum install ganglia rrdtool ganglia-gmetad ganglia-gmond ganglia-web \r\n<\/pre>\n<p>The packages installed in the step above along with ganglia, the application itself, perform the following functions:<\/p>\n<ol>\n<li><code>rrdtool<\/code>, the Round-Robin Database, is a tool that\u2019s used to store and display the variation of data over time using graphs.<\/li>\n<li><code>ganglia-gmetad<\/code>\u00a0is the daemon that collects monitoring data from the\u00a0<strong>hosts<\/strong>\u00a0that you want to monitor. In those hosts and in the\u00a0<strong>master node<\/strong>\u00a0it is also necessary to install\u00a0<strong>ganglia-gmond<\/strong>\u00a0(the monitoring daemon itself):<\/li>\n<li><code>ganglia-web<\/code>\u00a0provides the web frontend where we will view the historical graphs and data about the monitored systems.<\/li>\n<\/ol>\n<p><strong>2.<\/strong>\u00a0Set up authentication for the\u00a0<strong>Ganglia<\/strong>\u00a0web interface (<strong>\/usr\/share\/ganglia<\/strong>). We will use basic authentication as provided by\u00a0<strong>Apache<\/strong>.<\/p>\n<p>If you want to explore more advanced security mechanisms, refer to the\u00a0<a href=\"https:\/\/httpd.apache.org\/docs\/current\/howto\/auth.html\" target=\"_blank\" rel=\"noopener\">Authorization and Authentication<\/a>section of the Apache docs.<\/p>\n<p>To accomplish this goal, create a\u00a0<strong>username<\/strong>\u00a0and assign a password to access a resource protected by Apache. In this example, we will create a username called\u00a0<code>adminganglia<\/code>\u00a0and assign a password of our choosing, which will be stored in\u00a0<strong>\/etc\/httpd\/auth.basic<\/strong>\u00a0(feel free to choose another directory and \/ or file name \u2013 as long as Apache has read permissions on those resources, you will be fine):<\/p>\n<pre># htpasswd -c \/etc\/httpd\/auth.basic adminganglia\r\n<\/pre>\n<p>Enter the password for adminganglia twice before proceeding.<\/p>\n<p><strong>3.<\/strong>\u00a0Modify\u00a0<strong>\/etc\/httpd\/conf.d\/ganglia.conf<\/strong>\u00a0as follows:<\/p>\n<pre>Alias \/ganglia \/usr\/share\/ganglia\r\n&lt;Location \/ganglia&gt;\r\n    AuthType basic\r\n    AuthName \"Ganglia web UI\"\r\n    AuthBasicProvider file\r\n    AuthUserFile \"\/etc\/httpd\/auth.basic\"\r\n    Require user adminganglia\r\n&lt;\/Location&gt;\r\n<\/pre>\n<p><strong>4.<\/strong>\u00a0Edit\u00a0<strong>\/etc\/ganglia\/gmetad.conf<\/strong>:<\/p>\n<p>First, use the gridname directive followed by a descriptive name for the grid you\u2019re setting up:<\/p>\n<pre>gridname \"Home office\"\r\n<\/pre>\n<p>Then, use\u00a0<strong>data_source<\/strong>\u00a0followed by a descriptive name for the cluster (group of servers), a polling interval in seconds and the IP address of the master and monitored nodes:<\/p>\n<pre>data_source \"Labs\" 60 192.168.0.29:8649 # Master node\r\ndata_source \"Labs\" 60 192.168.0.32 # Monitored node\r\n<\/pre>\n<p><strong>5.<\/strong>\u00a0Edit\u00a0<strong>\/etc\/ganglia\/gmond.conf<\/strong>.<\/p>\n<p><strong>a)<\/strong>\u00a0Make sure the cluster block looks as follows:<\/p>\n<pre>cluster {\r\nname = \"Labs\" # The name in the data_source directive in gmetad.conf\r\nowner = \"unspecified\"\r\nlatlong = \"unspecified\"\r\nurl = \"unspecified\"\r\n}\r\n<\/pre>\n<p><strong>b)<\/strong>\u00a0In the\u00a0<strong>udp_send_chanel<\/strong>\u00a0block, comment out the\u00a0<strong>mcast_join<\/strong>\u00a0directive:<\/p>\n<pre>udp_send_channel   {\r\n  #mcast_join = 239.2.11.71\r\n  host = localhost\r\n  port = 8649\r\n  ttl = 1\r\n}\r\n<\/pre>\n<p><strong>c)<\/strong>\u00a0Finally, comment out the\u00a0<strong>mcast_join<\/strong>\u00a0and bind directives in the\u00a0<strong>udp_recv_channel<\/strong>\u00a0block:<\/p>\n<pre>udp_recv_channel {\r\n  #mcast_join = 239.2.11.71 ## comment out\r\n  port = 8649\r\n  #bind = 239.2.11.71 ## comment out\r\n}\r\n<\/pre>\n<p>Save the changes and exit.<\/p>\n<p><strong>6.<\/strong>\u00a0Open port\u00a0<strong>8649\/udp<\/strong>\u00a0and allow PHP scripts (run via Apache) to connect to the network using the necessary SELinux boolean:<\/p>\n<pre># firewall-cmd --add-port=8649\/udp\r\n# firewall-cmd --add-port=8649\/udp --permanent\r\n# setsebool -P httpd_can_network_connect 1\r\n<\/pre>\n<p><strong>7.<\/strong>\u00a0Restart Apache, gmetad, and gmond. Also, make sure they are enabled to start on boot:<\/p>\n<pre># systemctl restart httpd gmetad gmond\r\n# systemctl enable httpd gmetad httpd\r\n<\/pre>\n<p>At this point, you should be able to open the Ganglia web interface at\u00a0<code>http:\/\/192.168.0.29\/ganglia<\/code>\u00a0and login with the credentials from\u00a0<strong>#Step 2<\/strong>.<\/p>\n<div id=\"attachment_21013\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/06\/Gangila-Web-Interface.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-21013\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/06\/Gangila-Web-Interface.png\" alt=\"Gangila Web Interface\" width=\"702\" height=\"194\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Gangila Web Interface<\/p>\n<\/div>\n<p><strong>8.<\/strong>\u00a0In the\u00a0<strong>Ubuntu<\/strong>\u00a0host, we will only install\u00a0<strong>ganglia-monitor<\/strong>, the equivalent of\u00a0<strong>ganglia-gmond<\/strong>\u00a0in\u00a0<strong>CentOS<\/strong>:<\/p>\n<pre>$ sudo aptitude update &amp;&amp; aptitude install ganglia-monitor\r\n<\/pre>\n<p><strong>9.<\/strong>\u00a0Edit the\u00a0<strong>\/etc\/ganglia\/gmond.conf<\/strong>\u00a0file in the monitored box. This should be identical to the same file in the\u00a0<strong>master node<\/strong>\u00a0except that the commented out lines in the\u00a0<strong>cluster<\/strong>,\u00a0<strong>udp_send_channel<\/strong>, and\u00a0<strong>udp_recv_channel<\/strong>should be enabled:<\/p>\n<pre>cluster {\r\nname = \"Labs\" # The name in the data_source directive in gmetad.conf\r\nowner = \"unspecified\"\r\nlatlong = \"unspecified\"\r\nurl = \"unspecified\"\r\n}\r\n\r\nudp_send_channel   {\r\n  mcast_join = 239.2.11.71\r\n  host = localhost\r\n  port = 8649\r\n  ttl = 1\r\n}\r\n\r\nudp_recv_channel {\r\n  mcast_join = 239.2.11.71 ## comment out\r\n  port = 8649\r\n  bind = 239.2.11.71 ## comment out\r\n}\r\n<\/pre>\n<p>Then, restart the service:<\/p>\n<pre>$ sudo service ganglia-monitor restart\r\n<\/pre>\n<p><strong>10.<\/strong>\u00a0Refresh the web interface and you should be able to view the statistics and graphs for both hosts inside the\u00a0<strong>Home office grid<\/strong>\u00a0\/\u00a0<strong>Labs cluster<\/strong>\u00a0(use the dropdown menu next to to\u00a0<strong>Home office grid<\/strong>\u00a0to choose a cluster,\u00a0<strong>Labs<\/strong>in our case):<\/p>\n<div id=\"attachment_21014\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/06\/Ganglia-Home-Office-Grid-Report.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-21014\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/06\/Ganglia-Home-Office-Grid-Report.png\" alt=\"Ganglia Home Office Grid Report\" width=\"764\" height=\"479\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Ganglia Home Office Grid Report<\/p>\n<\/div>\n<p>Using the menu tabs (highlighted above) you can access lots of interesting information about each server individually and in groups. You can even compare the stats of all the servers in a cluster side by side using the Compare Hosts tab.<\/p>\n<p>Simply choose a group of servers using a regular expression and you will be able to see a quick comparison of how they are performing:<\/p>\n<div id=\"attachment_21015\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/06\/Ganglia-Server-Information.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-21015\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/06\/Ganglia-Server-Information.png\" sizes=\"auto, (max-width: 1026px) 100vw, 1026px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/06\/Ganglia-Server-Information.png 1026w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/06\/Ganglia-Server-Information-768x327.png 768w\" alt=\"Ganglia Host Server Information\" width=\"1026\" height=\"437\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Ganglia Host Server Information<\/p>\n<\/div>\n<p>One of the features I personally find most appealing is the mobile-friendly summary, which you can access using the\u00a0<strong>Mobile<\/strong>\u00a0tab. Choose the cluster you\u2019re interested in and then the individual host:<\/p>\n<div id=\"attachment_21016\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/06\/Ganglia-Mobile-View.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-21016\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/06\/Ganglia-Mobile-View.png\" sizes=\"auto, (max-width: 784px) 100vw, 784px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/06\/Ganglia-Mobile-View.png 784w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/06\/Ganglia-Mobile-View-768x237.png 768w\" alt=\"Ganglia Mobile Friendly Summary View\" width=\"784\" height=\"242\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Ganglia Mobile Friendly Summary View<\/p>\n<\/div>\n<h3>Summary<\/h3>\n<p>In this article we have introduced\u00a0<strong>Ganglia<\/strong>, a powerful and scalable monitoring solution for grids and clusters of servers. Feel free to install, explore, and play around with Ganglia as much as you like (by the way, you can even try out Ganglia in a demo provided in the project\u2019s\u00a0<a href=\"http:\/\/ganglia.info\/\" target=\"_blank\" rel=\"noopener\">official website<\/a>.<\/p>\n<p>While you\u2019re at it, you will also discover that several well-known companies both in the IT world or not use Ganglia. There are plenty of good reasons for that besides the ones we have shared in this article, with easiness of use and graphs along with stats (it\u2019s nice to put a face to the name, isn\u2019t it?) probably being at the top.<\/p>\n<p>&nbsp;<br \/>\n<a href=\"https:\/\/www.tecmint.com\/install-configure-ganglia-monitoring-centos-linux\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ever since system administrators have been in charge of managing servers and groups of machines, tools like monitoring applications have been their best friends. You will probably be familiar with tools like\u00a0Nagios,\u00a0Zabbix,\u00a0Icinga, and\u00a0Centreon. While those are the heavyweights of monitoring, setting them up and fully taking advantage of their features may be somewhat difficult for &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/09\/setting-up-real-time-monitoring-with-ganglia-for-grids-and-clusters-of-linux-servers\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Setting Up Real-Time Monitoring with \u2018Ganglia\u2019 for Grids and Clusters of Linux Servers&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-11150","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/11150","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=11150"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/11150\/revisions"}],"predecessor-version":[{"id":11153,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/11150\/revisions\/11153"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=11150"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=11150"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=11150"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}