标签:数据表 environ pat 技术 char zone 授权 选择 data
一.zabbix监控安装配置实现对本机的监控监控端ip 192.168.1.11
被监控端ip 192.168.1.12
root@ubuntu1804:~# wget https://repo.zabbix.com/zabbix/4.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_4.0-2+bionic_all.deb
root@ubuntu1804:~# dpkg -i zabbix-release_4.0-2+bionic_all.deb
root@ubuntu1804:~#apt update
root@ubuntu1804:~# apt -y install zabbix-server-mysql zabbix-frontend-php zabbix-agent
mysql> create database zabbix character set utf8 collate utf8_bin; #创建一个zabbix数据库
mysql> grant all privileges on zabbix.* to zabbix@192.168.1.11 identified by ‘zabbix‘; #创建一个zabbix授权用户
mysql> quit;
root@ubuntu1804:/data# zcat /usr/share/doc/zabbix-server-mysql/create.sql.gz | mysql -uzabbix -pzabbix -h192.168.1.11 zabbix
root@ubuntu1804:/data# grep "127.0.0.1" /etc/mysql/ -R
/etc/mysql/mariadb.conf.d/50-server.cnf:bind-address = 127.0.0.1
root@ubuntu1804:~# sed -i "s/127.0.0.1/192.168.1.11/" /etc/mysql/mariadb.conf.d/50-server.cnf
root@ubuntu1804:~#vim /etc/zabbix/zabbix_server.conf
……
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
DBHost=192.168.1.11
……
root@ubuntu1804:~# ph
phar phar7.2 phar.phar phar.phar7.2 php php7.2 phpdismod phpenmod phpquery
root@ubuntu1804:~#vim etc/zabbix/apache.conf
php_value date.timezone Asia/Shanghai
root@ubuntu1804:~#systemctl restart zabbix-server zabbix-agent apache2
root@ubuntu1804:~#systemctl enable zabbix-server zabbix-agent apache2
/usr/share/zabbix/conf/zabbix.conf.php 为前端连接数据库的信息的路径,后期需要更改可以直接在此文件更改
root@ubuntu1804:~# apt-get install language-pack-zh*
root@ubuntu1804:~# vim /etc/environment
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
LANG="zh_CN.UTF-8"
LANGUAGE="zh_CN:zh:en_US:en"
root@ubuntu1804:~# dpkg-reconfigure locales
root@ubuntu1804:~#vim /usr/share/zabbix/include/defines.inc.php
root@ubuntu1804:~# find /usr/share/ -name graphfont*
/usr/share/zabbix/assets/fonts/graphfont.tt
注意此字体不可商用
root@ubuntu1804:/usr/share/zabbix/assets/fonts# ls
graphfont.ttf STSONG.ttf
root@ubuntu1804:/usr/share/zabbix/include# vim defines.inc.php
……
define(‘ZBX_GRAPH_FONT_NAME‘, ‘STSONG‘); // font file name
……
define(‘ZBX_FONT_NAME‘, ‘STSONG‘);
……
root@ubuntu1804:~# apt install zabbix-agent -y
root@ubuntu1804:~# systemctl start zabbix-agent
root@ubuntu1804:~# vim /etc/zabbix/zabbix_agentd.conf
……
Server=192.168.1.11 #改为监控此主机的服务主机的ip
Hostname=192.168.1.12 #本机的主机名,为了方便区分直接使用本机的ip地址
root@ubuntu1804:~# systemctl restart zabbix-agent
监控端ip 192.168.1.14
被监控端tomcat服务ip 192.168.1.13
root@ubuntu1804:~# apt install zabbix-java-gateway -y
vim /etc/zabbix/zabbix_java_gateway.conf
LISTEN_IP="192.168.1.14"
LISTEN_PORT=10052
START_POLLERS=10
TIMEOUT=30
vim /etc/zabbix/zabbix_server.conf
JavaGateway=192.168.1.14
JavaGatewayPort=10052
StartJavaPollers=20
Timeout=30
systemctl restart zabbix-java-gateway
systemctl restart zabbix-server
systemctl zabbix-agent apache2
root@ubuntu1804:~# ls /data/
apache-tomcat-8.5.42.tar.gz jdk-8u211-linux-x64.tar.gz
root@ubuntu1804:/data# tar xvf apache-tomcat-8.5.42.tar.gz -C /app/
root@ubuntu1804:/data# tar xvf jdk-8u211-linux-x64.tar.gz -C /app/
root@ubuntu1804:/app# ln -sv apache-tomcat-8.5.42 tomcat
root@ubuntu1804:/app# ln -sv jdk1.8.0_211 jdk
root@ubuntu1804:~# vim /etc/profile
export JAVA_HOME=/app/jdk
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=$JAVA_HOME/lib/:$JRE_HOME/lib
export TOMCAT_HOME=/app/tomcat
export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin:$TOMCAT_HOME/bin
root@ubuntu1804:~#source /etc/profile
root@ubuntu1804:~# vim /app/tomcat/bin/catalina.sh
……
# use nohup so that the Tomcat process will ignore any hangup
# signals. Default is "false" unless running on HP-UX in which
# case the default is "true"
# -----------------------------------------------------------------------------
CATALINA_OPTS="$CATALINA_OPTS
-Dcom.sun.management.jmxremote #启动远程连接
-Dcom.sun.management.jmxremote.port=12345 #默认穷=启动端口
-Dcom.sun.management.jmxremote.authenticate=false #不使用用户连接密码
-Dcom.sun.management.jmxremote.ssl=false #不是用ssl认证
-Djava.rmi.server.hostname=192.168.1.13" #指定为本地主机的ip
…….
root@ubuntu1804:~# catalina.sh start
root@ubuntu1804:~# ss -tnlp
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 1 [::ffff:127.0.0.1]:8005 *:*
users:(("java",pid=5862,fd=78))
LISTEN 0 100 *:8009 *:*
users:(("java",pid=5862,fd=57))
LISTEN 0 100 *:8080 *:*
users:(("java",pid=5862,fd=53))
ISTEN 0 50 *:12345 *:*
users:(("java",pid=5862,fd=20))
标签:数据表 environ pat 技术 char zone 授权 选择 data
原文地址:https://blog.51cto.com/14234542/2420180