使用yum安装zabbix-server-mysql,编辑配置文件并启动服务,创建zabbix数据库和用户,导入模板。
在CentOS上安装和配置Zabbix服务器的步骤如下:
1、更新系统软件包
sudo yum update y
2、安装EPEL(Extra Packages for Enterprise Linux)仓库
sudo yum install epelrelease y
3、安装LAMP(Linux、Apache、MySQL、PHP)堆栈
sudo yum install httpd mariadbserver php phpmysqlnd phpldap phpodbc phppear phpxml phpmbstring phpsnmp phpsoap curl curldevel y
4、启动并设置开机启动Apache和MariaDB服务
sudo systemctl start httpd mariadb sudo systemctl enable httpd mariadb
5、运行MariaDB安全安装脚本,设置root密码和其他安全选项
sudo mysql_secure_installation
6、创建Zabbix数据库和用户
mysql u root p CREATE DATABASE zabbix; GRANT ALL PRIVILEGES ON zabbix.* TO zabbix@localhost IDENTIFIED BY 'zabbix'; FLUSH PRIVILEGES; EXIT;
7、导入Zabbix数据库初始架构和数据
zcat /usr/share/doc/zabbixservermysql*/create.sql.gz | mysql uzabbix pzabbix zabbix
8、安装Zabbix服务器、前端和代理软件包
sudo yum install zabbixservermysql zabbixwebmysql zabbixapacheconf zabbixagent y
9、编辑Zabbix配置文件/etc/zabbix/zabbix_server.conf
,设置以下参数:
参数 | 值 |
DBHost | localhost |
DBName | zabbix |
DBUser | zabbix |
DBPassword | zabbix |
PHPType | apache2handler |
PidFile | /var/run/zabbix/zabbix_server.pid |
LogFile | /var/log/zabbix/zabbix_server.log |
SenderFrequency | 60 |
SourceIP | 127.0.0.1 |
LogSlowQueries | 1000 |
StartPollers | 5 |
MaxHousekeepers | 20 |
BacgroundPollerInterval | 300 |
PollerTimeout | 300 |
HousekeeperInterval | 300 |
HistoryCacheSize | 80 |
HistoryIndex | 10 |
FrontendURL | http://your_server_ip/zabbix |
ServerActive | On |
Hostname | your_server_hostname |
Include | /etc/zabbix/zabbix_server.d/*.conf |
UserParameter | zabbix, admin |
WebHooksPath | /usr/lib/zabbix/alertscripts |
LogLevel | 3 |
LogVerbosity | 3 |
UnsafeUserParameters | admin, Zabbix server administrator, Zabbix agent admin, Zabbix monitoring administrator, Zabbix agent, Zabbix agent (active) |
AllowRoot | no |
PHPAlwaysEval | Off |
PHPShortOpenTag | Off |
PHPIncludePath | /usr/share/zabbixphp |
PHPExcludePath | /usr/share/zabbixphp |
SSHKeyAuthentication | On |
SSHKeyLocation | /etc/zabbix/ssh_host_keys |
SSHUser | zabbix |
SSHPassword | zabbix |
SSHPort | 22 |
SSHKeyAudit | Off |
SSHKeyAuditType | fail |
SSHKeyAuditAction | restart |
SSHKeyAuditInterval | 3600 |
SSHKeyAuditMaxRetry | 3 |
SSHKeyAuditThreshold | 3 |
SSHKeyAuditSkipUser | root, zabbix, demo, test |
SSHKeyAuditFailUser | root, zabbix, demo, test |
SSHKeyAuditSuccessUser | root, zabbix, demo, test |
文章名称:如何在CentOS上安装和配置Zabbix服务器
标题URL:http://www.shufengxianlan.com/qtweb/news38/392588.html
网站建设、网络推广公司-创新互联,是专注品牌与效果的网站制作,网络营销seo公司;服务项目有等
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联