Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Zabbix_proxy boot startup script

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Zabbix init boot script-redhat6 system (centos6 generic)

Store the following code / etc/init.d/zabbix-proxy

Chkconfig zabbix-proxy on

. / etc/init.d/functions BASEDIR=/usr/local/sbin BINARY_NAME=zabbix_agent FULLPATH=$BASEDIR/sbin/$BINARY_NAME PIDFILE=/tmp/$BINARY_NAME.pid ERROR=0 STOPPING=0if [- f $PIDFILE] & & [- s $PIDFILE] then PID= `cat $PIDFILE` if ["x$PID"! = "x"] & & kill-0$ PID 2 > / dev/null & & [$BINARY_NAME= = `ps-e | grep $PID | awk'{ Print $4}'`] then STATUS= "$BINARY_NAME (pid `pidof $APP`) running.." RUNNING=1 else rm-f $PIDFILE STATUS= "$BINARY_NAME (pid file existed ($PID) and now removed) not running.." RUNNING=0 fielse if [`ps-e | grep $BINARY_NAME | head-1 | 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=0fistart () {if [$RUNNING-eq 1] then echo "$0$ ARG: $BINARY_NAME (pid $PID) already running" else action $"Starting $BINARY_NAME:" $FULLPATH touch / var/lock/subsys/$BINARY_NAME fi} stop () {echo-n $"Shutting down $BINARY_NAME:" killproc $BINARY_NAME RETVAL=$? Echo [$RETVAL-eq 0] & & rm-f / var/lock/subsys/$BINARY_NAME RUNNING=0} case "$1" in start) start;; stop) stop;; status) status $BINARY_NAME;; restart) stop sleep 10 start;; help | *) echo $"Usage: $0 {start | stop | status | restart | help}" cat

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report