• zabbix服务端安装

1.使用脚本安装、脚本内容如下。安装完用http://192.168.159.20/zabbix

#!/bin/bash
#使用说明,此版本是针对程序安装路径不在/opt/下的
#installZabbixServer里已经开启了--enable-agent
#1.上传所需的文件到pageDir
#libiconv-1.14.tar.gz
#mysql-5.6.33-linux-glibc2.5-x86_64.tar.gz
#php-5.6.21.tar.gz
#zabbix-3.2.5.tar.gz
#nginx-1.10.0.tar.gz
#nginx.conf
#msyh.ttf
#服务端安装
# 1.修改变量serverIp 为服务端ip
# 2.sh installZabbix_lnV3.sh
#安装端安装
# 1.修改变量serverIp 为服务端ip
# 2.check_server install_zabbixAgent 脚本最末端只留这个,其它注释掉。
# 3.执行 sh installZabbix_lnV3.sh
pageDir="/opt/tools/"
bdFile="/tmp/bdFile.txt"
webUser="www"
zabbixUser="zabbix"
mysqlData="/home/mysql"
serverIp="192.168.159.20" #安装zabbix-agent时指定zabbix-server ip
dbhost="127.0.0.1"
dbuser='zabbix'
dbname='zabbix'
dbpassword=''
installDir="/opt"
installDir2="\/opt" [ -f /etc/yum.repos.d/epel-.repo ] || wget -P /etc/yum.repos.d/ http://mirrors.aliyun.com/repo/epel-6.repo
[ -d ${installDir} ] || mkdir -p ${installDir}
check_ok() {
if [ $? != ]
then
echo "Error, Check the error log."
exit
fi
} myum() {
if ! rpm -qa|grep -q "^$1" then
yum install -y $
check_ok
else
echo $ already installed.
fi
} myum curl install_libiconv(){
cd $pageDir
[ -f libiconv-1.14.tar.gz ] || wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
[ -d libiconv-1.14 ] || tar zxf libiconv-1.14.tar.gz
cd libiconv-1.14
./configure --prefix=${installDir}/libiconv
check_ok
make
check_ok
make install
check_ok
rm -rf libiconv-1.14
check_ok
echo "install_libiconv" >> "$bdFile"
echo "libiconv install ok"
}
install_phpfpm() {
cd $pageDir
[ -f php-5.6..tar.gz ] || wget http://cn2.php.net/get/php-5.6.21.tar.gz/from/this/mirror
[ -d php-5.6..tar.gz ] || tar zxf php-5.6..tar.gz for p in libmcrypt libmcrypt-devel libxslt-devel libxslt zlib-devel libxml2-devel libjpeg-turbo-devel freetype-devel libpng-devel gd-devel libcurl-devel mhash mhash-devel
do
myum $p
done
if ! grep -q "$webUser" /etc/passwd
then
useradd -M -s /sbin/nologin "$webUser"
check_ok
fi
cd php-5.6.
./configure \
--prefix=${installDir}/php-5.6. \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-iconv-dir=${installDir}/libiconv/ \
--with-freetype-dir \
--with-jpeg-dir \
--with-png-dir \
--with-zlib \
--with-libxml-dir=/usr \
--enable-xml \
--disable-rpath \
--enable-bcmath \
--enable-shmop \
--enable-sysvsem \
--enable-inline-optimization \
--with-curl \
--enable-mbregex \
--enable-fpm \
--enable-mbstring \
--with-mcrypt \
--with-gd \
--with-gettext \
--enable-gd-native-ttf \
--with-openssl \
--with-mhash \
--enable-pcntl \
--enable-sockets \
--with-xmlrpc \
--enable-zip \
--enable-soap \
--enable-short-tags \
--enable-static \
--with-xsl \
--with-fpm-user="$webUser" \
--with-fpm-group="$webUser" \
--enable-fpm \
--enable-ftp \
--enable-opcache=yes check_ok
make && make install
check_ok
ln -sv ${installDir}/php-5.6. ${installDir}/php
check_ok
[ -f ${installDir}/php/etc/php.ini ] || /bin/cp php.ini-production ${installDir}/php/etc/php.ini
if ${installDir}/php/bin/php -i |grep -iq 'date.timezone => no value'
then
sed -i '/;date.timezone =$/a\date.timezone = "Asia\/Chongqing"' ${installDir}/php/etc/php.ini
check_ok
fi
[ -f ${installDir}/php/etc/php-fpm.conf ] || cp ${installDir}/php/etc/php-fpm.conf.default ${installDir}/php/etc/php-fpm.conf
check_ok
[ -f /etc/init.d/phpfpm ] || /bin/cp sapi/fpm/init.d.php-fpm /etc/init.d/phpfpm
chmod /etc/init.d/phpfpm
chkconfig phpfpm on
service phpfpm start
check_ok
cd $pageDir
rm -rf php-5.6.
echo "phpfpm install ok"
echo "install_phpfpm" >> "$bdFile" } install_nginx(){
for i in pcre pcre-devel zlib gcc openssl openssl-devel zlib-devel
do
myum $i
done
cd $pageDir
[ -f nginx-1.10..tar.gz ] || wget http://nginx.org/download/nginx-1.10.0.tar.gz
[ -d nginx-1.10. ] || tar -zxf nginx-1.10..tar.gz
if ! grep -q "^$webUser" /etc/passwd
then
useradd -M -s /sbin/nologin "$webUser"
check_ok
fi
cd nginx-1.10.
./configure \
--user="$webUser" \
--group="$webUser" \
--prefix=${installDir}/nginx-1.10. \
--with-pcre \
--with-http_stub_status_module \
--with-http_ssl_module
check_ok
make
check_ok
make install
check_ok
ln -sv ${installDir}/nginx-1.10. ${installDir}/nginx
curl http://www.apelearn.com/study_v2/.nginx_init -o /etc/init.d/nginx
sed -i "s@/usr/local@${installDir}@g" /etc/init.d/nginx
chmod /etc/init.d/nginx
chkconfig nginx on
#[ -f nginx.conf ] || curl http://www.apelearn.com/study_v2/.nginx_conf -o ${installDir}/nginx/conf/nginx.conf
mv ${installDir}/nginx/conf/nginx.conf{,.bak} && cp -a $pageDir/nginx.conf ${installDir}/nginx/conf/
sed -i "s@/usr/local@${installDir}@g" ${installDir}/nginx/conf/nginx.conf
check_ok
sed -i 's#fastcgi_pass unix:/tmp/php-fcgi.sock;#fastcgi_pass 127.0.0.1:9000;#' ${installDir}/nginx/conf/nginx.conf
service nginx start
check_ok
echo -e "<?php\n phpinfo();\n?>" > ${installDir}/nginx/html/index.php
check_ok
cd $pageDir
rm -rf nginx-1.10.
check_ok
echo "nginx install ok"
echo "install_nginx" >> "$bdFile" } install_mysql(){
cd $pageDir
[ -f mysql-5.6.-linux-glibc2.-x86_64.tar.gz ] || wget http://mirrors.sohu.com/mysql/MySQL-5.6/mysql-5.6.33-linux-glibc2.5-x86_64.tar.gz
tar zxf mysql-5.6.-linux-glibc2.-x86_64.tar.gz
check_ok
[ -d ${installDir}/mysql ] && /bin/mv ${installDir}/mysql ${installDir}/mysql_bak
mv mysql-5.6.-linux-glibc2.-x86_64 ${installDir}/mysql-5.6.
if ! grep '^mysql:' /etc/passwd
then
useradd -M mysql -s /sbin/nologin
fi
for i in compat-libstdc++- libaio libaio-devel
do
myum $i
done
[ -d $mysqlData ] && /bin/mv $mysqlData $mysqlData_bak
mkdir -p $mysqlData
chown -R mysql:mysql $mysqlData
ln -sv ${installDir}/mysql-5.6. ${installDir}/mysql
cd ${installDir}/mysql
./scripts/mysql_install_db --user=mysql --datadir="$mysqlData"
check_ok
/bin/cp support-files/my-default.cnf /etc/my.cnf
check_ok
sed -i "/^\[mysqld\]$/a\datadir = ${mysqlData}" /etc/my.cnf
/bin/cp support-files/mysql.server /etc/init.d/mysqld
sed -i "s#^datadir=#datadir=${mysqlData}#" /etc/init.d/mysqld
sed -i "s@usr/local@${installDir}@g" /etc/init.d/mysqld
chmod /etc/init.d/mysqld
chkconfig --add mysqld
chkconfig mysqld on
echo "mysql install ok"
echo "install_mysql" >> "$bdFile"
service mysqld start
check_ok } install_zabbixServer(){
myum net-snmp-devel
myum mysql-devel
echo "${installDir}/mysql/lib/" >> /etc/ld.so.conf
ldconfig
check_ok
cd $pageDir
[ -f zabbix-3.2..tar.gz ] || wget http://repo.zabbix.com/zabbix/3.0/ubuntu/pool/main/z/zabbix/zabbix-3.2.5.tar.gz
[ -d zabbix-3.2. ] || tar zxf zabbix-3.2..tar.gz
if ! grep -q "^$zabbixUser" /etc/passwd
then
useradd -M -s /sbin/nologin $zabbixUser
check_ok
fi
cd zabbix-3.2.
./configure \
--prefix=${installDir}/zabbix-3.2. \
--enable-server \
--enable-agent \
--with-mysql=mysqld \
--enable-ipv6 --with-net-snmp \
--with-libcurl --with-libxml2
check_ok
make
check_ok
make install
check_ok
rm -rf ${installDir}/zabbix && ln -sv ${installDir}/zabbix-3.2. ${installDir}/zabbix
check_ok [ -d ${installDir}/nginx/html/zabbix ] || mkdir -p ${installDir}/nginx/html/zabbix
cp -R frontends/php/* ${installDir}/nginx/html/zabbix/
chown -R $webUser.$webUser ${installDir}/nginx/html/zabbix
check_ok
rm -f /etc/init.d/zabbix*
cp misc/init.d/fedora/core/zabbix_server /etc/rc.d/init.d/zabbix_server
cp misc/init.d/fedora/core/zabbix_agentd /etc/rc.d/init.d/zabbix_agentd sed -i "s#BASEDIR=/usr/local#BASEDIR=${installDir}/zabbix#" /etc/init.d/zabbix_server
sed -i "/BASEDIR=${installDir2}\/zabbix$/a\BASECONF=${installDir2}\/zabbix\/etc\/zabbix_server.conf" /etc/init.d/zabbix_server
sed -i 's/action $"Starting $BINARY_NAME: " $FULLPATH/action $"Starting $BINARY_NAME: " $FULLPATH -c $BASECONF/' /etc/init.d/zabbix_server sed -i "s/# DBHost=localhost/DBHost=${dbhost}/" ${installDir}/zabbix/etc/zabbix_server.conf
sed -i "s/# DBPassword=/DBPassword=${dbpassword}/" ${installDir}/zabbix/etc/zabbix_server.conf if ${installDir}/mysql/bin/mysql -uroot -e "show databases" | grep -q ${dbname} ;then
${installDir}/mysql/bin/mysql -uroot -e "drop database ${dbname};"
fi
${installDir}/mysql/bin/mysql -uroot -e "create database ${dbname} default character set utf8;"
check_ok if ! ${installDir}/mysql/bin/mysql -uroot -e "select user from mysql.user where user='${dbuser}';" | grep -q ${dbuser};then
${installDir}/mysql/bin/mysql -uroot -e "grant all privileges on ${dbname}.* to '${dbuser}'@'${dbhost}' identified by '${dbpassword}';flush privileges;"
check_ok
fi cd $pageDir
cd zabbix-3.2.5 ${installDir}/mysql/bin/mysql -u${dbuser} -p${dbpassword} -h ${dbhost} ${dbname} < database/mysql/schema.sql
check_ok
${installDir}/mysql/bin/mysql -u${dbuser} -p${dbpassword} -h ${dbhost} ${dbname} < database/mysql/images.sql
check_ok
${installDir}/mysql/bin/mysql -u${dbuser} -p${dbpassword} -h ${dbhost} ${dbname} < database/mysql/data.sql
check_ok sed -i 's/post_max_size = 8M/post_max_size = 16M/' ${installDir}/php/etc/php.ini
sed -i 's/max_execution_time = 30/max_execution_time = 300/' ${installDir}/php/etc/php.ini
sed -i 's/max_input_time = 60/max_input_time = 300/' ${installDir}/php/etc/php.ini
sed -i 's/;always_populate_raw_post_data = -1/always_populate_raw_post_data = -1/' ${installDir}/php/etc/php.ini
if ${installDir}/php/bin/php -i |grep -iq 'date.timezone => no value'
then
sed -i '/;date.timezone =$/a\date.timezone = "Asia\/Chongqing"' ${installDir}/php/etc/php.ini
check_ok
fi
sed -i 's@php_fpm_CONF=${prefix}/etc/php-fpm.conf@php_fpm_CONF=${prefix}/etc/php.ini@' /etc/init.d/phpfpm
sed -i 's/php_opts="--fpm-config $php_fpm_CONF --pid $php_fpm_PID"/php_opts="-c $php_fpm_CONF --pid $php_fpm_PID"/' /etc/init.d/phpfpm /etc/init.d/phpfpm restart
check_ok
/etc/init.d/zabbix_server start
check_ok
chkconfig --add zabbix_server
check_ok
chkconfig zabbix_server on
check_ok echo "install zabbix_server ok"
echo "install_zabbixServer" >> "$bdFile" #客户端 sed -i "s@BASEDIR=/usr/local@BASEDIR=${installDir}/zabbix@g" /etc/init.d/zabbix_agentd
sed -i "/BASEDIR=${installDir2}\/zabbix$/a\BASECONF=${installDir2}\/zabbix\/etc\/zabbix_agentd.conf" /etc/init.d/zabbix_agentd
sed -i 's/action $"Starting $BINARY_NAME: " $FULLPATH/action $"Starting $BINARY_NAME: " $FULLPATH -c $BASECONF/' /etc/init.d/zabbix_agentd
# Include=/usr/local/etc/zabbix_agentd.conf.d/*.conf
sed -i "s/Server=127.0.0.1/Server=$serverIp/" ${installDir}/zabbix/etc/zabbix_agentd.conf
sed -i "s@#\ Include=/usr/local/etc/zabbix_agentd.conf.d/\*.conf@Include=${installDir}/zabbix/etc/zabbix_agentd.conf.d/\*.conf@g" ${installDir}/zabbix/etc/zabbix_agentd.conf
sed -i 's/ServerActive=127.0.0.1/ServerActive=0.0.0.0:10050/' ${installDir}/zabbix/etc/zabbix_agentd.conf
sed -i 's/# UnsafeUserParameters=0/UnsafeUserParameters=1/g' ${installDir}/zabbix/etc/zabbix_agentd.conf
/etc/init.d/zabbix_agentd start
check_ok
chkconfig --add zabbix_agentd
check_ok
chkconfig zabbix_agentd on
check_ok
echo "install_zabbixAgent install ok"
echo "install_zabbixAgent" >> "$bdFile" } install_zabbixAgent(){
if ! grep -q "^$zabbixUser" /etc/passwd
then
useradd -M -s /sbin/nologin $zabbixUser
check_ok
fi
cd $pageDir
[ -f zabbix-3.2.5.tar.gz ] || wget http://repo.zabbix.com/zabbix/3.0/ubuntu/pool/main/z/zabbix/zabbix-3.2.5.tar.gz
[ -d zabbix-3.2.5 ] || tar zxf zabbix-3.2.5.tar.gz
cd zabbix-3.2.5
./configure \
--prefix=${installDir}/zabbix-3.2.5 --enable-agent
check_ok
make
check_ok
make install
check_ok
[ -l ${installDir}/zabbix ] || ln -sv ${installDir}/zabbix-3.2.5 ${installDir}/zabbix
cp misc/init.d/fedora/core/zabbix_agentd /etc/rc.d/init.d/zabbix_agentd
sed -i "s@BASEDIR=/usr/local@BASEDIR=${installDir}/zabbix@g" /etc/init.d/zabbix_agentd
sed -i "/BASEDIR=${installDir2}\/zabbix$/a\BASECONF=${installDir2}\/zabbix\/etc\/zabbix_agentd.conf" /etc/init.d/zabbix_agentd
sed -i 's/action $"Starting $BINARY_NAME: " $FULLPATH/action $"Starting $BINARY_NAME: " $FULLPATH -c $BASECONF/' /etc/init.d/zabbix_agentd
# Include=/usr/local/etc/zabbix_agentd.conf.d/*.conf
sed -i "s/Server=127.0.0.1/Server=$serverIp/" ${installDir}/zabbix/etc/zabbix_agentd.conf
sed -i "s@#\ Include=/usr/local/etc/zabbix_agentd.conf.d/\*.conf@Include=${installDir}/zabbix/etc/zabbix_agentd.conf.d/\*.conf@g" ${installDir}/zabbix/etc/zabbix_agentd.conf
sed -i 's/ServerActive=127.0.0.1/ServerActive=0.0.0.0:10050/' ${installDir}/zabbix/etc/zabbix_agentd.conf
sed -i 's/# UnsafeUserParameters=0/UnsafeUserParameters=1/g' ${installDir}/zabbix/etc/zabbix_agentd.conf #sed -i "s@BASEDIR=/usr/local@BASEDIR=${installDir}/zabbix@g" /etc/init.d/zabbix_agentd
#sed -i '/BASEDIR='${installDir}'\/zabbix$/a\BASECONF='${installDir}'/zabbix/etc/zabbix_agentd.conf' /etc/init.d/zabbix_agentd
#sed -i 's/action $"Starting $BINARY_NAME: " $FULLPATH/action $"Starting $BINARY_NAME: " $FULLPATH -c $BASECONF/' /etc/init.d/zabbix_agentd #sed -i "s/Server=127.0.0.1/Server=$serverIp/" ${installDir}/zabbix/etc/zabbix_agentd.conf
#sed -i "s/# Include=\/usr\/local\/etc\/zabbix_agentd.conf.d\/*.conf/Include=${installDir}\/zabbix\/etc\/zabbix_agentd.conf.d\/*.conf/" ${installDir}/zabbix/etc/zabbix_agentd.conf
#sed -i 's/ServerActive=127.0.0.1/ServerActive=0.0.0.0:10050/' ${installDir}/zabbix/etc/zabbix_agentd.conf
#sed -i 's/# UnsafeUserParameters=0/UnsafeUserParameters=1/g' ${installDir}/zabbix/etc/zabbix_agentd.conf
/etc/init.d/zabbix_agentd start
check_ok
chkconfig --add zabbix_agentd
check_ok
chkconfig zabbix_agentd on
check_ok
echo "install_zabbixAgent install ok"
echo "install_zabbixAgent" >> "$bdFile"
} check_server(){
if ! grep -q "$1" "$bdFile"
then
"$1"
fi
} check_server install_nginx
check_server install_libiconv
check_server install_phpfpm
check_server install_mysql
check_server install_zabbixServer
#check_server install_zabbixAgent

2.页面配置

访问http://192.168.159.20/zabbix

点击

next

next

Configure DB connection(host:127.0.0.1 port:3306 daname: zabbix user: zabbix password:xxxx) next

配置 zabbix server next

next

finsh

登入默认用户(admin/zabbix)

中文支持

修改locales.inc.php

vim /opt/nginx/html/zabbix/include/locales.inc.php

找到

'zh_CN' => ['name' => _('Chinese (zh_CN)'), 'display' => fales]

把fales改成true

图片支持中文

在更换完中文后我们的监控图片会出现乱码因为图片这里不支持中文我们这么做

修改defines.inc.php

#修改第45行改为

define('ZBX_GRAPH_FONT_NAME', 'simkai')

#修改第93行

define('ZBX_FONT_NAME', 'simkai');

1、从windows下控制面板->字体->选择一种中文字库例如“楷体”

2、将字体复制到/apps/nginx-1.10.0/html/zabbix/fonts/目录下

3、最后在用户中设置即可

zabbix_proxy安装和配置

useradd -M -s /sbin/nologin zabbix
yum install mysql-devel net-snmp-devel curl-devel -y
./configure --prefix=/opt/zabbix-proxy --enable-proxy --enable-agent --with-mysql --with-net-snmp --with-libcurl
make && make install [root@devops etc]# cat zabbix_agentd.conf
LogFile=/tmp/zabbix_agentd.log
Server=10.200.0.26
ServerActive=127.0.0.1
Hostname=10.200.0.26
Include=/opt/zabbix_proxy/etc/zabbix_agentd.conf.d/*.conf [root@devops etc]# cat zabbix_proxy.conf
Server=218.70.106.250
Hostname=47.100.217.13
LogFile=/tmp/zabbix_proxy.log
DBHost=218.70.106.250
DBName=zabbix_proxy
DBUser=zabbix_proxy
DBPassword=zabbix@puyi
DBPort=13306
ConfigFrequency=60
DataSenderFrequency=60
Timeout=4
FpingLocation=/usr/local/sbin/fping
LogSlowQueries=3000 #启动脚本
#!/bin/sh
# chkconfig: 345 95 95
# desctription: Zabbix Proxy
# Zabbix
# Copyright (C) 2001-2013 Zabbix SIA
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Start/Stop the Zabbix agent daemon.
# Place a startup script in /sbin/init.d, and link to it from /sbin/rc[023].d SERVICE="Zabbix proxy"
DAEMON=/opt/apps/zabbix/zabbix_proxy/sbin/zabbix_proxy
PIDFILE=/tmp/zabbix_proxy.pid
BASEDIR=/opt/apps/zabbix/
ZABBIX_AGENTD=$BASEDIR/zabbix_proxy/sbin/zabbix_proxy
case $1 in
'start')
if [ -x ${DAEMON} ]
then
$DAEMON
# Error checking here would be good...
echo "${SERVICE} started."
else
echo "Can't find file ${DAEMON}."
echo "${SERVICE} NOT started."
fi
;;
'stop')
if [ -s ${PIDFILE} ]
then
if kill `cat ${PIDFILE}` >/dev/null 2>&1
then
echo "${SERVICE} terminated."
rm -f ${PIDFILE}
fi
fi
;;
'restart')
$0 stop
sleep 10
$0 start
;;
*)
echo "Usage: $0 start|stop|restart"
;;
esac

控制台添加proxy代理

centos7 zabbix_agentd启动脚本

[root@devops init.d]# cat /etc/init.d/zabbix_agentd
#!/bin/bash
#
# chkconfig: -
# description: Starts and stops Zabbix Agent using chkconfig
# Tested on Fedora Core -
# Should work on all Fedora Core versions
#
# @name: zabbix_agentd
# @author: Alexander Hagenah <hagenah@topconcepts.com>
# @created: 18.04.
#
# Modified for Zabbix 2.0.
# May , Zabbix SIA
#
# Source function library.
#. /etc/init.d/functions # Variables
# Edit these to match your system settings # Zabbix-Directory
BASEDIR=/opt/zabbix-proxy
BASECONF=/opt/zabbix-proxy/etc/zabbix_agentd.conf # Binary File
BINARY_NAME=zabbix_agentd # Full Binary File Call
FULLPATH=$BASEDIR/sbin/$BINARY_NAME # PID file
PIDFILE=/tmp/$BINARY_NAME.pid # Establish args
ERROR=
STOPPING= #
# No need to edit the things below
# # application checking status
if [ -f $PIDFILE ] && [ -s $PIDFILE ]
then
PID=`cat $PIDFILE` if [ "x$PID" != "x" ] && kill - $PID >/dev/null && [ $BINARY_NAME == `ps -e | grep $PID | awk '{print $4}'` ]
then
STATUS="$BINARY_NAME (pid `pidof $APP`) running.."
RUNNING=
else
rm -f $PIDFILE
STATUS="$BINARY_NAME (pid file existed ($PID) and now removed) not running.."
RUNNING=
fi
else
if [ `ps -e | grep $BINARY_NAME | head - | awk '{ print $1 }'` ]
then
STATUS="$BINARY_NAME (pid `pidof $APP`, but no pid file) running.."
else
STATUS="$BINARY_NAME (no pid file) not running"
fi
RUNNING=
fi # functions
start() {
if [ $RUNNING -eq ]
then
echo "$0 $ARG: $BINARY_NAME (pid $PID) already running"
else
$FULLPATH
touch /var/lock/subsys/$BINARY_NAME
fi
} stop() {
echo -n $"Shutting down $BINARY_NAME: "
killproc $BINARY_NAME
RETVAL=$?
echo
[ $RETVAL -eq ] && rm -f /var/lock/subsys/$BINARY_NAME
RUNNING=
} # logic
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status $BINARY_NAME
;;
restart)
stop
sleep
start
;;
help|*)
echo $"Usage: $0 {start|stop|status|restart|help}"
cat <<EOF start - start $BINARY_NAME
stop - stop $BINARY_NAME
status - show current status of $BINARY_NAME
restart - restart $BINARY_NAME if running by sending a SIGHUP or start if not running
help - this screen EOF
exit
;;
esac exit
 

1.zabbix编译安装(环境lnmp)的更多相关文章

  1. centos7 编译安装新版LNMP环境

    centos7 编译安装新版LNMP环境 环境版本如下: 1.系统环境:Centos 7 x86_64 2.NGINX:nginx-1.11.3.tar.gz 3.数据库:mariadb-10.0.2 ...

  2. Zabbix编译安装(全)

    一.前言 (一).概述 Zabbix是一个基于WEB界面的提供分布式系统监视以及网络监视功能的企业级的开源解决方案,Zabbix能监视各种网络参数,保证服务器系统的安全运营:并提供灵活的通知机制以让系 ...

  3. centos7源码编译安装lamp/lnmp

    centos7源码编译安装lamp/lnmp 进程:是包工头(相当于是个门,只管开门关门,不管门内的事儿) 线程:是各种工种(cpu调度的是线程) 进程 是一件事情, 线程 是 同一个时间范围内 同时 ...

  4. nginx配合zabbix编译安装时web下一步跳转问题

    很多时候编译安装的时候把zabbix的php包拷贝到web所在目录之后(本文为nginx所在html目录),网页打开http:/localhost/zabbix却进不去下图: 或者是点了下一步没反应, ...

  5. zabbix编译安装

    第一部分zabbix安装部署,实现分布式监控及网络知识 #yum install  lrzsz.x86_64   传送文件 安装mysql脚本 #!/bin/bash DIR = pwd NAME = ...

  6. Ubuntu 编译安装搭配LNMP 环境

    这里用Nginx1.2.0+mysql5.6.33+php5.6.2搭配安装环境 ---------------------------------------------Nginx BEGIN--- ...

  7. 如何查看编译安装的lnmp环境各自的配置参数

    安装好后如何查看mysql/apache/nginx/php安装参数   查看mysql编译参数: cat /usr/local/mysql/bin/mysqlbug | grep CONFIGURE ...

  8. Centos7之LNMP环境编译安装

    Centos7之LNMP环境编译安装 一.系统环境准备 注:安装时间过长,只做参考!!!1.系统信息 [root@localhost ~]# uname -r 3.10.0-957.el7.x86_6 ...

  9. 使用Ubuntu系统编译安装Zabbix企业级监控系统

    使用Ubuntu系统编译安装Zabbix企业级监控系统   作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. Ubuntu系统部署笔记:https://www.cnblogs.com/ ...

随机推荐

  1. Linux启动详细过程(开机启动顺序)

    启动第一步--加载BIOS当你打开计算机电源,计算机会首先加载BIOS信息,BIOS信息是如此的重要,以至于计算机必须在最开始就找到它.这是因为BIOS中包含了CPU的相关信息.设备启动顺序信息.硬盘 ...

  2. frida的js脚本处理正则的一个小坑

    frida的server模式需要python支持,所以js脚本中的正则需要多一次转义 比如匹配"/proc/{数字pid}" server: paramPath.match(&qu ...

  3. Flink容错机制(checkpoint)

    checkpoint是Flink容错的核心机制.它可以定期地将各个Operator处理的数据进行快照存储( Snapshot ).如果Flink程序出现宕机,可以重新从这些快照中恢复数据. 1. ch ...

  4. tensorflow|tf.train.slice_input_producer|tf.train.Coordinator|tf.train.start_queue_runners

    #### ''' tf.train.slice_input_producer :定义样本放入文件名队列的方式[迭代次数,是否乱序],但此时文件名队列还没有真正写入数据 slice_input_prod ...

  5. python-javascript之bom

    BOM BOM介绍 全称 Browser Object Mode 浏览器对象模式 操作浏览器的API接口.比如浏览器自动滚动 Windows对象的顶层部分是BOM的顶层(核心)对象,所有的对象都是通过 ...

  6. git 资料

    git学习资料整理(知乎搜集的) https://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000 ...

  7. 2019年RTC大会记录

    小编近期在研究webRTC点对点通信技术,怀着学习的心态参加了2019年RTC大会,对所见所闻做下记录,不对的地方还请批评指正! 这次热门的话题是5G.WebRTC.AI对图像.音视频的相关处理,思科 ...

  8. 第五节 RabbitMQ在C#端的应用-消息收发

    原文:第五节 RabbitMQ在C#端的应用-消息收发 版权声明:未经本人同意,不得转载该文章,谢谢 https://blog.csdn.net/phocus1/article/details/873 ...

  9. spring整合mybatis后,mybatis一级缓存失效的原因

    一般来说,可以在5个方面进行缓存的设计: 最底层可以配置的是数据库自带的query cache, mybatis的一级缓存,默认情况下都处于开启状态,只能使用自带的PerpetualCache,无法配 ...

  10. 如何将自己的代码上传至github

    前提条件: 有个github账号,电脑安装了git; 首先在自己的账号里新建一个仓库: https://github.com/qiqi105/littleAlbum.git 进入到你要上传的文件夹内部 ...