zabbix 之安装采坑记

很久没有安装过zabbix,理论上应该是很简单,但是还是遇到好几个小问题,导致浪费了两个小时时间了要,特此记录一下

yum install php php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof php-bcmath php-ldap php-gd*
cat /etc/php.ini  |grep -v ‘^;‘|grep -v ‘^$‘
[PHP]
engine = On
short_open_tag = Off
asp_tags = Off
precision = 14
output_buffering = 4096
zlib.output_compression = Off
implicit_flush = Off
unserialize_callback_func =
serialize_precision = 17
disable_functions =
disable_classes =
zend.enable_gc = On
expose_php = On
max_execution_time = 300
max_input_time = 300
memory_limit = 1024M
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
display_errors = Off
display_startup_errors = Off
log_errors = On
log_errors_max_len = 1024
ignore_repeated_errors = Off
ignore_repeated_source = Off
report_memleaks = On
track_errors = Off
html_errors = On
variables_order = "GPCS"
request_order = "GP"
register_argc_argv = Off
auto_globals_jit = On
post_max_size = 16M
auto_prepend_file =
auto_append_file =
default_mimetype = "text/html"
default_charset = "UTF-8"
always_populate_raw_post_data = -1
doc_root =
user_dir =
enable_dl = Off
file_uploads = On
upload_max_filesize = 20M
max_file_uploads = 20
allow_url_fopen = On
allow_url_include = Off
default_socket_timeout = 60
[CLI Server]
cli_server.color = On
[Date]
date.timezone =PRC
[filter]
[iconv]
[intl]
[sqlite]
[sqlite3]
[Pcre]
[Pdo]
[Pdo_mysql]
pdo_mysql.cache_size = 2000
pdo_mysql.default_socket=
[Phar]
[mail function]
sendmail_path = /usr/sbin/sendmail -t -i
mail.add_x_header = On
[SQL]
sql.safe_mode = Off
[ODBC]
odbc.allow_persistent = On
odbc.check_persistent = On
odbc.max_persistent = -1
odbc.max_links = -1
odbc.defaultlrl = 4096
odbc.defaultbinmode = 1
[Interbase]
ibase.allow_persistent = 1
ibase.max_persistent = -1
ibase.max_links = -1
ibase.timestampformat = "%Y-%m-%d %H:%M:%S"
ibase.dateformat = "%Y-%m-%d"
ibase.timeformat = "%H:%M:%S"
[MySQL]
mysql.allow_local_infile = On
mysql.allow_persistent = On
mysql.cache_size = 2000
mysql.max_persistent = -1
mysql.max_links = -1
mysql.default_port =
mysql.default_socket =
mysql.default_host =
mysql.default_user =
mysql.default_password =
mysql.connect_timeout = 60
mysql.trace_mode = Off
[MySQLi]
mysqli.max_persistent = -1
mysqli.allow_persistent = On
mysqli.max_links = -1
mysqli.cache_size = 2000
mysqli.default_port = 3306
mysqli.default_socket =
mysqli.default_host =
mysqli.default_user =
mysqli.default_pw =
mysqli.reconnect = Off
[mysqlnd]
mysqlnd.collect_statistics = On
mysqlnd.collect_memory_statistics = Off
[OCI8]
[PostgreSQL]
pgsql.allow_persistent = On
pgsql.auto_reset_persistent = Off
pgsql.max_persistent = -1
pgsql.max_links = -1
pgsql.ignore_notice = 0
pgsql.log_notice = 0
[Sybase-CT]
sybct.allow_persistent = On
sybct.max_persistent = -1
sybct.max_links = -1
sybct.min_server_severity = 10
sybct.min_client_severity = 10
[bcmath]
bcmath.scale = 0
[browscap]
[Session]
session.save_handler = files
session.use_strict_mode = 0
session.use_cookies = 1
session.use_only_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.cookie_httponly =
session.serialize_handler = php
session.gc_probability = 1
session.gc_divisor = 1000
session.gc_maxlifetime = 1440
session.referer_check =
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0
session.hash_function = 0
session.hash_bits_per_character = 5
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"
[MSSQL]
mssql.allow_persistent = On
mssql.max_persistent = -1
mssql.max_links = -1
mssql.min_error_severity = 10
mssql.min_message_severity = 10
mssql.compatibility_mode = Off
mssql.secure_connection = Off
[Assertion]
[mbstring]
mbstring.func_overload = 0
[gd]
[exif]
[Tidy]
tidy.clean_output = Off
[soap]
soap.wsdl_cache_enabled=1
soap.wsdl_cache_dir="/tmp"
soap.wsdl_cache_ttl=86400
soap.wsdl_cache_limit = 5
[sysvshm]
[ldap]
ldap.max_links = -1
[mcrypt]
[dba]
[curl]
[openssl]

  

  • zabbix的编译参数参考
./configure --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2 --prefix=/home/work/zabbix --with-ldap
  • error: Invalid Net-SNMP directory - unable to find net-snmp-config
yum -y install net-snmp-devel
  • zabbix server 的启动脚本
#!/bin/bash
#
#       /etc/rc.d/init.d/zabbix_server
#
# Starts the zabbix_server daemon
#
# chkconfig: - 95 5
# description: Zabbix Monitoring Server
# processname: zabbix_server
# pidfile: /tmp/zabbix_server.pid

# Modified for Zabbix 2.0.0
# May 2012, Zabbix SIA

# Source function library.

. /etc/init.d/functions

RETVAL=0
prog="Zabbix Server"
ZABBIX_BIN="/home/work/zabbix/sbin/zabbix_server"

if [ ! -x ${ZABBIX_BIN} ] ; then
        echo -n "${ZABBIX_BIN} not installed! "
        # Tell the user this has skipped
        exit 5
fi

start() {
        echo -n $"Starting $prog: "
        daemon $ZABBIX_BIN
        RETVAL=$?
        [ $RETVAL -eq 0 ] && touch /home/work/zabbix/lock/subsys/zabbix_server
        echo
}

stop() {
        echo -n $"Stopping $prog: "
        killproc $ZABBIX_BIN
        RETVAL=$?
        [ $RETVAL -eq 0 ] && rm -f /home/work/zabbix/lock/subsys/zabbix_server
        echo
}

case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  reload|restart)
        stop
        sleep 10
        start
        RETVAL=$?
        ;;
  condrestart)
        if [ -f /home/work/zabbix/lock/subsys/zabbix_server ]; then
            stop
            start
        fi
        ;;
  status)
        status $ZABBIX_BIN
        RETVAL=$?
        ;;
  *)
        echo $"Usage: $0 {condrestart|start|stop|restart|reload|status}"
        exit 1
esac

exit $RETVAL
  • zabbix_agent 启动脚本
#!/bin/bash
#
#       /etc/rc.d/init.d/zabbix_agentd
#
# Starts the zabbix_agentd daemon
#
# chkconfig: - 95 5
# description: Zabbix Monitoring Agent
# processname: zabbix_agentd
# pidfile: /tmp/zabbix_agentd.pid

# Modified for Zabbix 2.0.0
# May 2012, Zabbix SIA

# Source function library.

. /etc/init.d/functions

RETVAL=0
prog="Zabbix Agent"
ZABBIX_BIN="/home/work/zabbix/sbin/zabbix_agentd"

if [ ! -x ${ZABBIX_BIN} ] ; then
        echo -n "${ZABBIX_BIN} not installed! "
        # Tell the user this has skipped
        exit 5
fi

start() {
        echo -n $"Starting $prog: "
        daemon $ZABBIX_BIN
        RETVAL=$?
        [ $RETVAL -eq 0 ] && touch /home/work/zabbix/lock/subsys/zabbix_agentd
        echo
}

stop() {
        echo -n $"Stopping $prog: "
        killproc $ZABBIX_BIN
        RETVAL=$?
        [ $RETVAL -eq 0 ] && rm -f /home/work/zabbix/lock/subsys/zabbix_agentd
        echo
}

case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  reload|restart)
        stop
        sleep 3
        start
        RETVAL=$?
        ;;
  condrestart)
        if [ -f /home/work/zabbix/lock/subsys/zabbix_agentd ]; then
            stop
            start
        fi
        ;;
  status)
        status $ZABBIX_BIN
        RETVAL=$?
        ;;
  *)
        echo $"Usage: $0 {condrestart|start|stop|restart|reload|status}"
        exit 1
esac

exit $RETVAL
  • zabbix_server 启动后,进程在,但是没有监听端口
# 解决方法 配置文件里面增加数据库的配置信息

# 参考配置文件

LogFile=/home/work/zabbix/logs/zabbix_server.log
PidFile=/home/work/zabbix/logs/zabbix_server.pid

DBHost=172.30.0.17
DBPort=3001
DBName=zabbix
DBUser=zabbix
DBPassword=password

StartPollers=30
StartDiscoverers=80
CacheSize=1024M
HistoryCacheSize=100M
HistoryIndexCacheSize=40M
TrendCacheSize=1G
ValueCacheSize=800M
Timeout=4
AlertScriptsPath=/home/work/zabbix/alertscripts
LogSlowQueries=3000
User=work
  • Unsupported charset or collation for tables  zabbix  安装

出现这个原因是因为创建的数据库的字符集设置有问题,一定要参考官方的创建数据库的指令创建

官网地址: https://www.zabbix.com/documentation/4.0/manual/appendix/install/db_scripts

shell> mysql -uroot -p<password>
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> create user ‘zabbix‘@‘localhost‘ identified by ‘<password>‘;
mysql> grant all privileges on zabbix.* to ‘zabbix‘@‘localhost‘;
mysql> quit;

原文地址:https://www.cnblogs.com/topicjie/p/12540224.html

时间: 2024-10-12 02:39:04

zabbix 之安装采坑记的相关文章

websocket采坑记

项目中想用做个实时统计,像是110警情大屏那种,所以用到了websocket,结果踩了不少坑,再次记录下. 环境:spring,springMVC(4.2.4.RELEASE),tomcat7 问题1:session对象是不一样的 http的时候,是javax.servlet.http.HttpSession 而websocket的时候javax.websocket.Session http的session一般用于保存用户信息,根据用户,http请求的时候携带Cookie:JSESSIONID,

github 采坑记 —— 项目提交到github后部分文件缺失

在使用git push到GitHub上后,发现部分文件缺失,如下图所示: 可以看到dist文件夹为 运行 npm run build 之后打包生成的文件,node_modules 文件也是缺失的 导致文件没有提交的原因是在项目根目录下有个文件: 打开文件: 可以看再提交时有些文件被忽略了,可以将相应代码删除,然后重新push到GitHub上 想要的文件就提交上去了! 多多采坑,多多总结,多多练习~~~ 原文地址:https://www.cnblogs.com/amy2017/p/10087455

oracle11g数据库安装采坑记录

第一处坑: 解决方案: 原文:https://blog.csdn.net/yhj198927/article/details/49178279 1.打开oracle的"Net Manager" 2.打开"监听程序" 3.打开"数据库服务" 4.点击"添加数据库" 5.填写相关信息 "全局数据库名"和"SID"填写在"Database Configuration Assitant

分布式TensorFlow 采坑记

单机版的TF没毛病,但是当大家在Tensorflow Github里面找到可用的模型,想分布式跑到时候,就会跑出来各种奇怪的问题.我尝试了几种不同构造TF的方式,算是成功渡过了踩坑期,特别记录一下.如果能帮助到各位TF boy最好. 方法一:自己手动写分布式协议 比如logistic regression 在master上运行的伪代码如下 with tf.Session('grpc://vm1:2222') as sess: sess.run(initialization) while not

aidl使用采坑记

什么是AIDL? AIDL是 Android Interface definition language的缩写,它是一种Android内部进程通信接口的描述语言,通过它我们可以定义进程间的通信接口 AIDL可以解决什么问题? 可以实现多个应用程序共享同一个Service的功能,比如:IM服务可以提供给多个APP使用,先在推送基本都是采取这种方案 可以跨进程调用服务里的方法 搭建了简单的Service框架 1.继承Service public class PushService extends S

AWS Redshift 采坑记

1.不要使用快速启动集群的方式建立,否则vpc是一个巨坑 2.要配置对应的Role 并配置化 role arn 原文地址:https://www.cnblogs.com/Johnson-zhao/p/10758126.html

tensorflow 2.1 采坑记

tf 2.1 安装了好多遍,把python 从3.6 搞到了3.7还是没办法安装成功 问题出在这里 要使用这些新软件包,用户必须安装「Microsoft Visual C ++ Redistributable for Visual Studio 2015.2017 和 2019」,下载地址传送:https://support.microsoft.com/zh-cn/help/2977003/the-latest-supported-visual-c-downloads. 原文地址:https:/

xlearn 安装采坑记录---由内核版本过低导致的问题

最近做项目想用下 xlearn,在自己的mac本上,已经安装了gcc9.1.0和cmake3.14.1,直接 pip install xlearn 就安装成功了,但是在一台centos6.6,内核版本为 2.6.32-754.6.3.el6.x86_64(使用unname -r 查看)的服务器上总是报各种问题.我把报出的问题都逐一去网上搜索,还是有解决方案的,但是按照人家说的改之后还是不行,主要是因为内核版本过低,一些包库(如glib14)安装不上导致的,换了一台系统为centos7.2,内核版

php7采坑记:浮点型数据比较

今天在项目中遇到一个奇怪的问题,经过计算后的double类型的变量的值相等的两个变量进行比较,结果却是不相等. <?php $a=42735.04; $b=17806.2; $c=$a/36; $c=round($c,2); $d=$c*15; echo '$b value is: '. $b ."\n"; echo '$d value is: '. $d ."\n"; if($b == $d){     echo "ok\n"; }els