{"id":36204,"date":"2016-06-30T19:20:09","date_gmt":"2016-06-30T13:50:09","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=36204"},"modified":"2024-01-02T18:33:42","modified_gmt":"2024-01-02T13:03:42","slug":"getting-started-with-zabbix","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/getting-started-with-zabbix\/","title":{"rendered":"Getting Started with Zabbix"},"content":{"rendered":"<p><span style=\"color: #000000;\">Zabbix is an Open source <a title=\"DevOps Tools\" href=\"http:\/\/www.tothenew.com\/devops-chef-puppet-docker\">distributed monitoring tool<\/a>. It allows us to monitor integrity and health of the\u00a0server, network traffic, \u00a0and applications. \u00a0Zabbix uses a notification mechanism that allows users to configure e-mail based alerts for virtually any event.\u00a0<\/span><\/p>\n<p><img decoding=\"async\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/08\/Zabbix_logo.png\" alt=\"\" \/><\/p>\n<p><span style=\"color: #000000;\">Components Used in Zabbix are as follows:<\/span><\/p>\n<ul>\n<li><span style=\"color: #000000;\"><span style=\"font-weight: 400;\"><strong>Zabbix Server<\/strong> : This is the central component that receives all the <\/span> <span style=\"font-weight: 400;\">monitoring report and statistics. Zabbix server provides a web <\/span> <span style=\"font-weight: 400;\">interface to present reports and statistics, as well as configure <\/span> <span style=\"font-weight: 400;\">parameters.<\/span><\/span><\/li>\n<li><span style=\"color: #000000;\"><strong>Database Storage<\/strong> : All the configuration information, as well as monitoring data gathered, <span style=\"font-weight: 400;\">is stored in a database.<\/span><\/span><\/li>\n<li><span style=\"color: #000000;\"><span style=\"font-weight: 400;\"><strong>Zabbix Agent<\/strong> : Zabbix agent is a software that is deployed on the <\/span> <span style=\"font-weight: 400;\">target machine that needs to be monitored. It is responsible for <\/span> <span style=\"font-weight: 400;\">reporting the gathered data from the target to Zabbix Server.<\/span><\/span><\/li>\n<\/ul>\n<h2><span style=\"color: #000000;\"><strong><br \/>\nZabbix Server Installation<\/strong><\/span><\/h2>\n<h3><span style=\"color: #000000;\">Prerequisites:<\/span><\/h3>\n<ul>\n<li><span style=\"color: #000000;\">Mysql 5.3.0 or above<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400; color: #000000;\">To install Zabbix Server in CentOs, follow the steps:<\/span><\/p>\n<ol>\n<li><span style=\"font-weight: 400; color: #000000;\"> Install Zabbix Server. By default httpd server is installed with Zabbix\u00a0for hosting\u00a0php code of Zabbix server UI. Zabbix server runs on 10051 port:\u00a0<\/span><\/li>\n<\/ol>\n<p>[js]<br \/>\nyum install epel-release<br \/>\nrpm &#8211;import http:\/\/repo.zabbix.com\/RPM-GPG-KEY-ZABBIX<br \/>\nrpm -Uv http:\/\/repo.zabbix.com\/zabbix\/2.4\/rhel\/7\/x86_64\/zabbix-release-2.4-1.el7.noarch.rpm<br \/>\nyum install zabbix-server-mysql zabbix-web-mysql<br \/>\n[\/js]<\/p>\n<ol start=\"2\">\n<li><span style=\"font-weight: 400; color: #000000;\">Edit the Zabbix configuration file using the following command:<\/span><\/li>\n<\/ol>\n<p>[js]<br \/>\nvi \/etc\/httpd\/conf.d\/zabbix.conf<br \/>\n[\/js]<\/p>\n<p><span style=\"font-weight: 400; color: #000000;\">Update the timezone parameter in the file:<\/span><\/p>\n<p>[js]<br \/>\nphp_value date.timezone Asia\/Kolkata<br \/>\n[\/js]<\/p>\n<ol start=\"3\">\n<li><span style=\"font-weight: 400; color: #000000;\"> Restart the httpd\u00a0server:<\/span><\/li>\n<\/ol>\n<p>[js]<br \/>\nsystemctl restart httpd<br \/>\n[\/js]<\/p>\n<ol start=\"4\">\n<li><span style=\"font-weight: 400; color: #000000;\"> Create Database and user for Zabbix:<\/span><\/li>\n<\/ol>\n<p>[js]<br \/>\nmysql -u root -p<br \/>\nmysql &gt; create database zabbixdb character set utf8;<br \/>\nmysql &gt; grant all privileges on zabbixdb.* to &#8216;zabbixuser&#8217;@&#8217;localhost&#8217; identified by &#8216;your_password&#8217;;<br \/>\nmysql &gt; flush privileges;<br \/>\nmysql &gt; exit<br \/>\n[\/js]<\/p>\n<ol start=\"5\">\n<li><span style=\"font-weight: 400; color: #000000;\"> Import Zabbix Schema and data to zabbixdb:<\/span><\/li>\n<\/ol>\n<p>[js]<br \/>\nmysql -u zabbixuser -p zabbixdb &lt; \/usr\/share\/doc\/zabbix-server-mysql 2.4.5\/create\/schema.sql<br \/>\nmysql -u zabbixuser -p zabbixdb &lt; \/usr\/share\/doc\/zabbix-server-mysql-2.4.5\/create\/images.sql<br \/>\nmysql -u zabbixuser -p zabbixdb &lt; \/usr\/share\/doc\/zabbix-server-mysql-2.4.5\/create\/data.sql<br \/>\n[\/js]<\/p>\n<ol start=\"6\">\n<li><span style=\"font-weight: 400; color: #000000;\"> Edit Database configuration in zabbix_server.conf:<\/span><\/li>\n<\/ol>\n<p>[js]<br \/>\nvi \/etc\/zabbix\/zabbix_server.conf<br \/>\n[\/js]<\/p>\n<p><span style=\"font-weight: 400; color: #000000;\">Update the following parameters:<\/span><\/p>\n<p>[js]<br \/>\nDBName=zabbixdb<br \/>\nDBUser=zabbixuser<br \/>\nDBPassword=your_password<br \/>\n[\/js]<\/p>\n<ol start=\"7\">\n<li><span style=\"font-weight: 400; color: #000000;\"> Edit PHP configuration for Zabbix frontend:<\/span><\/li>\n<\/ol>\n<p>[js]<br \/>\nvi \/etc\/php.ini<br \/>\n[\/js]<\/p>\n<p><span style=\"font-weight: 400; color: #000000;\">Update the following parameters in file :<\/span><\/p>\n<p>[js]<br \/>\nmax_execution_time = 600<br \/>\nmax_input_time = 600<br \/>\nmemory_limit = 256M<br \/>\npost_max_size = 32M<br \/>\nupload_max_filesize = 16M<br \/>\ndate.timezone = Asia\/Kolkata<br \/>\n[\/js]<\/p>\n<ol start=\"8\">\n<li><span style=\"font-weight: 400; color: #000000;\"> Make sure that either SELinux is disabled or apache is configured to communicate with Zabbix in SELinux.<\/span><\/li>\n<\/ol>\n<ol start=\"9\">\n<li><span style=\"font-weight: 400; color: #000000;\"> Now, start Zabbix and httpd server using below commands:<\/span><\/li>\n<\/ol>\n<p>[js]<br \/>\nsystemctl start zabbix-server<br \/>\nsystemctl restart httpd<br \/>\n[\/js]<\/p>\n<h2><span style=\"color: #000000;\"><strong><br \/>\nConfiguring Server through Web UI<\/strong><\/span><\/h2>\n<p><span style=\"color: #000000;\">1.<strong><strong>\u00a0<\/strong><\/strong><span style=\"font-weight: 400;\">Open the browser and navigate to <\/span><b>Zabbix_Server_ip\/Zabbix:<\/b><\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-36888\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/06\/zabbix14.png\" alt=\"zabbix1\" width=\"571\" height=\"376\" \/><\/p>\n<p><span style=\"color: #000000;\"><strong><span style=\"font-weight: 400;\">2. On clicking Next, you will be taken to prerequisites window. It displays information about the softwares that are required by Zabbix Server:<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><\/strong><\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-36889\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/06\/zabbix21.png\" alt=\"zabbix2\" width=\"786\" height=\"513\" \/><\/p>\n<p><span style=\"font-weight: 400; color: #000000;\">3. Verify the version of software installed in the Server and Press Next to Continue:<\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-36890\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/06\/zabbix31.png\" alt=\"zabbix3\" width=\"786\" height=\"517\" \/><\/p>\n<p><span style=\"font-weight: 400; color: #000000;\">4. Enter the Database Name, Database user, and password and Test the connection. Press Next to continue:<\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-36891\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/06\/zabbix41.png\" alt=\"zabbix4\" width=\"786\" height=\"515\" \/><\/p>\n<p><span style=\"font-weight: 400; color: #000000;\">5. Enter Server Name and port and then Click Next:<\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-36893\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/06\/zabbix51.png\" alt=\"zabbix5\" width=\"786\" height=\"517\" \/><\/p>\n<p><span style=\"font-weight: 400; color: #000000;\">6. Re-check the configuration parameter and Press Next:<\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-36895\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/06\/zabbix61.png\" alt=\"zabbix6\" width=\"790\" height=\"515\" \/><\/p>\n<p><span style=\"font-weight: 400; color: #000000;\">Congratulation, you have successfully installed Zabbix Server. Click on finish to login to Zabbix server:<\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-36896\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/06\/zabbix71.png\" alt=\"zabbix7\" width=\"601\" height=\"277\" \/><\/p>\n<p><span style=\"font-weight: 400; color: #000000;\">7. The default username and password is\u00a0admin and zabbix respectively.<\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-36897\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/06\/zabbix81.png\" alt=\"zabbix8\" width=\"1301\" height=\"683\" \/><\/p>\n<h2><span style=\"color: #000000;\"><strong><br \/>\n<\/strong><\/span><b>Zabbix Agent Installation<\/b><\/h2>\n<p><span style=\"font-weight: 400; color: #000000;\">To Install Zabbix agent in CentOs, follow the steps:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400; color: #000000;\">Install Zabbix agent on the target machine:<\/span><\/li>\n<\/ol>\n<p>[js]<br \/>\nrpm &#8211;import http:\/\/repo.zabbix.com\/RPM-GPG-KEY-ZABBIX<br \/>\nrpm -Uv \u00a0http:\/\/repo.zabbix.com\/zabbix\/2.4\/rhel\/7\/x86_64\/zabbix-release-2.4-1.el7.noarch.rpm<br \/>\nyum install zabbix-agent -y<br \/>\n[\/js]<\/p>\n<ol start=\"2\">\n<li><span style=\"font-weight: 400; color: #000000;\"> Update Zabbix Client Configuration file:<\/span><\/li>\n<\/ol>\n<p>[js]<br \/>\nsudo vi \/etc\/zabbix\/zabbix_agentd.conf<br \/>\n[\/js]<\/p>\n<p><span style=\"font-weight: 400; color: #000000;\">Update the following parameters in the file:<\/span><\/p>\n<p>[js]<br \/>\nServer=Zabbix_Server_ip<br \/>\nActiveServer=Zabbix_Server_ip<br \/>\nHostname=hostname_of_target_host<br \/>\n[\/js]<\/p>\n<ol start=\"3\">\n<li><span style=\"font-weight: 400; color: #000000;\"> Now, start Zabbix Agent using following command:<\/span><\/li>\n<\/ol>\n<p>[js]<br \/>\nsystemctl start zabbix-agent<br \/>\n[\/js]<\/p>\n<p><span style=\"color: #000000;\">\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400; color: #000000;\">Now, it&#8217;s time to add monitoring\/target host on Zabbix Server<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\"><span style=\"color: #000000;\"><span style=\"font-weight: 400;\">Open Zabbix Server Web UI and Navigate to Configuration -&gt; hosts\u00a0<\/span><span style=\"font-weight: 400;\">and Click on create hosts:<\/span><\/span><\/li>\n<\/ol>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-36898\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/06\/zabbix91.png\" alt=\"zabbix9\" width=\"1301\" height=\"307\" \/><\/p>\n<ol start=\"2\">\n<li><span style=\"font-weight: 400; color: #000000;\"> Provide Hostname, group and IP of the target machine. A group is a collection of related hosts. You can create new groups from Configuration -&gt; Host groups -&gt; create group.<br \/>\n<\/span><\/li>\n<\/ol>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-36232\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/06\/zabbix9.png\" alt=\"zabbix\" width=\"1366\" height=\"768\" \/><\/p>\n<ol start=\"3\">\n<li><span style=\"font-weight: 400; color: #000000;\"> Click on template Tab and select a template from default templates provided by Zabbix Server. Template is used to group items. Items are the basis of gathering data in Zabbix. An item defines a single metric. We can also create custom items and templates.<\/span><\/li>\n<\/ol>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-36899\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/06\/zabbix111.png\" alt=\"zabbix11\" width=\"1366\" height=\"380\" \/><\/p>\n<ol start=\"4\">\n<li><span style=\"font-weight: 400; color: #000000;\"> Click on Add to attach the template to host and then press Add to add the host for monitoring.<\/span><\/li>\n<\/ol>\n<p><span style=\"color: #000000;\"><strong><br \/>\n<span style=\"font-weight: 400;\">Congratulations!<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">You have configured a host for monitoring. <\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><\/strong><\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-36901\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/06\/zabbix121.png\" alt=\"zabbix12\" width=\"1366\" height=\"364\" \/><\/p>\n<ol start=\"5\">\n<li><span style=\"font-weight: 400; color: #000000;\"> Now navigate to Monitoring -&gt; Latest Data to view monitoring information:<\/span><\/li>\n<\/ol>\n<p><span style=\"color: #000000;\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-36235\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/06\/zabbix12.png\" alt=\"zabbix\" width=\"1366\" height=\"768\" \/><\/span><\/p>\n<ol start=\"6\">\n<li><span style=\"font-weight: 400; color: #000000;\"> To view information in graphical format, navigate to Monitoring -&gt; graphs, select the host and graph metric from the drop down menu:<\/span><\/li>\n<\/ol>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-36900\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/06\/zabbix131.png\" alt=\"zabbix13\" width=\"1366\" height=\"675\" \/><\/p>\n<p><span style=\"font-weight: 400; color: #000000;\">Zabbix is an amazing open source monitoring tool which can also be used to monitor network traffic, to create a custom metric, perform web application monitoring and trigger alarm when system deviate from its usual behavior.<\/span><\/p>\n<p><span style=\"font-weight: 400; color: #000000;\">I hope it helps. In my next blog, we will learn how to create a\u00a0custom metric and trigger the respective alarm.<\/span><\/p>\n<p><span style=\"color: #000000;\">\u00a0<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Zabbix is an Open source distributed monitoring tool. It allows us to monitor integrity and health of the\u00a0server, network traffic, \u00a0and applications. \u00a0Zabbix uses a notification mechanism that allows users to configure e-mail based alerts for virtually any event.\u00a0 Components Used in Zabbix are as follows: Zabbix Server : This is the central component that [&hellip;]<\/p>\n","protected":false},"author":918,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":37},"categories":[2348,1],"tags":[1892,1499,3591,3704,3706,3705],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/36204"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/918"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=36204"}],"version-history":[{"count":2,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/36204\/revisions"}],"predecessor-version":[{"id":59922,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/36204\/revisions\/59922"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=36204"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=36204"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=36204"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}