使用FPM制作ARM平台ZabbixAgent RPM包
约 479 字
预计阅读 1 分钟
次阅读
安装fpm/rpm-build
1
2
3
4
5
6
7
|
yum install ruby ruby-devel rubygems rpm-build
https://gems.ruby-china.com/
gem sources --remove http://rubygems.org/
gem sources --add https://gems.ruby-china.com/
gem sources -l
gem install fpm
yum install -y rpm-build
|
制作RPM包
ZabbixAgent
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
https://cdn.zabbix.com/zabbix/sources/oldstable/4.2/
yum install -y rpm-build
tar zxf zabbix-4.2.8.tar.gz
cd zabbix-4.2.8
vi misc/init.d/tru64/zabbix_agentd
变更1:在#!/bin/sh下面添加两行
#chkconfig: 345 95 95
#description: Zabbix_Agent
变更2:修改启动位置
将DAEMON=/usr/local/sbin/zabbix_agentd改为DAEMON=/usr/local/zabbix-agent/sbin/zabbix_agentd
./configure --prefix=/usr/local/zabbix-agent --enable-agent
make
make install
cp misc/init.d/tru64/zabbix_agentd /usr/local/zabbix-agent/zabbix-agent
vi /home/mds/after-install.sh
#!/bin/bash
source /etc/rc.d/init.d/functions
groupadd zabbix
useradd -M -g zabbix zabbix -s /sbin/nologin
mv /usr/local/zabbix-agent/zabbix-agent /etc/init.d/
chmod +x /etc/init.d/zabbix-agent
mkdir -p /var/log/zabbix
chmod -R 755 /var/log/zabbix/
chown -R zabbix. /var/log/zabbix/
chmod -R 755 /usr/local/zabbix-agent/
chown -R zabbix. /usr/local/zabbix-agent/
chkconfig --add zabbix-agent
exit $?
vi /home/mds/after-remove.sh
#!/bin/bash
source /etc/rc.d/init.d/functions
rm -rf /usr/local/zabbix-agent/
rm -f /etc/init.d/zabbix-agent
userdel zabbix
exit $?
fpm -s dir -t rpm --vendor CentOS7.7 -n zabbix-agent -v 4.2.8 -d 'pcre,pcre-devel' -C /usr/local/zabbix-agent/ --prefix /usr/local/zabbix-agent/ --after-install /home/mds/after-install.sh --after-remove /home/mds/after-remove.sh
|
ZabbixProxy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
dnf install mysql5-server mysql5-devel mysql5 net-snmp-devel libevent-devel curl-devel
./configure --prefix=/usr/local/zabbix-proxy --enable-proxy --with-mysql --with-net-snmp --with-libcurl --with-libxml2
# cat /home/mds/after-install.sh
#!/bin/bash
source /etc/rc.d/init.d/functions
groupadd zabbix
useradd -M -g zabbix zabbix -s /sbin/nologin
mv /usr/local/zabbix-proxy/zabbix-proxy /etc/init.d/
chmod +x /etc/init.d/zabbix-proxy
mkdir -p /var/log/zabbix
chmod -R 755 /var/log/zabbix/
chown -R zabbix. /var/log/zabbix/
chmod -R 755 /usr/local/zabbix-proxy/
chown -R zabbix. /usr/local/zabbix-proxy/
chkconfig --add zabbix-proxy
exit $?
# cat /home/mds/after-remove.sh
#!/bin/bash
source /etc/rc.d/init.d/functions
rm -rf /usr/local/zabbix-proxy/
rm -f /etc/init.d/zabbix-proxy
userdel zabbix
exit $?
fpm -s dir -t rpm --vendor openEuler20.03 -n zabbix-proxy -v 4.2.8 -d 'net-snmp-devel,libevent-devel,curl-devel' -C /usr/local/zabbix-proxy/ --prefix /usr/local/zabbix-proxy/ --after-install /home/mds/after-install.sh --after-remove /home/mds/after-remove.sh
create database zabbixproxy character set utf8 collate utf8_bin;
grant all privileges on zabbixproxy.* to zabbixproxy@'127.0.0.1' identified by 'zabbixproxy';
set names utf8;
use zabbixproxy;
source /root/zabbix-4.2.8/database/mysql/schema.sql
|