整理日期: 2019年11月13
2015-9-25
【Zabbix】是一个高度集成的网络监控套件,通过一个软件包即可提供如下特性
数据收集 、可用性及性能检测、支持SNMP(trapping及polling)、IPMI、JMX监控、自定义检测、自定义间隔收集收据、server/proxy/agents吸能
【Zabbix API】
Zabbix API提供程序级别的访问接口,第三方程序可以很快接入
zabbix API请求和响应都是json,并且还提供了各种语法的lib库,http://zabbix.org/wiki/Docs/api/libraries,
包含php、c#、Python、Perl、go等等语言,简单看了下phpzabbixapi,使用非常方便
http://www.ttlsa.com/zabbix/zabbix-dev-api/
【进程介绍】
zabbix_agentd
客户端守护进程,此进程收集客户端数据,例如cpu负载、内存、硬盘使用情况等
zabbix_get
zabbix工具,单独使用的命令,通常在server或者proxy端执行获取远程客户端信息的命令。通常用户排错。例如在server端获取不到客户端的内存数据,我们可以使用zabbix_get获取客户端的内容的方式来做故障排查。
zabbix_sender
zabbix工具,用于发送数据给server或者proxy,通常用于耗时比较长的检查。很多检查非常耗时间,导致zabbix超时。于是我们在脚本执行完毕之后,使用sender主动提交数据。
zabbix_server
zabbix服务端守护进程。zabbix_agentd、zabbix_get、zabbix_sender、zabbix_proxy、zabbix_java_gateway的数据最终都是提交到server
备注:当然不是数据都是主动提交给zabbix_server,也有的是server主动去取数据。
zabbix_proxy
zabbix代理守护进程。功能类似server,唯一不同的是它只是一个中转站,它需要把收集到的数据提交/被提交到server里。为什么要用代理?代理是做什么的?卖个关子,请继续关注运维生存时间zabbix教程系列。
zabbix_java_gateway
zabbix2.0之后引入的一个功能。顾名思义:Java网关,类似agentd,但是只用于Java方面。需要特别注意的是,它只能主动去获取数据,而不能被动获取数据。它的数据最终会给到server或者proxy。
【时间同步】
最重要的一点在最后提,请确保你所有的服务器时间都是正确的,为了确保时间ok,请在crontab里面加上定时时间同步。
#crontab -l
00 00 * * * /usr/sbin/ntpdate -u 195.13.1.153
PHP Warning: date(): It is not safe to rely on the system’s timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still gett
ing this warning, you most likely misspelled the timezone identifier. We selected ‘Asia/Chongqing’ for ‘CST/8.0/no DST’ instead in /data0/htdocs/www.qttc.net/function/function.php on line 542
1)
rm -rf /etc/localtime
ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
2)
在vi /etc/php.ini里找到date.timezone这行,把值改成Asia/Shanghai
【COPY虚拟机会导致的两个错误】
A:PHP Warning: date(): It is not safe to rely on the system’s timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still gett
ing this warning, you most likely misspelled the timezone identifier. We selected ‘Asia/Chongqing’ for ‘CST/8.0/no DST’ instead in /data0/htdocs/www.qttc.net/function/function.php on line 542
Q:需要重新配置时间
1)
rm -rf /etc/localtime
ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
2)
在vi /etc/php.ini里找到date.timezone这行,把值改成Asia/Shanghai
A:提示Another MySQL daemon already running with the same unix socket错误
Q:出现这个错误表示多个Mysql进程使用了同一个socket,执行以下命令解决:
[root@localhost ehang]# mv /var/lib/mysql/mysql.sock /var/lib/mysql/mysql.sock.bak
[root@localhost ehang]# service mysqld start
【安装Zabbix】
http://repo.zabbix.com/zabbix/2.2/rhel/6/i386/
http://www.ttlsa.com/zabbix/install-zabbix-on-linux-5-ttlsa/
【zabbix加载扩展模块 第三方库支持】
http://www.ttlsa.com/zabbix/zabbix-loadable-modules/
【zabbix windows性能计数器使用详解】
http://www.ttlsa.com/zabbix/zabbix-monitor-windows/
【zabbix客户端自动注册】
http://www.ttlsa.com/zabbix/zabbix-active-agent-auto-registration/
【zabbix snmp类型 无需安装agent也能监控】
http://www.ttlsa.com/zabbix/zabbix-snmp-agent/
【SNMP OID列表 监控需要用到的OID】
http://www.ttlsa.com/monitor/snmp-oid/
【zabbix proxy分布式监控配置】
http://www.ttlsa.com/zabbix/zabbix-proxy-proxies/
【zabbix自定义图表Graph】
http://www.ttlsa.com/zabbix/zabbix-custom-graph/
2015-10-9
【基于net-snmp的代理agent开发详解】
http://blog.csdn.net/shanzhizi/article/details/11769491
2015-10-13
所需安装包来自:http://rpm.pbone.net
【图文讲解zabbix安装全过程】
http://www.ttlsa.com/zabbix/install-zabbix-on-linux-5-ttlsa/
【nginx安装(1) – ttlsa教程系列之nginx】
Nginx (“engine x”) 是一个高性能的 HTTP 和 反向代理 服务器,也是一个 IMAP/POP3/SMTP 服务器
http://www.ttlsa.com/nginx/nginx-install-on-linux/
【安装步骤】
第一步:检查pcre和openssl
[root@localhost ~]# rpm -qa |grep pcre
[root@localhost ~]# rpm -qa |grep openssl
系统自带:pcre-7.8-6.el6.i686 、 openssl-1.0.1e-15.el6.i686
第二步:下载并安装nginx-1.9.1
http://rpm.pbone.net/index.php3/stat/26/dist/46/size/929702/name/nginx-1.9.1-1.1.src.rpm
#rpm -ivh nginx-1.9.1-1.1.src.rpm --force --nodeps --nosignature
[root@localhost home]# find / -name nginx*
/home/ehang/zabbix/install_pkg/nginx-1.9.1-1.1.src.rpm
/root/rpmbuild/SPECS/nginx.spec
/root/rpmbuild/SOURCES/nginx-1.2.4-perl_vendor_install.patch
/root/rpmbuild/SOURCES/nginx-0.4.0-no_Werror.patch
/root/rpmbuild/SOURCES/nginx-1.5.4_default_config.patch
/root/rpmbuild/SOURCES/nginx.init
/root/rpmbuild/SOURCES/nginx-1.9.1.tar.gz
/root/rpmbuild/SOURCES/nginx_uploadprogress_module-0.9.0.tar.gz
/root/rpmbuild/SOURCES/nginx-1.0.15_docs.patch
/root/rpmbuild/SOURCES/nginx-0.6.38-html.patch
/root/rpmbuild/SOURCES/nginx.logrotate
/root/rpmbuild/SOURCES/nginx.service
#./configure --prefix=/usr/local/nginx-1.9.1 --with-http_ssl_module --with-http_spdy_module --with-http_stub_status_module --with-pcre
发现缺少pcre库和openssl库:
http://rpm.pbone.net/index.php3/stat/4/idpl/27821080/dir/centos_6/com/pcre-devel-7.8-6.el6.i686.rpm.html
#rpm -ivh pcre-devel-7.8-6.el6.i686.rpm --force --nodeps --nosignature
http://rpm.pbone.net/index.php3?stat=26&dist=74&size=1218684&name=openssl-devel-1.0.1e-15.el6.i686.rpm
#rpm -ivh openssl-devel-1.0.1e-15.el6.i686.rpm --force --nodeps --nosignature
发现缺少zlib库:
http://rpm.pbone.net/index.php3?stat=26&dist=74&size=44100&name=zlib-devel-1.2.3-29.el6.i686.rpm
#rpm -ivh zlib-devel-1.2.3-29.el6.i686.rpm --force --nodeps --nosignature
#./configure --prefix=/usr/local/nginx-1.9.1 --with-http_ssl_module --with-http_spdy_module --with-http_stub_status_module --with-pcre
总是提示找不到openssl库,问下百度吧:
部署新环境:编译nginx1.0.6:
http://genggeng.iteye.com/blog/1182062
原来是要下载openssl开发包:http://www.openssl.org/source/openssl-1.0.1e.tar.gz
./configure --prefix=/usr/local/nginx-1.9.1 --with-http_ssl_module --with-http_spdy_module --with-http_stub_status_module --with-pcre --with-openssl=…/…/openssl-1.0.1e
Configuration summary
nginx path prefix: “/usr/local/nginx-1.9.1”
nginx binary file: “/usr/local/nginx-1.9.1/sbin/nginx”
nginx configuration prefix: “/usr/local/nginx-1.9.1/conf”
nginx configuration file: “/usr/local/nginx-1.9.1/conf/nginx.conf”
nginx pid file: “/usr/local/nginx-1.9.1/logs/nginx.pid”
nginx error log file: “/usr/local/nginx-1.9.1/logs/error.log”
nginx http access log file: “/usr/local/nginx-1.9.1/logs/access.log”
nginx http client request body temporary files: “client_body_temp”
nginx http proxy temporary files: “proxy_temp”
nginx http fastcgi temporary files: “fastcgi_temp”
nginx http uwsgi temporary files: “uwsgi_temp”
nginx http scgi temporary files: “scgi_temp”
#make
#make install
到此,nginx安装结束。
启动
#/usr/local/nginx-1.9.1/sbin/nginx
#curl -s http://localhost | grep nginx.com
nginx.com.
第三步:PHP安装+NGINX配置
http://php.net/get/php-5.5.30.tar.gz/from/a/mirror
./configure --prefix=/usr/local/php-5.5.30 --with-config-file-path=/usr/local/php-5.5.30/etc --with-bz2
配置上网:
#vi /etc/sysconfig/network-scripts/ifcfg-eth0
DRIVES=eth0
ONBOOT=yes
#BOOTPROTROL=dhcp
BOOTPROTROL=none
IPADDR=(你需要配置的ip地址)
NETMASK=(掩码)
GATEWAY=( 网关)
DNS1=114.114.114.114
DNS2=10.10.0.254
#vi /etc/sysconfig/network
GATEWAY=( 网关)
#vi /etc/resolv.conf
nameserver 10.10.0.254 #主DNS
nameserver 10.10.0.1 #次DNS
search localdomain
然后services network restart就可以了.
52:54:00:ed:69:66
配置yum
#vi /etc/yum.conf
[main]
exclude=kernel* filesystem
[base]
name=Fedora Core $releasever - KaTeX parse error: Expected 'EOF', got '#' at position 17: …asearch - Base #̲baseurl=http://…releasever/$basearch/os/
baseurl=http://ftp.cdpa.nsysu.edu.tw/Linux/Fedora/linux/releases/22/Everything/i386/os/
[updates-released]
name=Fedora Core $releasever - KaTeX parse error: Expected 'EOF', got '#' at position 29: …leased Updates #̲baseurl=http://…releasever/$basearch/
baseurl=http://ftp.cdpa.nsysu.edu.tw/Linux/Fedora/linux/updates/22/i386/
#yum install gcc make gd-devel libjpeg-devel libpng-devel libxml2-devel bzip2-devel libcurl-devel -y
#yum install -y gcc make gd-devel libjpeg-devel libpng-devel libxml2-devel bzip2-devel libcurl-devel
[解决] yum search/intall, Error: xz compression not available
#yum remove epel-release
#rm -rf /var/cache/yum/x86_64/6Server/epel/
#rpm -ivh epel-release-6-8.noarch.rpm --force --nodeps --nosignature
#rpm -ivh pyliblzma-0.5.3-3.el6.i686.rpm --force --nodeps --nosignature
#rpm -ivh dracut-kernel-004-356.el6.noarch.rpm --force --nodeps --nosignature
必须执行,否者会导致内存错误MemoryError
#yum makecache
yum配置成功,并成功执行:
#yum install -y gd-devel libjpeg-devel libpng-devel libxml2-devel bzip2-devel libcurl-devel --skip-broken
编译安装PHP 5.5.30
以下参数支持,ftp,图片函数,pdo等支持,因为使用了php自带的mysqlnd,所以不需要额外安装mysql的lib库了.如果你是64位系统,参数后面加上–with-libdir=lib64,如果不是可以跳过。
#./configure --prefix=/usr/local/php-5.5.0 --with-config-file-path=/usr/local/php-5.5.0/etc --with-bz2 --with-curl --enable-ftp --enable-sockets --disable-ipv6 --with-gd --with-jpeg-dir=/usr/local --with-png-dir=/usr/local --with-freetype-dir=/usr/local --enable-gd-native-ttf --with-iconv-dir=/usr/local --enable-mbstring --enable-calendar --with-gettext --with-libxml-dir=/usr/local --with-zlib --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --with-mysql=mysqlnd --enable-dom --enable-xml --enable-fpm
#make
#make install
yum install -y libxml2-devel --skip-broken 安装不成功,然后自己下载安装
#rpm -ivh libxml2-devel-2.7.6-14.el6_5.2.i686.rpm --force --nodeps --nosignature
#rpm -ivh bzip2-devel-1.0.6-14.fc21.i686.rpm --force --nodeps --nosignature
#rpm -ivh libbz2-devel-1.0.6-14.1.4.i586.rpm --force --nodeps --nosignature
#rpm -ivh libcurl-devel-7.19.7-37.el6_4.i686.rpm --force --nodeps --nosignature
#rpm -ivh libjpeg-turbo-devel-1.2.1-1.el6.i686.rpm --force --nodeps --nosignature
#rpm -ivh libpng-devel-1.2.49-1.el6_2.i686.rpm --force --nodeps --nosignature
#rpm -ivh freetype-devel-2.3.11-14.el6_3.1.i686.rpm --force --nodeps --nosignature
重新执行PHP安装,到此PHP安装成功
cp php.ini-production /usr/local/php-5.5.0/etc/php.ini
cp /usr/local/php-5.5.0/etc/php-fpm.conf.default /usr/local/php-5.5.0/etc/php-fpm.conf
/usr/local/php-5.5.0/sbin/php-fpm
netstat -lnt | grep 9000
开始配置nginx
配置测试站点test.ttlsa.com
mkdir /data/logs/nginx/ # 用于存放nginx日志.请看2.3的配置文件
mkdir -p /data/site/test.ehang.com/ # 站点根目录
vim /data/site/test.ehang.com/info.php
nginx配置
vi /usr/local/nginx-1.9.1/conf/nginx.conf
在nginx.conf的http断中加上如下内容:
server {
listen 80;
server_name wendt.com;
access_log /data/logs/nginx/wendt.com.access.log main;
index index.php index.html index.html;
root /data/site/wendt.com;
location /
{
try_files $uri $uri/ /index.php?$args;
}
location ~ .*\.(php)?$
{
expires -1s;
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
#fastcgi_pass 127.0.0.1:9000;
fastcgi_pass unix:/var/run/phpfpm.sock;
}
}
#/usr/local/nginx-1.9.1/sbin/nginx
#curl http://wendt.com/info.php
安装MYSQL:
#yum install -y autoconf automake imake libxml2-devel expat-devel cmake gcc gcc-c++ libaio libaio-devel bzr bison libtool ncurses5-devel --enablerepo=rpmforge-extras
第三步:zabbix安装包下载:
http://repo.zabbix.com/zabbix/2.2/rhel/6/i386/
https://www.zabbix.com/documentation/2.2/manual/installation/requirements
mount -t iso9660 /dev/cdrom /mnt/cdrom
rpm -ivh php-bcmath-5.3.3-26.el6.i686.rpm --force --nodeps --nosignature
rpm -ivh php-mbstring-5.3.3-26.el6.i686.rpm --force --nodeps --nosignature
GRANT ALL PRIVILEGES ON zabbix.* TO zabbix@localhost IDENTIFIED BY 'zabbix' WITH GRANT OPTION;
mysql> grant all privileges on zabbix.* to zabbix@'%' identified;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
版本太低,需要升级至mysql 5.6
rpm -e mysql-server-5.1.71-1.el6.i686 --nodeps
rpm -e mysql-libs-5.1.71-1.el6.i686 --nodeps
rpm -e mysql-devel-5.1.71-1.el6.i686 --nodeps
rpm -e mysql-5.1.71-1.el6.i686 --nodeps
rpm -ivh MySQL-server-5.6.19-1.el6.i686.rpm
rpm -ivh MySQL-client-5.6.19-1.el6.i686.rpm
rpm -ivh MySQL-devel-5.6.19-1.el6.i686.rpm
#rpm -ivh MySQL-5.6.19-1.el6.src.rpm
mysqladmin -uroot password ehangcom
/usr/bin/mysql_upgrade -uroot -pehangcom --force
[root@localhost /]# rpm -qa|grep mysql
qt-mysql-4.6.2-26.el6_4.i686
mysql-libs-5.1.71-1.el6.i686
mysql-connector-odbc-5.1.5r1144-7.el6.i686
mysql-devel-5.1.71-1.el6.i686
mysql-5.1.71-1.el6.i686
mysql-server-5.1.71-1.el6.i686
yum update mysql --enablerepo=rpmforge-extras
ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock
ln -s /var/lib/mysql/mysql.sock /var/data/mysql.sock
ls -hltr mysql.sock
configure: error: Not found mysqlclient library
ln -s /usr/lib/mysql/libmysqlclient.a /usr/lib/libmysqlclient.a
ln -s /usr/lib/mysql/libmysqlclient_r.a /usr/lib/libmysqlclient_r.a
ln -s /usr/lib/mysql/libmysqlservices.a /usr/lib/libmysqlservices.a
rpm -e MySQL-server-5.6.19-1.el6.i686.rpm
rpm -e MySQL-client-5.6.19-1.el6.i686.rpm
rpm -e MySQL-devel-5.6.19-1.el6.i686.rpm
rm -f /var/lib/mysql/zabbix/*
service mysqld start
service mysqld stop
netstat -ntlp | grep 3306
/usr/bin/mysqladmin -u root password '12345678'
提示Another MySQL daemon already running with the same unix socket错误
[root@localhost ehang]# mv /var/lib/mysql/mysql.sock /var/lib/mysql/mysql.sock.bak
[root@localhost ehang]# service mysqld start
mysql> flush privileges;
ERROR 1033 (HY000): Incorrect information in file: ‘./mysql/tables_priv.frm’
解决办法:
rm -f /var/lib/mysql/mysql/*
drop database mysql;
mysql_install_db --user=mysql
```以上步骤失败,重装系统,完全安装linux.
================================
挂载WINDOWS共享目录中的ISO:
\10.10.18.65\SoftWare\linux_IOS
mkdir -p /mnt/win32
mkdir -p /mnt/rhel-dvd
mount -t cifs -o username=administrator,password=ehangcom@2008 //10.10.18.65/SoftWare/linux_IOS /mnt/win32
mount -o loop -t iso9660 /mnt/win32/rhel-server-6.5-i386-dvd.iso /mnt/rhel-dvd
vi /etc/yum.repos.d/rhel.repo
[Server]
enabled=1
name=Redhat
baseurl=file:///mnt/rhel-dvd/Server
gpgkey=file:///mnt/rhel-dvd/RPM-GPG-KEY-redhat-release
Zabbix配置安装具体实现详解
http://blog.itpub.net/47598/viewspace-1036837/
http://www.jb51.net/article/56970.htm
CentOS 6.4下Zabbix的安装配置
http://www.linuxidc.com/Linux/2014-07/104246.htm
mysql -uroot -pehangcom
zabbix数据库创建导入
mysql> drop database zabbix;
mysql> create database zabbix;
mysql> GRANT ALL PRIVILEGES ON zabbix.* TO zabbix@localhost IDENTIFIED BY 'zabbix' WITH GRANT OPTION;
mysql> flush privileges;
mysql> use zabbix;
mysql> source /home/ehang/zabbix-2.2.10/database/mysql/schema.sql
mysql> source /home/ehang/zabbix-2.2.10/database/mysql/data.sql
mysql> source /home/ehang/zabbix-2.2.10/database/mysql/images.sql
source /home/ehang/tmp/mysql/schema.sql
source /home/ehang/tmp/mysql/data.sql
source /home/ehang/tmp/mysql/images.sql
mysqldump -u root -p zabbix>/home/ehang/zabbix/db/ehang-zabbix-schema.sql
source /home/ehang/zabbix/db/ehang-zabbix-schema.sql
cd /home/ehang
tar zxvf zabbix-2.2.10.tar.gz
cd /home/ehang/zabbix-2.2.10
./configure --prefix=/home/ehang/zabbix --enable-server --enable-agent --enable-proxy --with-mysql --with-net-snmp --with-libcurl
#make && make install
groupadd zabbix
useradd zabbix -g zabbix -s /bin/false
修改zabbix配置文件:
vi /usr/local/zabbix/etc/zabbix_server.conf
DBName=zabbix #数据库名称
DBUser=root #数据库用户名
DBPassword=ehangcom #数据库密码
ListenIP=127.0.0.1 #数据库ip地址
AlertScriptsPath=/usr/local/zabbix/share/zabbix/alertscripts #zabbix运行脚本存放目录
vi /usr/local/zabbix/etc/zabbix_agentd.conf
Include=/usr/local/zabbix/etc/zabbix_agentd.conf.d/
UnsafeUserParameters=1 #启用自定义key
cp /home/ehang/zabbix/init.d/zabbix_server /etc/rc.d/init.d/zabbix_server
cp /home/ehang/zabbix/init.d/zabbix_agentd /etc/rc.d/init.d/zabbix_agentd
添加开机启动脚本:
#服务端
cp /home/ehang/zabbix-2.2.10/misc/init.d/fedora/core/zabbix_server /etc/rc.d/init.d/zabbix_server
#客户端
cp /home/ehang/zabbix-2.2.10/misc/init.d/fedora/core/zabbix_agentd /etc/rc.d/init.d/zabbix_agentd
chmod +x /etc/rc.d/init.d/zabbix_server #添加脚本执行权限
chmod +x /etc/rc.d/init.d/zabbix_agentd #添加脚本执行权限
chkconfig zabbix_server on #添加开机启动
chkconfig zabbix_agentd on #添加开机启动
修改zabbix开机启动脚本中的zabbix安装目录:
vi /etc/rc.d/init.d/zabbix_server #编辑服务端配置文件
BASEDIR=/usr/local/zabbix/ #zabbix安装目录
vi /etc/rc.d/init.d/zabbix_agentd #编辑客户端配置文件
BASEDIR=/usr/local/zabbix/ #zabbix安装目录
service zabbix_server start #启动zabbix服务端
service zabbix_server stop
service zabbix_agentd start #启动zabbix客户端
service zabbix_agentd stop
.提供zabbix的web文件
#mkdir -v /var/www/html/zabbix
#cp -rf /home/ehang/zabbix-2.2.10/frontends/php/* /var/www/html/zabbix
cp -a /var/www/html/zabbix /home/ehang/zabbix/wwwroot
cp -rf /home/ehang/zabbix-2.2.10/frontends/php/* /home/ehang/zabbix/wwwroot
yum install -y gd libjpeg libpng libxml2 bzip2 libcurl
yum install -y net-snmp-utils net-snmp-perl
在浏览器输入:http://10.10.18.112/zabbix
然后通过web页面继续配置zabbix
若页面上有错误的提示,则在/etc/php.ini修改对应的值就行
#vi /etc/php.ini
max_input_time = 600
max_execution_time = 300
date.timezone = Asia/Shanghai
post_max_size = 32M
memory_limit = 128M
===========================================================================================
修改WEB的链接数据库密码:
vi /var/www/html/zabbix/include/db.inc.php
$DB_TYPE =“MYSQL”;
$DB_SERVER =“localhost”;
$DB_DATABASE =“zabbix”;
$DB_USER =“root”;
$DB_PWD =“ehangcom”;
cd /var/www/html/zabbix/include
vi db.inc.php
添加如下内容,同时还要修改/var/www/html/zabbix/include/setup.inc.php同样加入下面的内容
$DB_TYPE=“MYSQL”;
$DB_SERVER=“localhost”;
$DB_DATABASE=“zabbix”;
$DB_USER=“root”;
$DB_PWD=“ehang”;
以上无用,必须通过下面的方式修改Web密码
[root@localhost ehang]# vi /home/ehang/zabbix/wwwroot/conf/zabbix.conf.php
===========================================================================================
查看端口:
#netstart -tnlp | grep 'zabbix'
停止zabbix服务:
#pkill zabbix
LAMP的优势
成本低廉,可定制、易于开发,方便易用、安全和稳定
ab命令(压力测试工具)
Apache Benchmark,Apache基准测试工具
格式:ab [-q] -c 并发请求数 -n 总的请求数 [http://]域名[:端口]/路径
应用示例:
[root@shuiyong ~]# ulimit -n 3600
[root@shuiyong ~]# cd /usr/local/apache2/bin/
[root@shuiyong bin]# ./ab -q -c 2000 -n 4000 http://www.linuxidc.com/
测试php,mysql和apache的连接
#编辑apache的主配置文件,使其支持php网页文件
[root@shuiyong ~]# vi /etc/httpd/conf/httpd.conf
DirectoryIndex index.php index.html index.html.var
#重新启动apache程序,即重启httpd服务
[root@shuiyong ~]# service httpd restart
vim /etc/httpd/conf/httpd.conf
1关闭SELINUX的方法:
vi /etc/selinux/config 将SELINUX=enforcing 改成SELINUX=disabled
需要重启
这个方法可能会对服务器带来风险。
2不关闭SELINUX的方法:
#setenforce 0
#chcon -c -v -R -u system_u -r object_r -t textrel_shlib_t /usr/local/apache/modules/libphp5.so
#service httpd restart
#setenforce 1
关闭防火墙
1) 重启后生效
开启: chkconfig iptables on
关闭: chkconfig iptables off
2) 即时生效,重启后失效
开启: service iptables start
关闭: service iptables stop
需要说明的是对于Linux下的其它服务都可以用以上命令执行开启和关闭操作。
在开启了防火墙时,做如下设置,开启相关端口,
修改/etc/sysconfig/iptables 文件,添加以下内容:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
提示 PHP databases support off Fail的解决办法:
yum install -y php-mysql
service mysqld restart
#systemctl restart mariadb.service
service httpd stop
service mysqld stop
service httpd start
service httpd restart
Finish 安装完成
更改zabbix默认语言为简体中文、替换监控图像上系统默认的中文字体
1、修改系统配置文件,让web页面支持简体中文显示
vi /var/www/html/zabbix/include/locales.inc.php #编辑修改
'zh_CN' => array('name' => _('Chinese (zh_CN)'), 'display' => false),
修改为
'zh_CN' => array('name' => _('Chinese (zh_CN)'), 'display' => true),
:wq! #保存退出
2、替换监控图像上系统默认的字体 #默认字体不支持中文,如果不替换,图像上会显示乱码
在Windows系统中的C:\Windows\Fonts目录中复制出一个中文字体文件,例如msyh.ttf
把字体文件msyh.ttf上传到zabbix站点根目录下fonts文件夹中
例如:/var/www/html/zabbix/fonts
备份默认的字体文件:DejaVusSans.ttf-bak
修改msyh.ttf名称为DejaVusSans.ttf
3、在浏览器中打开:
http://10.10.18.112/zabbix
账号:admin
密码:zabbix
Sign in 登录
Zabbix 发现功能中文文档
http://www.178linux.com/973
snmp安装配置 zabbix snmp监控准备
http://www.ttlsa.com/zabbix/zabbix-snmp-install/
#vim /etc/snmp/snmpd.conf
view systemview included .1.3.6.1.2.1.25.1.1 //找到这行,增加下面配置
view systemview included .1 // 这个是新增加的
proc mountd // 找到这些配置,把注释去掉
proc ntalkd 4
proc sendmail 10 1
disk / 10000
load 12 14 14
snmpget -v2c -c public -On 127.0.0.1 IF-MIB::ifNumber.0
snmpget -v2c -c public -On 127.0.0.1 .1.3.6.1.2.1.1.5.0
snmpget -c public -v 2c -On 127.0.0.1 .1.3.6.1.2.1.1.5.0
snmpwalk -c public -v 2c 127.0.0.1 .1.3.6.1.2.1.1.5.0
snmpget -v2c -c public -On 127.0.0.1 IF-MIB::ifNumber.0
snmpget -v2c -c public -On 10.10.18.112 SNMPv2-MIB::sysName.0
snmpwalk -c public -v 2c 127.0.0.1 .1.3.6.1.4.1.40001.1.1
snmpwalk -c public -v 2c 127.0.0.1 .1.3.6.1.4.1.40001.1.4
snmpget -v2c -c public -On 127.0.0.1 .1.3.6.1.4.1.40001.1.4.1.2.1
{$SNMP_COMMUNITY}
{KaTeX parse error: Expected 'EOF', got '}' at position 23: …VICE_UPDATETIME}̲ {SNMP_STATUS_UPDATETIME}
{KaTeX parse error: Expected 'EOF', got '}' at position 18: …ANG_MC_OID_HEAD}̲ = .1.3.6.1.4.1…EHANG_MCNO_OID_HEAD} = .1.3.6.1.4.1.40001.1.4.1.1
{KaTeX parse error: Expected 'EOF', got '}' at position 19: …NG_PRD_OID_HEAD}̲ = .1.3.6.1.4.1…EHANG_PRDNO_OID_HEAD} = .1.3.6.1.4.1.40001.1.5.4.1.1
mc
snmpwalk -c public -v 2c 127.0.0.1 .1.3.6.1.4.1.40001.1.4
snmpget -v2c -c public -On 127.0.0.1 CENTRALIZED-NETWORK-MANAGEMENT-MIB::mcNo.1
.1.3.6.1.4.1.40001.1.4.1.1.1 no
.1.3.6.1.4.1.40001.1.4.1.2.1 ip
.1.3.6.1.4.1.40001.1.4.1.3.1 port
.1.3.6.1.4.1.40001.1.4.1.4.1 status
.1.3.6.1.4.1.40001.1.5.1.0 prd num
prd
snmpwalk -c public -v 2c 127.0.0.1 .1.3.6.1.4.1.40001.1.5.4
snmpget -v2c -c public -On 127.0.0.1 .1.3.6.1.4.1.40001.1.5.1.0
.1.3.6.1.4.1.40001.1.5.4.1.1.1 no
.1.3.6.1.4.1.40001.1.5.4.1.2.1 ip
.1.3.6.1.4.1.40001.1.5.4.1.3.1 port
.1.3.6.1.4.1.40001.1.5.4.1.4.1 status
snmpget -v2c -c public -On 127.0.0.1 .1.3.6.1.4.1.40001.1.5.4.1.2.1
isx
snmpwalk -c public -v 2c 127.0.0.1 .1.3.6.1.4.1.40001.1.7.4
.1.3.6.1.4.1.40001.1.7.4.1.1.1 no
.1.3.6.1.4.1.40001.1.7.4.1.2.1 type
.1.3.6.1.4.1.40001.1.7.4.1.3.1 ip
.1.3.6.1.4.1.40001.1.7.4.1.4.1 port
.1.3.6.1.4.1.40001.1.7.4.1.5.1 status
sip
snmpwalk -c public -v 2c 127.0.0.1 .1.3.6.1.4.1.40001.1.7.8.3.6
.1.3.6.1.4.1.40001.1.7.8.3.6.1.1.1 no
.1.3.6.1.4.1.40001.1.7.8.3.6.1.2.1 HardWare Version
.1.3.6.1.4.1.40001.1.7.8.3.6.1.3.1 Branch Version
.1.3.6.1.4.1.40001.1.7.8.3.6.1.4.1 FirmWare Version
.1.3.6.1.4.1.40001.1.7.8.3.6.1.5.1 license
.1.3.6.1.4.1.40001.1.7.8.3.6.1.6.1 Serial number
.1.3.6.1.4.1.40001.1.7.8.3.6.1.7.1 SNTP ip
.1.3.6.1.4.1.40001.1.7.8.3.6.1.8.1 SNTP time interval
.1.3.6.1.4.1.40001.1.7.8.3.6.1.9.1 Net2IP
.1.3.6.1.4.1.40001.1.7.8.3.6.1.10.1 Net2IP NetMask
.1.3.6.1.4.1.40001.1.7.8.3.6.1.11.1 status
sip-stack 这个只能GET到第一个SIP板的栈, 无法获取第二块SIP板的栈,可能需要改ISXSNMP-PROXY
snmpwalk -c public -v 2c 127.0.0.1 .1.3.6.1.4.1.40001.1.7.8.3.7.4.1
.1.3.6.1.4.1.40001.1.7.8.3.7.4.1.1.1 no
.1.3.6.1.4.1.40001.1.7.8.3.7.4.1.2.1 status
dsp
snmpwalk -c public -v 2c 127.0.0.1 .1.3.6.1.4.1.40001.1.7.6.1.1
zabbix深入玩转51
http://3y.uu456.com/bp_8209c7yfy25ap1c1l9ky_1.html
netstat -ntlp | grep 10050
netstat -ntlp | grep 10051
netstat -ntulp | grep 161
使用SNMP工具能正常取值
C:\Program Files\AdventNet\SNMPUtilities\bin
/bin/ps aux | /bin/grep mc | wc -l
rpm -ivh isx4000-2.0.15.release.sp6-centos4.x.i386.rpm
rpm -ivh IsxSNMP-Proxy_x32_2.0.4.3.tar.gz
确认SNMP OID是否存在
首先我们需要找一个oid是否被系统暂用,比如.1.3.6.1.4.1.2021.5000
#snmpwalk -v 2c -c public 10.10.18.112 .1.3.6.1.4.1.2021.5000
UCD-SNMP-MIB::ucdavis.5000 = No Such Object available on this agent at this OID
vi /home/ehang/check_mc.sh
#!/bin/bash
mcNum=`/bin/ps aux | /bin/grep mc.out | wc -l`
echo $mcNum
#vim /etc/snmp/snmpd.conf
extend .1.3.6.1.4.1.2021.5000 check_mc /home/ehang/check_mc.sh // 增加这一行
service snmpd restart
MC-OID = .1.3.6.1.4.1.2021.5000.4.1.2.8.99.104.101.99.107.95.109.99.1
snmpwalk -v 2c -c public 127.0.0.1 .1.3.6.1.4.1.2021.5000
snmpwalk -v 2c -c public 10.10.18.112 .1.3.6.1.4.1.2021.11.9.0
历史参考
http://book.51cto.com/art/201504/474256.htm
http://www.zabbix.org/wiki/Start_with_SNMP_traps_in_Zabbix
https://www.zabbix.com/documentation/2.2/manual/config/items/itemtypes/snmp
http://www.ttlsa.com/zabbix/snmp-custom-oid/
https://www.zabbix.com/documentation/2.2/manual/config/items/itemtypes/snmptrap
http://www.178linux.com/973
http://www.ttlsa.com/zabbix/zabbix-user-macro/
http://www.linux78.com/zabbix-jiao-cheng-zabbixi-tian-jia-items.html
http://www.docin.com/p-566317323.html
zabbix中snmp-traps设置
http://blog.itpub.net/7104/viewspace-133948/
http://tech.soft6.com/665/16/78497.html
It works something like this:
(SNMP Trap) -> snmptrapd -> snmptrap.sh -> zabbix_sender -> (Zabbix)
Basically, the point of snmptrap.sh is to translate a SNMP trap into a Zabbix trap
在/etc/snmp/snmptrapd.conf文件添加
traphandle default /bin/bash /usr/local/zabbix/bin/snmptrap.sh
启动snmptrapd服务:
snmptrapd -C -c /etc/snmp/snmptrapd.conf -Lf /var/log/net-snmptrap.log
Now edit /path/to/zabbix/bin/snmptrap.sh. If not found, check the zabbix source tree, and
copy it to the zabbix/bin directory. For my application the following lines work great:
vim /usr/local/zabbix/bin/snmptrap.sh
####### Begin snmptrap.sh #########
##GENERAL CONFIGURATION
ZABBIX_SERVER="10.10.18.112"; # hostname of zabbix server
ZABBIX_PORT="10051"; # nnnn=same as 'Listen Port' in zabbix_server.conf
ZABBIX_SENDER="/usr/local/zabbix/bin/zabbix_sender"; # insert you path
##END OF GENERAL CONFIGURATION
#According to the snmpdtrapd.conf man page, these
#fields should be received in the following order:
read hostname
read ip
read uptime
read trapoid
read payload
#there may be several more payload fields, but one is all I need.
#read more if it suits you.
hostname=`echo $hostname|cut -f1 -d'.'` # trim off the fluff
trapoid=`echo $trapoid|cut -f3 -d' '` # ditto
#I don't need uptime or ip right now ...
payload=`echo $payload1|cut -f3- -d' '` # ditto ditto
###This section records all traps under a 'dummy' host in zabbix, for debugging
###Delete if you don't need to do this.
###I use it to verify the OID of traps before using them as keys on specific hosts
#create a string to send to zabbix.
str="HOST=$hostname TRAP OID=$trapoid PAYLOAD=$payload"
#now set the key and host name for zabbix
KEY="alltraps";
HOST="trapperjohn";
#now call the zabbix_sender program with all parameters.
$ZABBIX_SENDER $ZABBIX_SERVER $ZABBIX_PORT $HOST $KEY "$str"
###End dummy host section
###This section records traps for specific for specific hosts.
###Edit as needed for you situation.
KEY="$trapoid";
HOST="$hostname";
str="$payload";
$ZABBIX_SENDER $ZABBIX_SERVER $ZABBIX_PORT $HOST $KEY "$str"
######### End snmptrap.sh ###########
调试可:
echo $ZABBIX_SENDER $ZABBIX_SERVER $ZABBIX_PORT $HOST:$KEY "$str" > /tmp/testtrap.txt
测试:
snmptrap -v1 -c public localhost .1.3.6.1.6.3.1.1.5.2 0 0 "" "" .1.3.6.1.4.1 s "aaa"
在zabbix服务器端:
1. Added host:
name=snmpTraps
ip address = (didn’t enter an ip address)
port = 10005 (port which zabbix server is on) - do i need to set this to 162?
Set status to monitored…didn’t add anything else eg IP address, group etc
2. Added item to host (i.e to snmpTraps)
key=snmpTraps
type=zabbix trapper
type of info=numeric
store value=As is
Allowed host= (i have left this line blank)
vim /usr/local/zabbix/etc/zabbix_server.conf
StartSNMPTrapper=1
SNMPTrapperFile=/tmp/zabbix_traps.tmp
cat /tmp/zabbix_traps.tmp
service zabbix_server restart
service zabbix_agentd restart
Zabbix服务器上的SNMP陷入配置(1)
http://book.51cto.com/art/201504/474256.htm
&0[WARNING]snmptrap -v1 -c public 10.10.18.13:162 .1.3.6.1.4.1 127.0.0.1 6 10 100 .1.3.6.1.4.1.40001.3.1 s 2015-11-0913:51:52 .1.3.6.1.4.1.40001.3.2 i 0 .1.3.6.1.4.1.40001.2.2 s PRD-Warning .1.3.6.1.4.1.40001.1.4.1.1 i 0 .1.3.6.1.4.1.40001.1.5.4.1.1 i 1 .1.3.6.1.4.1.40001.1.5.4.1.4 i 65536 ----arg:5
snmptrap -v1 -c public 10.10.18.112:162 .1.3.6.1.6.3.1.1.5.3 0.0.0.0 6 33 55 .1.3.6.1.6.3.1.1.5.3 s “teststring000”
snmptrap -v1 -c public 10.10.18.13:162 .1.3.6.1.4.1.2021.5000.4.1.2.8.99.104.101.99.107.95.109.99.1 127.0.0.1
15:05:36 2014/01/17 .1.3.6.1.6.3.1.1.5.3 Normal "Status Events" 127.0.0.1 - Link down on interface $1. Admin state: $2. Operational state: $3
yum install net-snmp-perl
yum install perl-Config-IniFiles
vi /etc/snmptrapd.conf
donotforkyes
pidfile /var/run/snmptrapd.pid
printeventnumbers yes
traphandle default /usr/sbin/snmptthandler
ignoreauthfailure yes
authcommunity execute,log,net [email protected]
vim /etc/rc.d/init.d/snmptrapd
将snmptrapd文件中的"OPTIONS="-Lsd -p /var/run/snmptrapd.pid""行修改成"OPTIONS="-Lsd -On -p /var/run/snmptrapd.pid""并保存。
service snmptrapd restart
#下载snmptt_1.4源码包
shell>wget http://downloads.sourceforge.net/project/snmptt/snmptt/snmptt_1.4/snmptt_1.4.tgz?r=&ts=1389880477&use_mirror=superb-dca2
shell>tar -zxvfsnmptt_1.4.tgz # 解压软件包
shell>cd snmptt_1.4
#将snmptt文件复制到/usr/sbin目录下,并设置成可执行文件
shell>cp snmptt /usr/sbin/
shell>chmod +x /usr/sbin/snmptt
chmod 777 /usr/sbin/snmptt
#将snmptthandler文件复制到/usr/sbin目录下,并设置成可执行文件
shell>cp snmptthandler /usr/sbin/
shell>chmod +x /usr/sbin/snmptthandler
chmod 777 /usr/sbin/snmptthandler
#将snmptt配置文件snmptt.ini和snmptt.conf文件复制到/etc/snmp目录下
shell>cp snmptt.ini /etc/snmp/
shell>cp examples/snmptt.conf.generic /etc/snmp/snmptt.conf
#创建/var/log/snmptt和mkdir /var/spool/snmptt目录
shell>mkdir /var/log/snmptt
shell>mkdir /var/spool/snmptt
#创建用户并将上述目录的用户属组设置为新建的用户
shell>useradd -s /sbin/nologin snmptt
shell>chown snmptt:snmptt /var/spool/snmptt
chown root /var/log/snmptt
#修改SNMPTT配置文件snmptt.ini中下列各项
shell>vi /etc/snmp/snmptt.ini
修改mode = standalone 配置项为 mode = daemon;
修改date_time_format = 配置项为date_time_format = %H:%M:%S %Y/%m/%d;
修改log_system_enable = 0配置项为log_system_enable = 1;
修改unknown_trap_log_enable = 0 配置项为unknown_trap_log_enable = 1,并确认下面所列的两项配置是否正确。
log_file = /var/log/snmptt/snmptt.log
log_enable = 1
cp snmptt-init.d /etc/init.d/snmptt
vim /etc/snmp/snmptrapd.conf
vim /etc/snmp/snmptt.ini
vim /etc/snmp/snmptt.conf
EVENT general .* “General event” Normal
FORMAT ZBXTRAP $aA $ar
service snmpd restart
service snmptrapd restart
service snmptt restart
service zabbix_server restart
service zabbix_agentd restart
service mysqld restart
service httpd restart
chkconfig snmptrapd on
chkconfig zabbix_server on
chkconfig mysqld on
chkconfig httpd on
chkconfig snmptrapd off
cat /var/log/snmptt/snmpttunknown.log
cat /var/log/snmptt/snmptt.log
cat /tmp/zabbix_traps.tmp
This results in:
Command used to send a trap:
snmptrap -v1 -c public 127.0.0.1 ‘.1.3.6.1.6.3.1.1.5.3’ ‘0.0.0.0’ 6 33 ‘55’ .1.3.6.1.6.3.1.1.5.3 s “teststring000”
The received trap:
15:48:18 2011/07/26 .1.3.6.1.6.3.1.1.5.3.0.33 Normal “General event” localhost - ZBXTRAP 127.0.0.1 127.0.0.1
Value for item TEST:
15:48:18 2011/07/26 .1.3.6.1.6.3.1.1.5.3.0.33 Normal “General event” localhost - 127.0.0.1
有效的snmptrap文档
https://www.zabbix.com/documentation/2.2/manual/config/items/itemtypes/snmptrap
https://www.zabbix.org/wiki/Start_with_SNMP_traps_in_Zabbix#Setting_up_firewall
http://www.ttlsa.com/zabbix/zabbix-regular-expressions/
cd /home/ehang/zabbix-2.2.10
cp ./misc/snmptrap/zabbix_trap_receiver.pl /usr/bin
chmod +x /usr/bin/zabbix_trap_receiver.pl
chmod 777 /usr/bin/zabbix_trap_receiver.pl
vi /etc/snmp/snmptrapd.conf
authCommunity execute public
perl do “/usr/bin/zabbix_trap_receiver.pl”;
vi /usr/bin/zabbix_trap_receiver.pl
snmpwalk -v 2c -c public 10.10.18.112 .1 |more
Configure snmptrapd to start automatically:
chkconfig snmptrapd on
vi /etc/snmp/snmp.conf
mibs +SNMPv2-MIB:IF-MIB:IP-MIB:CENTRALIZED-NETWORK-MANAGEMENT-MIB
snmptrap -v 1 -c public 127.0.0.1 ‘.1.3.6.1.6.3.1.1.5.4’ ‘0.0.0.0’ 6 33 ‘55’ .1.3.6.1.6.3.1.1.5.4 s “eth0”
snmptrap -v 1 -c public 127.0.0.1 ‘.1.3.6.1.2.1.2.1.0’ ‘0.0.0.0’ 6 33 ‘55’ .1.3.6.1.2.1.2.1.0 i 4
snmpget -v2c -c public -On 127.0.0.1 IF-MIB::ifNumber.0
MC
snmptrap -v1 -c public 10.10.18.112:162 .1.3.6.1.4.1 127.0.0.1 6 10 100 .1.3.6.1.4.1.40001.3.1 s 2015-11-1209:29:49 .1.3.6.1.4.1.40001.3.2 i 0 .1.3.6.1.4.1.40001.2.1 s MC-Warning .1.3.6.1.4.1.40001.1.4.1.1 i 0 .1.3.6.1.4.1.40001.1.4.1.4 i 0
PRD
snmptrap -v1 -c public 10.10.18.112:162 .1.3.6.1.4.1 127.0.0.1 6 10 100 .1.3.6.1.4.1.40001.3.1 s 2015-11-1209:42:28 .1.3.6.1.4.1.40001.3.2 i 0 .1.3.6.1.4.1.40001.2.2 s PRD-Warning .1.3.6.1.4.1.40001.1.4.1.1 i 0 .1.3.6.1.4.1.40001.1.5.4.1.1 i 1 .1.3.6.1.4.1.40001.1.5.4.1.4 i 0
snmptrap -v1 -c public 10.10.18.112:162 .1.3.6.1.4.1 127.0.0.1 6 10 100 .1.3.6.1.4.1.40001.3.1 s 2015-11-1209:43:16 .1.3.6.1.4.1.40001.3.2 i 0 .1.3.6.1.4.1.40001.2.2 s PRD-Warning .1.3.6.1.4.1.40001.1.4.1.1 i 0 .1.3.6.1.4.1.40001.1.5.4.1.1 i 1 .1.3.6.1.4.1.40001.1.5.4.1.4 i 65536
snmptrap -v1 -c public 127.0.0.1:162 .1.3.6.1.4.1 127.0.0.1 6 10 100 .1.3.6.1.4.1.40001.3.1 s 2015-11-1215:34:28 .1.3.6.1.4.1.40001.3.2 i 0 .1.3.6.1.4.1.40001.2.2 s PRD-Warning .1.3.6.1.4.1.40001.1.4.1.1 i 0 .1.3.6.1.4.1.40001.1.5.4.1.1 i 1 .1.3.6.1.4.1.40001.1.5.4.1.4 i 0
snmptrap -v1 -c public 127.0.0.1:162 .1.3.6.1.4.1 127.0.0.1 6 10 100 .1.3.6.1.4.1.40001.3.1 s 2015-11-1215:34:28 .1.3.6.1.4.1.40001.3.2 i 0 .1.3.6.1.4.1.40001.2.2 s PRD-Warning .1.3.6.1.4.1.40001.1.4.1.1 i 0 .1.3.6.1.4.1.40001.1.5.4.1.1 i 2 .1.3.6.1.4.1.40001.1.5.4.1.4 i 0
snmptrap["([\s\S])-MIB::prdStatus([\s\S])value=INTEGER:([\s\S])(0|([1-9]\d))([\s\S])"]
1-MIB::prdStatus[\s\S]value=INTEGER: (0|[1-9]\d$)
snmpget -v2c -c public -On 127.0.0.1 CENTRALIZED-NETWORK-MANAGEMENT-MIB::prdTrap
snmpget -v2c -c public -On 127.0.0.1 EHANGCOM-ISX-MIB::prdTrap
snmpget -v2c -c public -On 127.0.0.1 EHANGCOM-ISX-MIB::isxspangroupTable
snmpget -v2c -c public -On 127.0.0.1 CENTRALIZED-NETWORK-MANAGEMENT-MIB::.1.3.6.1.4.1.40001.1.8.5
snmptable -v 2c -c public -t 5 -Cf , 127.0.0.1 EHANGCOM-ISX-MIB::isxMCTable
snmpget -v2c -c public -On 127.0.0.1 EHANGCOM-ISX-MIB::isxspangroupAmount.0
zabbix 触发器使用教程详解:
http://www.111cn.net/sys/linux/62891.htm
http://www.361way.com/zabbix-trigger/3529.html
http://www.linux78.com/zabbix-jiao-cheng-trigger-gao-jing-pei-zhi.html
正则表达式之$1...$9:
http://blog.csdn.net/xxb2008/article/details/7864516
trigger表单属性:
name trigger name,这个名称可能包含macros,$1..$9可以被用来关联表达式的常量。
expression 逻辑表达式用来收集触发器的状态
Multiple PROBLEM events generation 通过设置该选项,你可以在触发器产生problem\
的时候触发一个事件
comments 关于该触发器的信息
url 如果不为空,则该url被用到screen
serverity 设置触发器的严重程度
enabled 选择激活该触发器
18:58:38 2014/02/26 ZBXTRAP 127.0.0.1
PDU INFO:
notificationtype TRAP
version 0
receivedfrom UDP: [127.0.0.1]:40780->[127.0.0.1]
errorstatus 0
messageid 0
community public
transactionid 7
errorindex 0
requestid 0
VARBINDS:
DISMAN-EVENT-MIB::sysUpTimeInstance type=67 value=Timeticks: (55) 0:00:00.55
SNMPv2-MIB::snmpTrapOID.0 type=6 value=OID: IF-MIB::linkUp.0.33
IF-MIB::linkUp type=4 value=STRING: “eth0” SNMP-COMMUNITY
MIB::snmpTrapCommunity.0 type=4 value=STRING: “public”
SNMPv2-MIB::snmpTrapEnterprise.0 type=6 value=OID: IF-MIB::linkUp
09:45:06 2015/11/12 ZBXTRAP 10.10.18.112
PDU INFO:
notificationtype TRAP
version 0
receivedfrom UDP: [10.10.18.112]:54875->[10.10.18.112]
errorstatus 0
messageid 0
community public
transactionid 2
errorindex 0
requestid 0
VARBINDS:
DISMAN-EVENT-MIB::sysUpTimeInstance type=67 value=Timeticks: (100) 0:00:01.00
SNMPv2-MIB::snmpTrapOID.0 type=6 value=OID: SNMPv2-SMI::enterprises.0.10
CENTRALIZED-NETWORK-MANAGEMENT-MIB::alarmTime type=4 value=STRING: “2015-11-1209:42:28”
CENTRALIZED-NETWORK-MANAGEMENT-MIB::alarmLevel type=2 value=INTEGER: 0
CENTRALIZED-NETWORK-MANAGEMENT-MIB::prdTrap type=4 value=STRING: “PRD-Warning”
CENTRALIZED-NETWORK-MANAGEMENT-MIB::mcNo type=2 value=INTEGER: 0
CENTRALIZED-NETWORK-MANAGEMENT-MIB::prdNo type=2 value=INTEGER: 1
CENTRALIZED-NETWORK-MANAGEMENT-MIB::prdStatus type=2 value=INTEGER: 0
SNMP-COMMUNITY-MIB::snmpTrapAddress.0 type=64 value=IpAddress: 127.0.0.1
SNMP-COMMUNITY-MIB::snmpTrapCommunity.0 type=4 value=STRING: “public”
SNMPv2-MIB::snmpTrapEnterprise.0 type=6 value=OID: SNMPv2-SMI::enterprises
snmptrap["[\s\S]-MIB::prdStatus[\s\S]value=INTEGER: (0|[1-9]\d)"]
snmptrap["CENTRALIZED-NETWORK-MANAGEMENT-MIB::prdStatus([\s\S])value=INTEGER:([\s\S])(0|([1-9]\d*))"]
snmptrap["([\s\S])::prdStatus([\s\S])value=INTEGER:(\s*|\S*)(0|([1-9]\d*))([\s\S])"]
((prdStatus([\s\S])value=INTEGER:([\s\S])0)|(prdStatus([\s\S])value=INTEGER:([\s\S])([1-9]\d)))
MIB::prdStatus type=[0-9]{1}[ ]{1,}value=INTEGER:[ ]{1,}0|MIB::prdStatus[ ]{1,}type=[0-9]{1}[ ]{1,}value=INTEGER:[ ]{1,}[1-9][0-9]{0,}
MIB::prdStatus[ ]{1,}type=[0-9]{1}[ ]{1,}value=INTEGER:[ ]{1,}[1-9][0-9]{0,}
snmptrap[“MIB::prdStatus[ ]{1,}type=[0-9]{1}[ ]{1,}value=INTEGER:[ ]{1,}[1-9][0-9]{0,}”]
MIB::prdNo type=[0-9]{1}[ ]{1,}value=INTEGER:[ ]{1,}1
MIB::prdNo type=[0-9]{1}[ ]{1,}value=INTEGER:[ ]{1,}([0-9]{1})
regex-prdstatus
REGEX-PrdStatus
09:31:50 2015/11/12 ZBXTRAP 10.10.18.112
PDU INFO:
notificationtype TRAP
version 0
receivedfrom UDP: [10.10.18.112]:34603->[10.10.18.112]
errorstatus 0
messageid 0
community public
transactionid 1
errorindex 0
requestid 0
VARBINDS:
DISMAN-EVENT-MIB::sysUpTimeInstance type=67 value=Timeticks: (100) 0:00:01.00
SNMPv2-MIB::snmpTrapOID.0 type=6 value=OID: SNMPv2-SMI::enterprises.0.10
CENTRALIZED-NETWORK-MANAGEMENT-MIB::alarmTime type=4 value=STRING: “2015-11-1209:29:49”
CENTRALIZED-NETWORK-MANAGEMENT-MIB::alarmLevel type=2 value=INTEGER: 0
CENTRALIZED-NETWORK-MANAGEMENT-MIB::mcTrap type=4 value=STRING: “MC-Warning”
CENTRALIZED-NETWORK-MANAGEMENT-MIB::mcNo type=2 value=INTEGER: 0
CENTRALIZED-NETWORK-MANAGEMENT-MIB::mcStatus type=2 value=INTEGER: 0
SNMP-COMMUNITY-MIB::snmpTrapAddress.0 type=64 value=IpAddress: 127.0.0.1
SNMP-COMMUNITY-MIB::snmpTrapCommunity.0 type=4 value=STRING: “public”
SNMPv2-MIB::snmpTrapEnterprise.0 type=6 value=OID: SNMPv2-SMI::enterprises
{$EHANG_NOT_0} = "[ ]{1,}type=[0-9]{1}[ ]{1,}value=INTEGER:[ ]{1,}[1-9][0-9]{0,}"
{EHANG-SNMP-traps-T:snmptrap[“isxTrunkTrap”].regexp(MIB::trunkBrdStatus{KaTeX parse error: Expected 'EOF', got '}' at position 12: EHANG_NOT_0}̲)}=1 ISXXOIP-…EHANG_NOT_0})}=1
ISXTimelicAlarmXOIP-Trap snmptrap[“isxTimelicAlarmXOIPTrap”]
{EHANG-SNMP-traps-T:snmptrap[“isxTimelicAlarmXOIPTrap”].regexp(MIB::xoipBoardStatus{$EHANG_NOT_0})}=1
ISXAgBrd-Trap snmptrap["isxAgBrdTrap"] 90 SNMP trap Enabled
{EHANG-SNMP-traps-T:snmptrap["isxAgBrdTrap"].regexp(MIB::agboardStatus{$EHANG_NOT_0})}=1
ISXDSP-Trap snmptrap["isxDspBrdTrap"] 90 SNMP trap Enabled
{EHANG-SNMP-traps-T:snmptrap["isxDspBrdTrap"].regexp(MIB::dspBoardStatus{$EHANG_NOT_0})}=1
ISXTimelicAlarmDSP-Trap snmptrap["isxTimelicAlarmDSPTrap"] 90 SNMP trap Enabled
{EHANG-SNMP-traps-T:snmptrap["isxTimelicAlarmDSPTrap"].regexp(MIB::dspBoardStatus{$EHANG_NOT_0})}=1
ISXFiberBrd-Trap snmptrap["isxFiberBrdTrap"] 90 SNMP trap Enabled
{EHANG-SNMP-traps-T:snmptrap["isxFiberBrdTrap"].regexp(MIB::fiberboardStatus{$EHANG_NOT_0})}=1
ISXM3G-Trap snmptrap["isxM3gBrdTrap"] 90 SNMP trap Enabled
{EHANG-SNMP-traps-T:snmptrap["isxM3gBrdTrap"].regexp(MIB::m3gBoardStatus{$EHANG_NOT_0})}=1
ISXTimelicAlarmM3G-Trap snmptrap["isxTimelicAlarmM3GTrap"] 90 SNMP trap Enabled
{EHANG-SNMP-traps-T:snmptrap["isxTimelicAlarmM3GTrap"].regexp(MIB::m3gBoardStatus{$EHANG_NOT_0})}=1
ISXMB-Trap snmptrap["isxMBTrap"] 90 SNMP trap Enabled
{EHANG-SNMP-traps-T:snmptrap["isxMBTrap"].regexp(MIB::motherboardStatus{$EHANG_NOT_0})}=1
ISXTimelicAlarmMB-Trap snmptrap["isxTimelicAlarmMBTrap"] 90 SNMP trap Enabled
{EHANG-SNMP-traps-T:snmptrap["isxTimelicAlarmMBTrap"].regexp(MIB::motherboardStatus{$EHANG_NOT_0})}=1
ISXNODE-Trap snmptrap["isxnodeTrap"] 90 SNMP trap Enabled
{EHANG-SNMP-traps-T:snmptrap["isxnodeTrap"].regexp(MIB::isxnodeStatus{$EHANG_NOT_0})}=1
ISXPRI-Trap snmptrap["isxPriBrdTrap"] 90 SNMP trap Enabled
{EHANG-SNMP-traps-T:snmptrap["isxPriBrdTrap"].regexp(MIB::priBoardStatus{$EHANG_NOT_0})}=1
ISXTimelicAlarmPRI-Trap snmptrap["isxTimelicAlarmPRITrap"] 90 SNMP trap Enabled
{EHANG-SNMP-traps-T:snmptrap["isxTimelicAlarmPRITrap"].regexp(MIB::priBoardStatus{$EHANG_NOT_0})}=1
ISXPRIDCH-Trap snmptrap["isxPriDCHTrap"] 90 SNMP trap Enabled
{EHANG-SNMP-traps-T:snmptrap["isxPriDCHTrap"].regexp(MIB::dchStatus{$EHANG_NOT_0})}=1
ISXSIP-Trap snmptrap["isxSipTrap"] 90 SNMP trap Enabled
{EHANG-SNMP-traps-T:snmptrap["isxSipTrap"].regexp(MIB::sipBoardStatus{$EHANG_NOT_0})}=1
ISXTimelicAlarmSIP-Trap snmptrap["isxTimelicAlarmSIPTrap"] 90 SNMP trap Enabled
{EHANG-SNMP-traps-T:snmptrap["isxTimelicAlarmSIPTrap"].regexp(MIB::sipBoardStatus{$EHANG_NOT_0})}=1
ISXSIPStack-Trap snmptrap["isxSipStackTrap"] 90 SNMP trap Enabled
{EHANG-SNMP-traps-T:snmptrap["isxSipStackTrap"].regexp("MIB::sipstackStatus{$EHANG_NOT_0}")}=1
ISXSPAN-Trap snmptrap["isxSpanTrap"] 90 SNMP trap Enabled
{EHANG-SNMP-traps-T:snmptrap["isxSpanTrap"].regexp(MIB::spanStatus{$EHANG_NOT_0})}=1
ISXSS7-Trap snmptrap["isxSS7BrdTrap"] 90 SNMP trap Enabled
{EHANG-SNMP-traps-T:snmptrap["isxSS7BrdTrap"].regexp(MIB::ss7BoardStatus{$EHANG_NOT_0})}=1
ISXTimelicAlarmSS7-Trap snmptrap["isxTimelicAlarmSS7Trap"] 90 SNMP trap Enabled
{EHANG-SNMP-traps-T:snmptrap["isxTimelicAlarmSS7Trap"].regexp(MIB::ss7BoardStatus{$EHANG_NOT_0})}=1
ISXSS7CICGroup-Trap snmptrap["isxSS7CICGroupTrap"] 90 SNMP trap Enabled
{EHANG-SNMP-traps-T:snmptrap["isxSS7CICGroupTrap"].regexp(MIB::ss7cicgroupStatus{$EHANG_NOT_0})}=1
ISXSS7CICGroupSet-Trap snmptrap["isxSS7CICGroupSetTrap"] 90 SNMP trap Enabled
{EHANG-SNMP-traps-T:snmptrap["isxSS7CICGroupSetTrap"].regexp(MIB::ss7cicgroupsetStatus{$EHANG_NOT_0})}=1
ISXSS7Link-Trap snmptrap["isxSS7LinkTrap"] 90 SNMP trap Enabled
{EHANG-SNMP-traps-T:snmptrap["isxSS7LinkTrap"].regexp(MIB::ss7linkStatus{$EHANG_NOT_0})}=1
ISXSS7LinkSet-Trap snmptrap["isxSS7LinkSetTrap"] 90 SNMP trap Enabled
{EHANG-SNMP-traps-T:snmptrap["isxSS7LinkSetTrap"].regexp(MIB::ss7linksetStatus{$EHANG_NOT_0})}=1
ISXSS7Route-Trap snmptrap["isxSS7RouteTrap"] 90 SNMP trap Enabled
{EHANG-SNMP-traps-T:snmptrap["isxSS7RouteTrap"].regexp(MIB::ss7routeStatus{$EHANG_NOT_0})}=1
ISXSS7RouteSet-Trap snmptrap["isxSS7RouteSetTrap"] 90 SNMP trap Enabled
{EHANG-SNMP-traps-T:snmptrap["isxSS7RouteSetTrap"].regexp(MIB::ss7routesetStatus{$EHANG_NOT_0})}=1
ISXSS7Stack-Trap snmptrap["isxSS7SignalStackTrap"] 90 SNMP trap Enabled
{EHANG-SNMP-traps-T:snmptrap["isxSS7SignalStackTrap"].regexp(MIB::ss7stackStatus{$EHANG_NOT_0})}=1
ISXSIPOccupiedRate-Trap snmptrap["isxSIPOccupiedRateLoopTrap"]
mkdir -p /home/ehang/zabbix/db
mysqldump -uroot -pehangcom zabbix>/home/ehang/zabbix/db/ehang-zabbix-2.2.10.1-schema.sql
mkdir -p /home/ehang/zabbix/snmp
cp -af /etc/snmp/snmp.conf /home/ehang/zabbix/snmp/snmp.conf
cp -af /etc/snmp/snmptrapd.conf /home/ehang/zabbix/snmp/snmptrapd.conf
cp -af /usr/bin/zabbix_trap_receiver.pl /home/ehang/zabbix/snmp/zabbix_trap_receiver.pl
cp -af /etc/logrotate.d/zabbix_traps /home/ehang/zabbix/snmp/zabbix_traps
cp -af /usr/share/snmp/mibs/CENTRALIZED-NETWORK-MANAGEMENT-MIB /home/ehang/zabbix/snmp/CENTRALIZED-NETWORK-MANAGEMENT-MIB
========================================================================================================================================
今天在家里的RHLE5.5上安装apache的时候,先用user1用户./configure命令配置,然后才用root用户make && make install,结果apache起来的时候就报如下错误:
httpd: apr_sockaddr_info_get() failed for bogon
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
虽然不妨碍使用,可是看着错误总觉得别扭,经过查找发现,这个问题应该是没有在 /etc/httpd/conf/httpd.conf 中设定 ServerName。所以apache会用主机上的名称来取代,首先会去找 /etc/hosts 中有没有主机的定义。
所以要解决这个问题可以设定httpd.conf文件中的 ServerName,如下:
(1) ServerName localhost:80
或者在 /etc/hosts 中填入自己的主机名称 bogon,如下:
(2)127.0.0.1 bogon
注意:
当前系统的主机名请以hostname命令为准,/etc/sysconfig/network中的HOSTNAME设置有可能不一致。
/etc/sysconfig/network 默认主机名是:HOSTNAME=localhost.localdomain
登陆mysql,然后执行下面语句:
set password for 'root'@'localhost' =password('');
flush privileges;
cp -af /etc/rc.d/init.d/zabbix_server /home/ehang/zabbix/init.d/zabbix_server
cp -af /etc/rc.d/init.d/zabbix_agentd /home/ehang/zabbix/init.d/zabbix_agentd
=========================================================================================================================================
linux selinux 权限导致的Apache - "DocumentRoot must be a (2013-09-17 22:13:56)转载▼
分类: linux
解决办法1:
首先为 /www 这个目录下的文件添加默认标签类型:
#semanage fcontext -a -t httpd_sys_content_t '/srv/www(/.*)?'
然后用新的标签类型标注已有文件:
#restorecon -Rv /srv/www
之后 Apache 就可以使用该目录下的文件构建网站了。
注:用该方法成功解决,正面的方法没有实验过
解决办法2:
很简单,把目录或文件的策略类型改成 httpd_sys_content_t 就可以了。
#chcon -t httpd_sys_content_t [file_name | dir_name]
#chcon -R -h -t httpd_sys_content_t /www
然后可以用 ls -laZ 命令查看文件目录的策略类型。(T002)
解决方法3:
关掉selinux
#setenforce 0
解决方法4:
或者更改/root/website这个文件的selinux属性,让它匹配httpd这个服务器的要求
怎么改?我们可以复制/var/www/html这个目录的selinux属性
#chcon -R --reference /var/www/html /root/website
然后在重启服务,之后你就看到它没有报错了
不过你去访问localhost的时候,会发现访问拒绝 这是为什么呢?主要是因为你的/root的权限是750,ahache这个用户没有权限访问,你需要更改掉权限,可以这样改
#chmod -R 755 /root
然后去访问 发现正常了
==============================================================================================================================================
zabbix导入/出模板很容易,在web界面上操作即可.
前提是,你必须安装了php-xml,否则的话,php日志中会显示以下错误:
[Tue Dec 13 17:23:05 2011] [error] [client 10.10.136.111] PHP Fatal error:
\ require_once(): Failed opening required 'include/classes/class.domdocument.php'
(include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/zabbix/include/config.inc.php on line 71,
referer: http://10.10.136.83/zabbix/templates.php
==============================================================================================================================================
查找文件内容是否存在
grep 'CENTRALIZED-NETWORK-MANAGEMENT-MIB' /etc/snmp/snmp.conf
grep 'authCommunity[ ]\{1,\}execute[ ]\{1,\}public' /etc/snmp/snmptrapd.conf
grep '^authCommunity execute public' /etc/snmp/snmptrapd.conf
grep '^[ ]\{0,\}authCommunity[ ]\{1,\}execute[ ]\{1,\}public' /etc/snmp/snmptrapd.conf
grep '^[ ]\{0,\}perl do \"/usr/bin/zabbix_trap_receiver.pl\";' /etc/snmp/snmptrapd.conf
==============================================================================================================================================
linux snmptrap的发送与接收
2012-07-17 0 个评论 收藏 我要投稿
linux snmptrap的发送与接收
由于需要管理服务器的一些参数,比如CPU使用率,IOwait之类的指标,管理方通过snmpwalk进行五分钟一次对受管服务器的轮询。
此类指标为业务指标,是必须了解的一些参数,另需要有告警指标信息。
但由于告警信息一般是由受管服务器进行主动告警,这时候就不能通过管理方主动使用snmpwalk来进行,而是由受管服务器通过snmptrap进行。
www.2cto.com
以下是对双方进行snmptrap的一些设置。
首先是管理方,需要先配置snmptrapd.conf,可以将之放在与snmpd.conf同一个路径下,在我本地环境下为(/etc/snmp/snmptrapd.conf)
配置代码:
Conf代码
authcommunity execute,log,net public
traphandle .1.3.6.1.4.1.2021.251.1 /root/traptest/test.pl
其中authcommunity是为了设置所有用户的访问权限:可执行,记录,传递。
设置traphandle(即收到.1.3.6.1.4.1.2021.251.1类OID信息时,执行test.pl)。
test.pl的内容:
Perl代码
#!/usr/bin/perl
use strict;
my f i l e = " f i l e . t r a p " ; o p e n ( H A N D O U T , " > > . / file="file.trap"; open(HANDOUT,">>./ file="file.trap";open(HANDOUT,">>./file");
while()
{
print HANDOUT “$_”;
}
然后输入命令:
Linux代码
snmptrapd -c /etc/snmp/snmptrapd.conf
将此配置文件设置为默认配置文件,并启动snmptrapd进程:
Linux代码 www.2cto.com
#snmptrapd -d -f -Lo
在受管方,使用命令:
Linux代码
snmptrap -v 2c -c public *.*.*.* "" .1.3.6.1.4.1.2021.251.1 sysLocation.0 s "longtengfei"
而后在管理方会接收到如下信息:
Linux代码
Received 98 bytes from UDP: [221.176.14.88]:58750
0000: 30 60 02 01 01 04 06 70 75 62 6C 69 63 A7 53 02 0`.....public.S.
0016: 04 1B CE 4F F1 02 01 00 02 01 00 30 45 30 10 06 ...O.......0E0..
0032: 08 2B 06 01 02 01 01 03 00 43 04 28 8D B0 5B 30 .+.......C.(..[0
0048: 18 06 0A 2B 06 01 06 03 01 01 04 01 00 06 0A 2B ...+...........+
0064: 06 01 04 01 8F 65 81 7B 01 30 17 06 08 2B 06 01 .....e.{.0...+..
0080: 02 01 01 06 00 04 0B 6C 6F 6E 67 74 65 6E 67 66 .......longtengf
0096: 65 69 ei
www.2cto.com
2012-07-16 10:44:17 [UDP: [221.176.14.88]:58750]:
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (680374363) 78 days, 17:55:43.63 SNMPv2-MIB::snmpTrapOID.0 = OID: UCD-SNMP-MIB::ucdStart SNMPv2-MIB::sysLocation.0 = STRING: longtengfei
至此,最简单的snmptrap的发送与接收就完成了。
作者 shenlan177
export MY_NAME=cat isx4000-zabbix-snmp-manager.spec |grep "Name:" | awk '{print $2}'
echo my-name2 is $MY_NAME
export MY_VERSION=cat isx4000-zabbix-snmp-manager.spec |grep "Version:" | awk '{print $2}'
echo my-name2 is $MY_VERSION
export MY_RELEASE=cat isx4000-zabbix-snmp-manager.spec |grep "Release:" | awk '{print $2}'
echo my-name2 is $MY_RELEASE
cp -af /home/liaowj/isx4000-zabbix-snmp-rpmbuild/post zabbix/post
=uninstall prev=======
warning: waiting for transaction lock on /var/lib/rpm/.rpm.lock
[root@liaowj ~]# ps -A|grep rpm
442 pts/0 00:00:00 rpm
444 pts/0 00:00:00 rpm
[root@liaowj ~]# kill -9 442
Zabbix server is not running: the information displayed may not be current.
CENTRALIZED-NETWORK-MANAGEMENT-MIB::sipOccupiedRate
http://www.ttlsa.com/zabbix/zabbix-trapper/
select * from globalmacro;
±--------------±------------------±---------------------------------------------------------------+
| globalmacroid | macro | value |
±--------------±------------------±---------------------------------------------------------------+
| 2 | {KaTeX parse error: Expected 'EOF', got '}' at position 15: SNMP_COMMUNITY}̲ | public …EHANG_NOT_0} | [ ]{1,}type=[0-9]{1}[ ]{1,}value=INTEGER:[ ]{1,}[1-9][0-9]{0,} |
±--------------±------------------±---------------------------------------------------------------+
select * from hostmacro;
±------------±-------±-----------------------±---------------------------+
| hostmacroid | hostid | macro | value |
±------------±-------±-----------------------±---------------------------+
| 1 | 10105 | {KaTeX parse error: Expected 'EOF', got '}' at position 20: …G_MCNO_OID_HEAD}̲ | .1.3.6.1.4.1…EHANG_MC_OID_HEAD} | .1.3.6.1.4.1.40001.1.4 |
±------------±-------±-----------------------±---------------------------+
#zabbix_sender -z 10.10.5.100 -p 10051 -s “10.10.18.112” -k TrapSipOccupiedRate -o 999
#zabbix_sender -z 10.10.5.100 -p 10051 -s ‘EHANG-MC-T’ -k TrapSipOccupiedRate -o ‘bbbbbbbbb’
#zabbix_sender -z 10.10.5.100 -p 10051 -s “EHANG-MC-T” -k TrapSipOccupiedRate -o ‘bbbbbbbbb’
#zabbix_sender -z 10.10.5.100 -p 10051 -s “10.10.18.112” -k “TrapSipOccupiedRate2” -o ‘bbbbbbbbb’
vi /usr/local/zabbix/etc/zabbix_server.conf
StartTrappers=5
service zabbix_server restart
yum install -y apr-.i686
yum install -y perl-.i686
yum install -y perl-Config-*
yum install -y php-gd-*
yum install -y php-pear-*
yum install -y php-bcmath*
yum install -y php-mbstring*
yum install -y php-mysql*
yum install -y apr-.i686
yum install -y httpd.i686
yum install -y gd*.i686
yum install -y php*.i686
yum install -y libpng-.i686
yum install -y libxml2-.i686
yum install -y bzip2-.i686
yum install -y libcurl-.i686
yum install -y mysql-.i686
yum install -y mysql-
顺便告诉大家,需要直播设备的朋友可以进我的店铺地址:https://shop66907778.taobao.com/
\s\S ↩︎