{"id":6915,"date":"2018-12-29T18:09:35","date_gmt":"2018-12-29T18:09:35","guid":{"rendered":"https:\/\/www.appservgrid.com\/paw92\/?p=6915"},"modified":"2018-12-30T05:01:23","modified_gmt":"2018-12-30T05:01:23","slug":"setting-up-zabbix-server-on-debian-9-0-linux-hint","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2018\/12\/29\/setting-up-zabbix-server-on-debian-9-0-linux-hint\/","title":{"rendered":"Setting Up Zabbix Server on Debian 9.0 \u2013 Linux Hint"},"content":{"rendered":"<p>Zabbix is very popular, easy to use, fast monitoring tool. It support monitoring Linux, Unix, windows environments with agents, SNMP v1,v2c,c3, agentless remote monitoring. It can also monitor remote environment with a proxy without opening port for remote environments. You can send email, sms, IM message, run sny type of script to automate daily or emergency tasks based on any scenario.<\/p>\n<p>Zabbix 4 is the latest version. New version supports php7, mysql 8, encryption between host and clients, new graphical layout, trend analysis and many more. With zabbix you can use zabbix_sender and zabbix_get tools to send any type of data to zabbix system and trigger alarm for any value. With these capabilities Zabbix is programmable and your monitoring is limited to your creativity and capability.<\/p>\n<p>Installing from Zabbix repository is the easiest way. In order to setup from source file you need to setup compilers and make decisions about which directories and features get used for your environment. The Zabbix repository files provide all features enable and ready to go environment for your needs.<\/p>\n<p>If you had the chance to use the setup we have select xfce for desktop environment. If you have not rest of the installation steps will perfectly work even if you had minimal setup environment which is the cleanest environment you find for Debian.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2018\/12\/1-41.png\" alt=\"\" width=\"803\" height=\"605\" \/><\/p>\n<h2>Security First!<\/h2>\n<p>Login to the root user and add the guest user to soders file simple adding.<\/p>\n<p>Username ALL=(ALL:ALL) ALL<\/p>\n<p>Into the configuration file \/etc\/sudoers<\/p>\n<p>You can also use<\/p>\n<p>To directly edit the file with the default text editor (nano in my case)<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2018\/12\/2-37.png\" alt=\"\" width=\"818\" height=\"197\" \/><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2018\/12\/3-36.png\" alt=\"\" width=\"818\" height=\"311\" \/><\/p>\n<h3>Install Mysql<\/h3>\n<p>Once you create the guest user and give root privileges we can login to the user with<\/p>\n<p>and start to add sudo in front of the commands to send root commands with control.<\/p>\n<p>Install Mysql with following command<\/p>\n<p>$ sudo apt-get install mysql-server<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2018\/12\/4-35.png\" alt=\"\" width=\"818\" height=\"197\" \/><\/p>\n<p>Press \u2018Y\u2019 in order to download and install.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2018\/12\/5-37.png\" alt=\"\" width=\"819\" height=\"512\" \/><\/p>\n<p>Right after the installation add mysql to the startup sequence so when system reboots your mysql server will be up.<\/p>\n<p>$ sudo systemctl\u00a0<a href=\"http:\/\/search.oracle.com\/search\/search?group=MySQL&amp;q=ENABLE\">enable\u00a0<\/a>mariadb<\/p>\n<p>$ sudo systemctl\u00a0<a href=\"http:\/\/search.oracle.com\/search\/search?group=MySQL&amp;q=START\">start\u00a0<\/a>mariadb<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2018\/12\/6-33.png\" alt=\"\" width=\"850\" height=\"168\" \/><\/p>\n<p>You can test if mysql is up with the following command<\/p>\n<p>You should be able to login to the database server without entering a password.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2018\/12\/7-34.png\" alt=\"\" width=\"847\" height=\"363\" \/><\/p>\n<p>Type quit to log out of the server<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2018\/12\/8-31.png\" alt=\"\" width=\"847\" height=\"424\" \/><\/p>\n<h3>Install Zabbix from Repository<\/h3>\n<p>Once the database server installation has finished we can start installing zabbix application.<\/p>\n<p>Download apt repo package to the system<\/p>\n<p>$sudo wget https:\/\/repo.zabbix.com\/zabbix\/4.0\/debian\/pool\/main\/z\/zabbix-release\/zabbix-release_4.0-2+stretch_all.deb<\/p>\n<p>$ sudo dpkg -i zabbix-release_4.0-2+stretch_all.deb<\/p>\n<p>$sudo apt update<\/p>\n<p>Lets install Zabbix server and front end packages.<\/p>\n<p>$ sudo apt install zabbix-server-mysql zabbix-frontend-php zabbix-agent<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2018\/12\/9-28.png\" alt=\"\" width=\"850\" height=\"517\" \/><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2018\/12\/10-28.png\" alt=\"\" width=\"849\" height=\"517\" \/><\/p>\n<h3>Add Zabbix Services to Startup<\/h3>\n<p>Once all packages are installed enable Zabbix services but don\u2019t start yet. We need modifications on the configuration file.<\/p>\n<p>$ sudo systemctl\u00a0<a href=\"http:\/\/search.oracle.com\/search\/search?group=MySQL&amp;q=ENABLE\">enable\u00a0<\/a>apache2<\/p>\n<p>$ sudo systemctl\u00a0<a href=\"http:\/\/search.oracle.com\/search\/search?group=MySQL&amp;q=ENABLE\">enable\u00a0<\/a>zabbix-server<\/p>\n<p>$ sudo systemctl\u00a0<a href=\"http:\/\/search.oracle.com\/search\/search?group=MySQL&amp;q=ENABLE\">enable\u00a0<\/a>zabbix-agent<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2018\/12\/11-27.png\" alt=\"\" width=\"850\" height=\"515\" \/><\/p>\n<h3>Create Database and Deploy Zabbix Database Tables<\/h3>\n<p>Now it is time to create database for Zabbix. Please note you can create a database with any name and a user. All you need is replace apropirate value with the commands we provided below.<\/p>\n<p>In our case we will pickup (all are case sensitive)<\/p>\n<p>We create zabbix database and user with mysql root user<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2018\/12\/12-26.png\" alt=\"\" width=\"849\" height=\"457\" \/><\/p>\n<p>After creating database and users we create the Zabbix database tables in our new database with the following command<\/p>\n<p># zcat \/usr\/share\/doc\/zabbix-server-mysql*\/create.sql.gz | mysql -uzabbix -p -B Zabbix<\/p>\n<p>Enter your database password in next step<\/p>\n<p>Process may take about 1-10 minutes depending on your performance of server.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2018\/12\/13-25.png\" alt=\"\" width=\"819\" height=\"112\" \/><\/p>\n<h3>Configure Zabbix Server<\/h3>\n<p>In order to have our Zabbix server start and get ready for business we must define database parameters into the zabbix_server.conf<\/p>\n<p>$ sudo nano \/etc\/zabbix\/zabbix_server.conf<\/p>\n<p>DBHost=localhost<br \/>\nDBUser=zabbix<br \/>\nDBPassword=VerySecretPassword<br \/>\nDBName=zabbix<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2018\/12\/14-24.png\" alt=\"\" width=\"817\" height=\"515\" \/><\/p>\n<p>Time zone needs to be entered into \/etc\/zabbix\/apache.conf file in order not to face any time related inconsistency in our environment. Also this step is a must for a errorless environment. If this parameter is not set Zabbix web interface will warn us every time. In my case the time zone is Europe\/Istanbul.<\/p>\n<p>You can get <a href=\"http:\/\/php.net\/manual\/en\/timezones.php\">full list of PHP time zones<\/a> here.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2018\/12\/15-24.png\" alt=\"\" width=\"813\" height=\"518\" \/><\/p>\n<p>Please also note there are php7 and php5 segments here. In our setup php 7 was installed so modifying the php_value date.timezone in the php7.c segment was enough but we recommend modifying the php5 for compatibility issues.<\/p>\n<p>Save the file.<\/p>\n<p>Now stop and start services in order to have all changes in affect.<\/p>\n<p>$ sudo systemctl restart apache2 zabbix-server zabbix-agent<\/p>\n<h3>Setting up Web Server<\/h3>\n<p>Now database and Zabbix services are up. In order to check whats going in our systems we should setup web interface with mysql support. This is our last step before going online and start checking some stats.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2018\/12\/16-23.png\" alt=\"\" width=\"1140\" height=\"578\" \/><\/p>\n<p>Welcome Screen.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2018\/12\/17-19.png\" alt=\"\" width=\"1140\" height=\"578\" \/><\/p>\n<p>Check if everything in ok with Green color.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2018\/12\/18-18.png\" alt=\"\" width=\"1140\" height=\"578\" \/><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2018\/12\/19-13.png\" alt=\"\" width=\"1140\" height=\"575\" \/><\/p>\n<p>Define user name and password we defined in setting up database section.<\/p>\n<p>DBHost=localhost<br \/>\nDBUser=zabbix<br \/>\nDBPassword=VerySecretPassword<br \/>\nDBName=zabbix<\/p>\n<p>You can define Zabbix-server name in this step. You want to have it called something like watch tower or monitoring server something like it too.<\/p>\n<p>Note: You can change this setting from<\/p>\n<p>\/etc\/zabbix\/web\/zabbix.conf.php<\/p>\n<p>You can change the $ZBX_SERVER_NAME parameter in the file.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2018\/12\/20-14.png\" alt=\"\" width=\"1140\" height=\"578\" \/><\/p>\n<p>Verify setting and press Next Step<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2018\/12\/21-14.png\" alt=\"\" width=\"1140\" height=\"577\" \/><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2018\/12\/22-13.png\" alt=\"\" width=\"1360\" height=\"693\" \/><\/p>\n<p>Default username and password are (case sensitive)<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2018\/12\/23-13.png\" alt=\"\" width=\"1361\" height=\"690\" \/><\/p>\n<p>Now you can check your system stats.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2018\/12\/24-13.png\" alt=\"\" width=\"1140\" height=\"577\" \/><\/p>\n<p>Go to Monitoring -&gt; Latest data<\/p>\n<p>And select Zabbix Server from Host groups and check if stats are coming live.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2018\/12\/25-13.png\" alt=\"\" width=\"1360\" height=\"690\" \/><\/p>\n<h4>Conclusion<\/h4>\n<p>We have setup the database server in the beginning because a system with already installed packages can prevent any version or mysql version we want to download because of conflicts. You can also download mysql server from the mysql.com site.<\/p>\n<p>Later on we continued with Zabbix binary package installation and created database and user. Next step was to configure Zabbix configuration files and install web interface. In later stages you can install SSL, modify configuration for a specific web domain, proxy through nginx or directly run from nginx with php-fpm, upgrade PHP and such things like things. You may also disable Zabbix-agent in order to save from database space. It is all up to you.<\/p>\n<p>Now you can enjoy monitoring with Zabbix. Have a Nice Day.<\/p>\n<p><a href=\"https:\/\/linuxhint.com\/zabbix_debian9_server\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Zabbix is very popular, easy to use, fast monitoring tool. It support monitoring Linux, Unix, windows environments with agents, SNMP v1,v2c,c3, agentless remote monitoring. It can also monitor remote environment with a proxy without opening port for remote environments. You can send email, sms, IM message, run sny type of script to automate daily or &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2018\/12\/29\/setting-up-zabbix-server-on-debian-9-0-linux-hint\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Setting Up Zabbix Server on Debian 9.0 \u2013 Linux Hint&#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-6915","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\/6915","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=6915"}],"version-history":[{"count":2,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/6915\/revisions"}],"predecessor-version":[{"id":6965,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/6915\/revisions\/6965"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=6915"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=6915"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=6915"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}