Hello everybody,
discussed about monitoring here and got interested in Zabbix:
So I installed it and want to share my installation experience:
EDIT 9.3.2018
- community module is ready for testing
EDIT 29.10.2017:
- added 3.4 source and commands
- removed “-uroot” from “mysql” as it is obsolete
- optional PHP configuration
- added application link
Repository and Packages installation
Download repo and install packages for Zabbix
Version 3.4:
rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm
Version 3.2
rpm -ivh http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm
All versions:
yum install nano nethserver-mysql zabbix-server-mysql zabbix-web-mysql
Database setup
Enter mariadb/mysql:
mysql
Create database zabbix and user zabbix with all privileges on the new database and set a password “SECRET”:
create database zabbix character set utf8 collate utf8_bin;
grant all privileges on zabbix.* to zabbix@localhost identified by 'SECRET';
quit;
Import the DB scheme to the new database, after executing the command you have to enter the password set in mysql one step before:
Version 3.4
zcat /usr/share/doc/zabbix-server-mysql-3.4.3/create.sql.gz | mysql -uzabbix -p zabbix
Version 3.2
zcat /usr/share/doc/zabbix-server-mysql-3.2.7/create.sql.gz | mysql -u zabbix -p zabbix
All versions:
nano /etc/zabbix/zabbix_server.conf
and change DBPassword to your SECRET:
DBPassword=SECRET
PHP configuration
You may leave this point to let /etc/httpd/conf.d/zabbix.conf set PHP variables. In this case you may just set timezone and go straight to Zabbix configuration.
Follow the steps if you want Nethserver to control the php settings that are available, don’t forget to set YOUR timezone at the end:
config setprop php MemoryLimit 128 PostMaxSize 16 UploadMaxFilesize 2 MaxExecutionTime 300 DateTimezone Europe/Vienna
Edit /etc/httpd/conf.d/zabbix.conf:
nano /etc/httpd/conf.d/zabbix.conf
and comment/uncomment the php settings until it looks like here:
<IfModule mod_php5.c>
#php_value max_execution_time 300
#php_value memory_limit 128M
#php_value post_max_size 16M
#php_value upload_max_filesize 2M
php_value max_input_time 300
php_value always_populate_raw_post_data -1
#php_value date.timezone Europe/Vienna
</IfModule>
Apply configuration:
signal-event nethserver-php-update
systemctl restart httpd
Zabbix configuration
Enable and start Zabbix service:
systemctl enable zabbix-server
systemctl start zabbix-server
Browse to https://YOURNETHSERVER/zabbix, continue with “Next step”:
Everything should be OK/green…
Enter the password:
You may enter an optional installation name:
A summary of your settings:
Looks good…
Login with user Admin (case sensitive!) and password zabbix
Zabbix Dashboard coming up:
Adding Zabbix to application menu
Create /usr/share/nethesis/NethServer/Module/Dashboard/Applications/Zabbix.php with following content:
<?php
namespace NethServer\Module\Dashboard\Applications;
/*
* Copyright (C) 2013 Nethesis S.r.l.
*
* This script is part of NethServer.
*
* NethServer is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* NethServer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with NethServer. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* Zabbix interface
*/
class Zabbix extends \Nethgui\Module\AbstractModule implements \NethServer\Module\Dashboard\Interfaces\ApplicationInterface
{
public function getName()
{
return "Zabbix";
}
public function getInfo()
{
$host = explode(':',$_SERVER['HTTP_HOST']);
return array(
'url' => "https://".$host[0]."/zabbix/",
);
}
}
Sources:
https://www.zabbix.com/documentation/3.4/manual/installation/install_from_packages/rhel_centos
https://www.zabbix.com/documentation/3.2/manual/installation/install_from_packages/server_installation_with_mysql
https://www.zabbix.com/documentation/3.2/manual/installation/install#installing_frontend
@Andy_Wismer, maybe you could improve this howto with some UI configuration steps to monitor a client…