{"id":11699,"date":"2019-03-15T22:38:54","date_gmt":"2019-03-15T22:38:54","guid":{"rendered":"http:\/\/www.appservgrid.com\/paw92\/?p=11699"},"modified":"2019-03-15T22:38:54","modified_gmt":"2019-03-15T22:38:54","slug":"how-to-install-and-configure-collectd-and-collectd-web-to-monitor-server-resources-in-linux","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/15\/how-to-install-and-configure-collectd-and-collectd-web-to-monitor-server-resources-in-linux\/","title":{"rendered":"How to Install and Configure \u2018Collectd\u2019 and \u2018Collectd-Web\u2019 to Monitor Server Resources in Linux"},"content":{"rendered":"<p><b>Collectd-web<\/b>\u00a0is a web front-end monitoring tool based on RRDtool (<b>R<\/b>ound-<b>R<\/b>obin\u00a0<b>D<\/b>atabase\u00a0<b>Tool)<\/b>, which interprets and graphical outputs the data collected by the\u00a0<strong>Collectd<\/strong>\u00a0service on Linux systems.<\/p>\n<p><strong>Collectd<\/strong>\u00a0service comes by default with a huge collection of available plug-ins into its default configuration file, some of them being, by default, already activated once you have installed the software package.<\/p>\n<p><strong>Collectd-web CGI<\/strong>\u00a0scripts which interprets and generates the graphical html page statistics can be simply executed by the\u00a0<strong>Apache CGI<\/strong>\u00a0gateway with minimal of configurations required on Apache web server side.<\/p>\n<p>However, the graphical web interface with the generated statistics can, also, be executed by the standalone web server offered by\u00a0<strong>Python CGIHTTPServer<\/strong>\u00a0script that comes pre-installed with the main\u00a0<strong>Git<\/strong>\u00a0repository.<\/p>\n<p>This tutorial will cover the installation process of\u00a0<strong>Collectd<\/strong>\u00a0service and\u00a0<strong>Collectd-web<\/strong>\u00a0interface on\u00a0<strong>RHEL\/CentOS\/Fedora<\/strong>\u00a0and\u00a0<strong>Ubuntu\/Debian<\/strong>\u00a0based systems with the minimal configurations needed to be done in order to run the services and to enable a\u00a0<strong>Collectd<\/strong>\u00a0service plug-in.<\/p>\n<p>Please go through the following articles of\u00a0<strong>collectd<\/strong>\u00a0series.<\/p>\n<div id=\"exam_announcement\"><b>Part 1<\/b>:\u00a0<b>Install and Configure \u2018Collectd\u2019 and \u2018Collectd-Web\u2019 to Monitor Linux Resources<\/b><\/div>\n<div id=\"exam_announcement\"><b>Part 2<\/b>:\u00a0<a href=\"https:\/\/www.tecmint.com\/monitor-linux-server-resources-with-collectd-web-and-apache-cgi\/\" target=\"_blank\" rel=\"noopener\">Monitor Linux Resources with Collectd-web and Apache CGI<\/a><\/div>\n<div id=\"exam_announcement\"><b>Part 3<\/b>:\u00a0<a href=\"https:\/\/www.tecmint.com\/configure-collectd-as-central-monitoring-server-for-clients\/\" target=\"_blank\" rel=\"noopener\">Configure Collectd as a Central Monitoring Server for Clients<\/a><\/div>\n<h3>Step 1: \u2013 Install Collectd Service<\/h3>\n<p><strong>1.<\/strong>\u00a0Basically, the\u00a0<strong>Collectd<\/strong>\u00a0daemon task is to gather and store data statistics on the system that it runs on. The\u00a0<strong>Collectd<\/strong>\u00a0package can be downloaded and installed from the default Debian based distribution repositories by issuing the following command:<\/p>\n<h5>On Ubuntu\/Debian<\/h5>\n<pre># apt-get install collectd\t\t\t[On <strong>Debian<\/strong> based Systems]\r\n<\/pre>\n<div id=\"attachment_12690\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Install-Collectd-on-Ubuntu.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-12690\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Install-Collectd-on-Ubuntu-568x450.png\" sizes=\"auto, (max-width: 568px) 100vw, 568px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Install-Collectd-on-Ubuntu-568x450.png 568w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Install-Collectd-on-Ubuntu.png 630w\" alt=\"Install Collectd on Ubuntu\" width=\"568\" height=\"450\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Install Collectd on Debian\/Ubuntu<\/p>\n<\/div>\n<h5>On RHEL\/CentOS 6.x\/5.x<\/h5>\n<p>On older\u00a0<strong>RedHat<\/strong>\u00a0based systems like\u00a0<strong>CentOS\/Fedora<\/strong>, you first need to\u00a0<a title=\"Enable EPEL Repository \" href=\"https:\/\/www.tecmint.com\/how-to-enable-epel-repository-for-rhel-centos-6-5\/\" target=\"_blank\" rel=\"noopener\">enable epel repository<\/a>\u00a0under your system, then you can able to install\u00a0<strong>collectd<\/strong>\u00a0package from the epel repository.<\/p>\n<pre># yum install collectd\r\n<\/pre>\n<h5>On RHEL\/CentOS 7.x<\/h5>\n<p>On latest version of RHEL\/CentOS 7.x, you can install and enable epel repository from default yum repos as shown below.<\/p>\n<pre># yum install epel-release\r\n# yum install collectd\r\n<\/pre>\n<div id=\"attachment_12691\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Install-Collectd-on-CentOS.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-12691\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Install-Collectd-on-CentOS-620x344.png\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Install-Collectd-on-CentOS-620x344.png 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Install-Collectd-on-CentOS.png 720w\" alt=\"Install Collectd on CentOS\" width=\"620\" height=\"344\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Install Collectd on CentOS\/RHEL\/Fedora<\/p>\n<\/div>\n<p><strong>Note:<\/strong>\u00a0For Fedora users, no need to enable any third party repositories, simple yum to get the collectd package from default yum repositories.<\/p>\n<p><strong>2.<\/strong>\u00a0Once the package is installed on your system, run the below command in order to start the service.<\/p>\n<pre># service collectd start\t\t\t[On <strong>Debian<\/strong> based Systems]\r\n# service collectd start                        [On <strong>RHEL\/CentOS 6.x\/5.x<\/strong> Systems]\r\n# systemctl start collectd.service              [On <strong>RHEL\/CentOS 7.x<\/strong> Systems]\r\n<\/pre>\n<h3>Step 2: Install Collectd-Web and Dependencies<\/h3>\n<p><strong>3.<\/strong>\u00a0Before starting to import the\u00a0<strong>Collectd-web<\/strong>\u00a0Git repository, first you need to assure that\u00a0<strong>Git<\/strong>\u00a0software package and the following required dependencies are installed on your machine:<\/p>\n<pre>----------------- On <strong>Debian \/ Ubuntu<\/strong> systems -----------------\r\n# apt-get install git\r\n# apt-get install librrds-perl libjson-perl libhtml-parser-perl\r\n<\/pre>\n<div id=\"attachment_12692\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Install-Git-on-Ubuntu.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-12692\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Install-Git-on-Ubuntu-620x242.png\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Install-Git-on-Ubuntu-620x242.png 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Install-Git-on-Ubuntu.png 694w\" alt=\"Install Git on Ubuntu\" width=\"620\" height=\"242\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Install Git on Debian\/Ubuntu<\/p>\n<\/div>\n<pre>----------------- On <strong>RedHat\/CentOS\/Fedora<\/strong> based systems -----------------\r\n# yum install git\r\n# yum install rrdtool rrdtool-devel rrdtool-perl perl-HTML-Parser perl-JSON\r\n<\/pre>\n<div id=\"attachment_12693\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Install-Git-on-CentOS.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-12693\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Install-Git-on-CentOS-620x344.png\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Install-Git-on-CentOS-620x344.png 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Install-Git-on-CentOS.png 720w\" alt=\"Install Git on CentOS\" width=\"620\" height=\"344\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Install Git and Dependencies<\/p>\n<\/div>\n<h3>Step 3: Import Collectd-Web Git Repository and Modify Standalone Python Server<\/h3>\n<p><strong>4.<\/strong>\u00a0On the next step choose and change the directory to a system path from the Linux tree hierarchy where you want to import the Git project (you can use\u00a0<code>\/usr\/local\/<\/code>\u00a0path), then run the following command to clone\u00a0<strong>Collectd-web<\/strong>\u00a0git repository:<\/p>\n<pre># cd \/usr\/local\/\r\n# git clone https:\/\/github.com\/httpdss\/collectd-web.git\r\n<\/pre>\n<div id=\"attachment_12694\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Clone-Collectd-Web.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-12694\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Clone-Collectd-Web-620x344.png\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Clone-Collectd-Web-620x344.png 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Clone-Collectd-Web.png 720w\" alt=\"Git Clone Collectd-Web\" width=\"620\" height=\"344\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Git Clone Collectd-Web<\/p>\n<\/div>\n<p><strong>5.<\/strong>\u00a0Once the Git repository is imported into your system, go ahead and enter the\u00a0<strong>collectd-web<\/strong>\u00a0directory and list its contents in order to identify the Python server script (<code>runserver.py<\/code>), which will be modified on the next step. Also, add execution permissions to the following CGI script:\u00a0<code>graphdefs.cgi<\/code>.<\/p>\n<pre># cd collectd-web\/\r\n# ls\r\n# chmod +x cgi-bin\/graphdefs.cgi\r\n<\/pre>\n<div id=\"attachment_12695\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Set-Execute-Permission.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-12695\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Set-Execute-Permission-620x344.png\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Set-Execute-Permission-620x344.png 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Set-Execute-Permission.png 720w\" alt=\"Set Execute Permission\" width=\"620\" height=\"344\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Set Execute Permission<\/p>\n<\/div>\n<p><strong>6.<\/strong>\u00a0<strong>Collectd-web<\/strong>\u00a0standalone Python server script is configured by default to run and bind only on\u00a0<strong>loopback address (127.0.0.1)<\/strong>.<\/p>\n<p>In order to access\u00a0<strong>Collectd-web<\/strong>\u00a0interface from a remote browser, you need to edit the\u00a0<code>runserver.py<\/code>\u00a0script and change the\u00a0<strong>127.0.1.1 IP<\/strong>\u00a0Address to\u00a0<strong>0.0.0.0<\/strong>, in order to bind on all network interfaces IP Addresses.<\/p>\n<p>If you want to bind only on a specific interface, then use that interface IP Address (not advised to use this option in case your network interface Address is dynamically allocated by a DHCP server). Use the below screenshot as an excerpt on how the final\u00a0<code>runserver.py<\/code>\u00a0script should look like:<\/p>\n<pre># nano runserver.py\r\n<\/pre>\n<div id=\"attachment_12696\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Configure-Collect-web.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-12696\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Configure-Collect-web-620x361.png\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Configure-Collect-web-620x361.png 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Configure-Collect-web.png 863w\" alt=\"Configure Collect-web\" width=\"620\" height=\"361\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Configure Collect-web<\/p>\n<\/div>\n<p>If you want to use another network port than\u00a0<strong>8888<\/strong>, modify the PORT variable value.<\/p>\n<h3>Step 4: Run Python CGI Standalone Server and Browse Collectd-web Interface<\/h3>\n<p><strong>7.<\/strong>\u00a0After you have modified the standalone Python server script IP Address binding, go ahead and start the server in background by issuing the following command:<\/p>\n<pre># .\/runserver.py &amp;\r\n<\/pre>\n<p>Optional, as an alternate method you can call the Python interpreter to start the server:<\/p>\n<pre># python runserver.py &amp;\r\n<\/pre>\n<div id=\"attachment_12697\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Start-Collect-Web.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-12697\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Start-Collect-Web-620x344.png\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Start-Collect-Web-620x344.png 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Start-Collect-Web.png 720w\" alt=\"Start Collect-Web Server\" width=\"620\" height=\"344\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Start Collect-Web Server<\/p>\n<p><strong>8.<\/strong>\u00a0To visit\u00a0<strong>Collectd-web<\/strong>\u00a0interface and display statistics about your host, open a browser and point the URL at your server IP Address and port\u00a0<strong>8888<\/strong>\u00a0using HTTP protocol.<\/p>\n<p>By default you will see a number of graphics about CPU, disk usage, network traffic, RAM, processes and other system resources by clicking on the hostname displayed on Hosts form.<\/p>\n<pre>http:\/\/192.168.1.211:8888\r\n<\/pre>\n<div id=\"attachment_12698\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Access-Collect-Web.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-12698\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Access-Collect-Web-620x385.png\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Access-Collect-Web-620x385.png 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Access-Collect-Web.png 1014w\" alt=\"Access Collect-Web Panel\" width=\"620\" height=\"385\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Access Collect-Web Panel<\/p>\n<\/div>\n<div id=\"attachment_12700\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Disk-Monitoring.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-12700\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Disk-Monitoring-620x407.png\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Disk-Monitoring-620x407.png 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Disk-Monitoring.png 959w\" alt=\"Linux Disk Monitoring\" width=\"620\" height=\"407\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Linux Disk Monitoring<\/p>\n<\/div>\n<p><strong>9.<\/strong>\u00a0To stop the standalone Python server issue the below command or you may cancel or stop the script by hitting\u00a0<strong>Ctrl+c<\/strong>\u00a0key:<\/p>\n<pre># killall python\r\n<\/pre>\n<h3>Step 5: Create a Custom Bash Script to Manage the Standalone Python Server<\/h3>\n<p><strong>10.<\/strong>\u00a0To manage the standalone\u00a0<strong>PyhtonCGIServer<\/strong>\u00a0script more easily (<strong>start<\/strong>,\u00a0<strong>stop<\/strong>\u00a0and view\u00a0<strong>status<\/strong>), create the following\u00a0<code>collectd-server<\/code>\u00a0Bash script at a system executable path with the following configurations:<\/p>\n<pre># nano \/usr\/local\/bin\/collectd-server\r\n<\/pre>\n<p><center><ins class=\"adsbygoogle\" data-ad-client=\"ca-pub-2601749019656699\" data-ad-slot=\"5590002574\" data-ad-format=\"auto\" data-adsbygoogle-status=\"done\"><ins id=\"aswift_4_expand\"><ins id=\"aswift_4_anchor\"><iframe id=\"aswift_4\" name=\"aswift_4\" width=\"780\" height=\"90\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" allowfullscreen=\"allowfullscreen\" data-mce-fragment=\"1\"><\/iframe><\/ins><\/ins><\/ins><\/center>Add the following excerpt to\u00a0<code>collectd-server<\/code>\u00a0file.<\/p>\n<pre>#!\/bin\/bash\r\n\r\nPORT=\"8888\"\r\n  case $1 in\r\n            start)\r\n\tcd \/usr\/local\/collectd-web\/\r\n\tpython runserver.py 2&gt; \/tmp\/collectd.log &amp;\r\n    sleep 1\r\n    stat=`netstat -tlpn 2&gt;\/dev\/null | grep $PORT | grep \"python\"| cut -d\":\" -f2 | cut -d\" \" -f1`\r\n            if [[ $PORT -eq $stat ]]; then\r\n    sock=`netstat -tlpn 2&gt;\/dev\/null | grep $PORT | grep \"python\"`\r\n    echo -e \"Server is  still running:\\n$sock\"\r\n            else\r\n    echo -e \"Server has stopped\"\r\n            fi\r\n                    ;;\r\n            stop)\r\n    pid=`ps -x | grep \"python runserver.py\" | grep -v \"color\"`\r\n            kill -9 $pid 2&gt;\/dev\/null\r\n    stat=`netstat -tlpn 2&gt;\/dev\/null | grep $PORT | grep \"python\"| cut -d\":\" -f2 | cut -d\" \" -f1`\r\n            if [[ $PORT -eq $stat ]]; then\r\n    sock=`netstat -tlpn 2&gt;\/dev\/null | grep $PORT | grep \"python\"`\r\n    echo -e \"Server is  still running:\\n$sock\"\r\n            else\r\n    echo -e \"Server has stopped\"\r\n            fi\r\n                    ;;\r\n            status)\r\n    stat=`netstat -tlpn 2&gt;\/dev\/null |grep $PORT| grep \"python\" | cut -d\":\" -f2 | cut -d\" \" -f1`\r\n            if [[ $PORT -eq $stat ]]; then\r\n    sock=`netstat -tlpn 2&gt;\/dev\/null | grep $PORT | grep \"python\"`\r\n    echo -e \"Server is running:\\n$sock\"\r\n            else\r\n    echo -e \"Server is stopped\"\r\n            fi\r\n                    ;;\r\n            *)\r\n    echo \"Use $0 start|stop|status\"\r\n                    ;;\r\n    esac\r\n<\/pre>\n<p>In case you have changed\u00a0<strong>PORT<\/strong>\u00a0variable number from\u00a0<strong>runserver.py<\/strong>\u00a0script, make sure you make the port variable changes on this bash file accordingly.<\/p>\n<p><strong>11.<\/strong>\u00a0Once you have created the\u00a0<strong>collectd-server<\/strong>\u00a0script, add executing permissions in order to be able to run it. The only thing remaining now is to manage the Collectd-web server in a similar way as you do with a system service by issuing the following commands.<\/p>\n<pre># chmod +x \/usr\/local\/bin\/collectd-server\r\n# collectd-server start \r\n# collectd-server status\r\n# collectd-server stop\r\n<\/pre>\n<div id=\"attachment_12703\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Collectd-Server-Script.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-12703\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Collectd-Server-Script-620x344.png\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Collectd-Server-Script-620x344.png 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Collectd-Server-Script.png 720w\" alt=\"Collectd Server Script\" width=\"620\" height=\"344\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Collectd Server Script<\/p>\n<\/div>\n<h3>Step 6: Enable a Collectd Daemon Plug-in<\/h3>\n<p><strong>12.<\/strong>\u00a0In order to activate a plug-in on\u00a0<strong>Collectd<\/strong>\u00a0service, you must go to its main configuration file, which is located at\u00a0<code>\/etc\/collectd\/collectd.conf<\/code>\u00a0file, open this file for editing and uncomment, the first time (remove the\u00a0<code>#<\/code>\u00a0sign in front) the plug-in name you want to activate.<\/p>\n<p>Once the\u00a0<strong>LoadPlugin<\/strong>\u00a0statement with the name of the plug-in has been uncommented you must deeply search through the file and locate the same plugin name which holds the configurations required to run.<\/p>\n<p>As an example, here\u2019s how you active Collectd\u00a0<strong>Apache<\/strong>\u00a0plugin. First open Collectd main configuration file for editing:<\/p>\n<pre># nano \/etc\/collectd\/collectd.conf\r\n<\/pre>\n<p><strong>A.<\/strong>\u00a0Use\u00a0<strong>Ctrl+w<\/strong>\u00a0to enable\u00a0<strong>nano editor<\/strong>\u00a0search and type\u00a0<strong>apache<\/strong>\u00a0on below terminal the search filed. Once\u00a0<strong>LoadPlugin<\/strong>\u00a0apache statement has been found, remove the comment special sign\u00a0<code>#<\/code>\u00a0to uncomment it, as illustrated in the below screenshot.<\/p>\n<div id=\"attachment_12704\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Enable-Apache-Plugin.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-12704\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Enable-Apache-Plugin-495x450.png\" sizes=\"auto, (max-width: 495px) 100vw, 495px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Enable-Apache-Plugin-495x450.png 495w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Enable-Apache-Plugin.png 744w\" alt=\"Enable Collectd Apache Plugin\" width=\"495\" height=\"450\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Enable Collectd Apache Plugin<\/p>\n<\/div>\n<p><strong>B.<\/strong>\u00a0Next, type\u00a0<strong>Ctrl+w<\/strong>\u00a0to search again,\u00a0<strong>apache<\/strong>\u00a0should already appear on search filed and press\u00a0<strong>Enter<\/strong>\u00a0key to find the plug-in configurations.<\/p>\n<p>Once apache plug-in configurations are located (they look similar to\u00a0<strong>Apache<\/strong>\u00a0web server statements) uncomment the following lines, so that the final configuration should resemble to this:<\/p>\n<pre>&lt;Plugin apache&gt;\r\n        &lt;Instance \"example.lan\"&gt;\r\n                URL \"http:\/\/localhost\/server-status?auto\"\r\n#               User \"www-user\"\r\n#               Password \"secret\"\r\n#               VerifyPeer false\r\n#               VerifyHost false\r\n#               CACert \"\/etc\/ssl\/ca.crt\"\r\n#               Server \"apache\"\r\n        &lt;\/Instance&gt;\r\n#\r\n#       &lt;Instance \"bar\"&gt;\r\n#               URL \"http:\/\/some.domain.tld\/status?auto\"\r\n#               Host \"some.domain.tld\"\r\n#               Server \"lighttpd\"\r\n#       &lt;\/Instance&gt;\r\n&lt;\/Plugin&gt;\r\n<\/pre>\n<div id=\"attachment_12705\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Enable-Apache-Configuration.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-12705\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Enable-Apache-Configuration-620x297.png\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Enable-Apache-Configuration-620x297.png 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Enable-Apache-Configuration.png 784w\" alt=\"Enable Apache Configuration for Collectd\" width=\"620\" height=\"297\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Enable Apache Configuration for Collectd<\/p>\n<\/div>\n<p><strong>Note<\/strong>: Replace\u00a0<code>&lt;Instance \"example.lan\"&gt;<\/code>\u00a0statement string according to your server hostname.<br \/>\n<strong><br \/>\nC.<\/strong>\u00a0After you finish editing the file, save it (<strong>Ctrl+o<\/strong>) and close it (<strong>Ctrl+x<\/strong>), then restart\u00a0<strong>Collectd<\/strong>\u00a0daemon to apply changes. Clear your browser cache and reload the page to view the statistics collected by Collectd daemon so far for Apache Web Server.<\/p>\n<pre># \/usr\/local\/bin\/collectd-server start\r\n<\/pre>\n<div id=\"attachment_12706\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Apache-Monitoring.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-12706\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Apache-Monitoring-620x380.png\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Apache-Monitoring-620x380.png 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Apache-Monitoring-1024x627.png 1024w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Apache-Monitoring.png 1035w\" alt=\"Apache Monitoring\" width=\"620\" height=\"380\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Apache Monitoring<\/p>\n<\/div>\n<p>To enable other plug-ins please visit\u00a0<a title=\"Enable Collectd Plugins\" href=\"https:\/\/collectd.org\/wiki\/index.php\/Table_of_Plugins\" target=\"_blank\" rel=\"nofollow noopener\">Collectd Wiki<\/a>\u00a0page.<\/p>\n<h3>Step 7: Enable Collectd Daemon and Collectd-web Server System-Wide<\/h3>\n<p><strong>13.<\/strong>\u00a0In order to automatically start\u00a0<strong>Collectd-web<\/strong>\u00a0server from the Bash script at boot time, open\u00a0<code>\/etc\/rc.local<\/code>file for editing and add the following line before the exit\u00a0<strong>0<\/strong>\u00a0statement:<\/p>\n<pre>\/usr\/local\/bin\/collectd-server start\r\n<\/pre>\n<div id=\"attachment_12707\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Enable-Collectd-Systemwide.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-12707\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Enable-Collectd-Systemwide-620x326.png\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Enable-Collectd-Systemwide-620x326.png 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/04\/Enable-Collectd-Systemwide.png 687w\" alt=\"Enable Collectd Systemwide\" width=\"620\" height=\"326\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Enable Collectd Systemwide<\/p>\n<\/div>\n<p>If you\u2019re not using the\u00a0<strong>collectd-server<\/strong>\u00a0Bash script which manages the Python server script, replace the above line on\u00a0<strong>rc.conf<\/strong>\u00a0with the following line:<\/p>\n<pre># cd \/usr\/local\/collectd-web\/ &amp;&amp; python runserver.py 2&gt; \/tmp\/collectd.log &amp;\r\n<\/pre>\n<p>Then, enable both system services by issuing the following commands:<\/p>\n<pre>------------------ On <strong>Debian \/ Ubuntu<\/strong> ------------------\r\n# update-rc.d collectd enable\r\n# update-rc.d rc.local enable\r\n<\/pre>\n<p>Optionally, an alternate method to enable this services at boot time would be with the help on\u00a0<strong>sysv-rc-conf<\/strong>package:<\/p>\n<pre>------------------ On <strong>Debian \/ Ubuntu<\/strong> ------------------\r\n# sysv-rc-conf collectd on\r\n# sysv-rc-conf rc.local on\r\n<\/pre>\n<pre>------------------ On <strong>RHEL\/CentOS 6..x\/5.x and Fedora 12-19<\/strong> ------------------\r\n# chkconfig collectd on\r\n# chkconfig --level 5 collectd on\r\n<\/pre>\n<pre>------------------ On <strong>RHEL\/CentOS 7.x and Fedora 20 onwards<\/strong> ------------------\r\n# systemctl enable collectd\r\n<\/pre>\n<p>That\u2019s all!\u00a0<strong>Collectd<\/strong>\u00a0daemon and\u00a0<strong>Collectd-web<\/strong>\u00a0server prove to be excellent monitoring tools for Linux servers, with minimal impact concerning system resources, which can generate and display some interesting graphical statistics about machines workload, the only drawback so far being the fact the statistics are not displaying in real time without refreshing the browser.<\/p>\n<p><a style=\"font-size: 1rem;\" href=\"https:\/\/www.tecmint.com\/install-collectd-and-collectd-web-to-monitor-server-resources-in-linux\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Collectd-web\u00a0is a web front-end monitoring tool based on RRDtool (Round-Robin\u00a0Database\u00a0Tool), which interprets and graphical outputs the data collected by the\u00a0Collectd\u00a0service on Linux systems. Collectd\u00a0service comes by default with a huge collection of available plug-ins into its default configuration file, some of them being, by default, already activated once you have installed the software package. Collectd-web &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/15\/how-to-install-and-configure-collectd-and-collectd-web-to-monitor-server-resources-in-linux\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to Install and Configure \u2018Collectd\u2019 and \u2018Collectd-Web\u2019 to Monitor Server Resources in Linux&#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-11699","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\/11699","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=11699"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/11699\/revisions"}],"predecessor-version":[{"id":11700,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/11699\/revisions\/11700"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=11699"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=11699"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=11699"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}