zabbix_proxy安装配置

2019-06-19 02:16栏目:技术创新

proxy 报错: 28485:20140521:160622.590 cannot send list of active checks to [192.168.10.131]: host [Zabbix_agentd_bj131] not found agentd 报错: 19353:20140521:170513.538 No active checks on server: host [Zabbix_agentd_bj131] not found zabbix_agentd.conf 配置hostname为Zabbix_agentd_bj131,web配置Host name 也是Zabbix_agentd_bj131

其中Proxy name要和proxy配置文件zabbix_proxy.conf 中Hostname配置的名字一致。

这一步可能会有以下报错,原因是系统没安装zabbix_proxy依赖的程序。

zabbix_proxy

./zabbix_get -s 127.0.0.1  -p 10050 -k "agent.ping" 
zabbix_get在/usr/local/zabbix/bin

Zabbix_proxy_22 192.168.1.22:10051
Zabbix Agent 192.168.1.20:10050
scp -P5080 p2ptest@192.168.10.137:/home/p2ptest/zabbix* .
scp -P5080 p2ptest@192.168.10.136:/usr/local/etc/zabbix_agentd.conf  .
NetEast@bj308
 56543:20140522:121737.779 [Z3005] query failed: [1451] Cannot delete or update a parent row: a foreign key constraint fails (`zabbix`.`opgroup`, CONSTRAINT `c_opgroup_2` FOREIGN KEY (`groupid`) REFERENCES `groups` (`groupid`)) [delete from applications where (applicationid between 227 and 232 or applicationid between 234 and 238 or applicationid between 245 and 311 or applicationid between 328 and 355 or applicationid in (1,5,7,9,13,15,17,21,23,179,206,207,214,240,241,242,319,320,322,323,324,325));
delete from groups where groupid in (1,2,4);
delete from dchecks where dcheckid=2;
delete from drules where druleid=2;
delete from interface where interfaceid=1;
delete from hosts where (hostid between 10065 and 10079 or hostid in (10001,10047,10056,10060,10081,10082,10083,10084));
]
DBName=zabbix #安装zabbix时数据库的名字
DBUser=zabbix #安装zabbix时zabbix数据库的用户
DBPassword=zabbix #安装zabbix时zabbix数据库的密码

agentd报错: 19353:20140521:170513.538 No active checks on server: host [Zabbix_agentd_bj131] not found

1.在zabbix web interface中添加proxy:Administration -> GM -> proxies [create proxy],点save保存配置,如图:

Server=221.6.15.147 #若本机不是server,则修改为zabbix server的IP。

zabbix web地址:

4、导入数据库sql

[root@20-test zabbix-2.0.6]# yum list  curl
。。。。。
Installed Packages
curl.x86_64                                        7.19.7-26.el6_2.4                                        @anaconda-CentOS-201207061011.x86_64/6.3
Available Packages
curl.x86_64                                        7.19.7-37.el6_4                                          base                                    
[root@20-test zabbix-2.0.6]# yum install curl.x86_64
tar zxvf zabbix-2.0.6.tar.gz
cd zabbix-2.0.6
./configure --enable-proxy --enable-agent  --with-mysql --with-net-snmp --with-libcurl

重启proxy。

cp zabbix_agentd /etc/init.d 
cp zabbix_server /etc/init.d 
cp zabbix_proxy /etc/init.d 

2) 安装源码

登录名:admin 密码:zabbix

安装好再次编译 出错:

yum install make mysql-server httpd php mysql-devel gcc net-snmp-devel curl-devel perl-DBI php-gd php-mysql php-bcmath php-mbstring php-xml -y

groupadd zabbix
useradd -g zabbix zabbix

1、安装组建

  1. 添加proxy监控的主机:Configuraton ->Hosts->Create host, ,点save保存配置,如图:

    其中:Host name要和agentd配置文件zabbix_agentd.conf 中Hostname配置的名字一致。

  2. Visible name是在web界面展示的名字,可以随意配置,只要注意唯一。

  3. Agent interfaces:IP address配置agentd主机的ip。

  4. Monitored by proxy选择配置过的proxy。

删表opgroup的数据,注意要先删operations的相应数据列。

测试连通性:

3、创建zabbix数据库

查看配置文档,zabbix_agentd.conf 配置的hostname已经和web配置Host name 一致了。

Available Packages
mysql-devel.i686                                                        5.1.73-3.el6_5                                                       updates
mysql-devel.x86_64                                                      5.1.73-3.el6_5                                                       updates

出错:configure: error: Curl library not found

2、启动mysql

Mysql> create database zabbix character set utf8;
Mysql> grant all on zabbix.* TO zabbix@'localhost' identified by 'zabbix'; 
Mysql> flush privileges;

7)遇到的问题

操作 yum list mysql-devel

make && make install

cp  misc/init.d/fedora/core/zabbix_agentd   /etc/init.d/
chmod a x /etc/init.d/zabbix_*

安装好再次编译 OK

1) 创建用户

安装路径在: /usr/local/zabbix/ 将执行文件放/etc/init.d ,可以使用service启动

查看zabbix中表hosts的数据:新加的agent响应列available值置为1。

configure: error: Not found mysqlclient library
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
[root@20-test mysql]# mysql -uzabbix -p zabbix <data.sql     

Enter password: 
ERROR 1146 (42S02) at line 2: Table 'zabbix.hosts' doesn't exist
[root@20-test mysql]# mysql  zabbix <data.sql        
ERROR 1146 (42S02) at line 2: Table 'zabbix.hosts' doesn't exist
[root@20-test mysql]# mysql  zabbix <schema.sql
[root@20-test mysql]# mysql  zabbix <data.sql 
ERROR 1452 (23000) at line 2690: Cannot add or update a child row: a foreign key constraint fails (`zabbix`.`sysmaps_elements`, CONSTRAINT 
`c_sysmaps_elements_2` FOREIGN KEY (`iconid_off`) REFERENCES `images` (`imageid`))

[root@20-test mysql]# mysql  zabbix <images.sql 
[root@20-test mysql]# mysql  zabbix <data.sql 
[root@20-test mysql]# mysql
groupadd zabbix
useradd -g zabbix zabbix

处理方式:删数据库zabbix中表opgroup的数据,注意要先删operations的相应数据列。

不行 再 yum install curl-devel 安装好再次编译 出错:

5) zabbix web配置

configure: error: Invalid NET-SNMP directory - unable to find net-snmp-config
# yum list  net-snmp-devel        
.......
Available Packages
net-snmp-devel.i686                                                      1:5.5-49.el6_5.1                                                    updates
net-snmp-devel.x86_64                                                    1:5.5-49.el6_5.1                                                    updates
[root@20-test zabbix-2.0.6]# yum install net-snmp-devel.x86_64 

zabbix_agentd.conf 配置hostname为Zabbix_agentd_bj131,web配置Host name 也是Zabbix_agentd_bj131

optemplate

安装好再次编译

导入数据库sql正常性顺序:mysql -uzabbix -p zabbix <schema.sql

怀疑和下面的proxy报错有关:

6) 启动方式

Hostname=Zabbix_proxy_bj135 #可以修改其他名字,但必须是同一zabbix server唯一的名字,并且要和zabbix server web界面配置的Host name一致(注意大小写)。

[root@20-test zabbix-2.0.6]# yum install mysql-devel.x86_64

cd database/mysql/

关闭方式:pkill zabbix_proxy

proxy 报错: 28485:20140521:160622.590 cannot send list of active checks to [192.168.10.131]: host [Zabbix_agentd_bj131] not found

./configure --enable-proxy --with-mysql --with-net-snmp –with-libcurl

#####[root@20-test zabbix-2.0.6]# ./configure --prefix=/usr/local/zabbix --with-mysql --with-net-snmp --with-libcurl --enable-server --enable-agent --
enable-proxy
checking for a BSD-compatible install... /usr/bin/install -c

checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
configure: Configuring  
checking whether make sets $(MAKE)... (cached) yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/usr/local/zabbix-2.0.6':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
[root@20-test zabbix-2.0.6]# yum list gcc
Loaded plugins: fastestmirror
Determining fastest mirrors
 * base: mirrors.btte.net
 * extras: mirrors.btte.net
 * updates: mirrors.btte.net
base                                                                                                                         | 3.7 kB     00:00     
extras                                                                                                                       | 3.4 kB     00:00     
updates                                                                                                                      | 3.4 kB     00:00     
updates/primary_db                                                                                                           | 3.1 MB     00:01     
Available Packages
gcc.x86_64                                                             4.4.7-4.el6                                                              base
[root@20-test zabbix-2.0.6]# yum install gcc.x86_64
  1. zabbix <schema.sql
  2. zabbix <images.sql
  3. zabbix <data.sql
service mysqld start
mysqladmin –uroot password root
mysql –uroot –proot

版权声明:本文由新浦京娱乐站_新浦京娱乐场官网_新浦京娱乐发布于技术创新,转载请注明出处:zabbix_proxy安装配置