网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

Nagios和ndo2db系统脚本---forgentoo

Gentoo下Nagios系统启动脚本

站在用户的角度思考问题,与客户深入沟通,找到澜沧网站设计与澜沧网站推广的解决方案,凭借多年的经验,让设计与互联网技术结合,创造个性化、用户体验好的作品,建站类型包括:成都做网站、成都网站设计、企业官网、英文网站、手机端网站、网站推广、国际域名空间、虚拟空间、企业邮箱。业务覆盖澜沧地区。

#!/sbin/runscript
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
depend() {
need net
}
if [ -f /etc/rc.d/init.d/functions ]; then
. /etc/rc.d/init.d/functions
elif [ -f /etc/init.d/functions ]; then
. /etc/init.d/functions
fi
checkconfig() {
nagios_bin_file=/var/www/localhost/htdocs/nagios/bin/nagios
nagios_cfg_file=/var/www/localhost/htdocs/nagios/etc/nagios.cfg
if [ ! -f "$nagios_bin_file" ]; then
echo "$nagios_bin_file is not exist."
exit 1
fi
if [ ! -f "$nagios_cfg_file" ]; then
echo "$nagios_cfg_file is not exist."
exit 1
fi
$nagios_bin_file -v $nagios_cfg_file > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "please check your nagios configuration file."
exit 1
fi
}
start() {
nagios_script_file=/var/www/localhost/htdocs/nagios/sbin/nagios
checkconfig
ebegin "starting nagios"
start-stop-daemon --start --exec $nagios_script_file
eend $?
}
stop() {
nagios_pid_file=/var/www/localhost/htdocs/nagios/var/nagios.lock
ebegin "Stopping nagios"
start-stop-daemon --stop --retry 30 --pidfile $nagios_pid_file
eend $?
}
status() {
nagios_run_path=/var/www/localhost/htdocs/nagios/var
if [ ! -f $nagios_run_path/nagios.lock ]; then
echo "nagios is not running."
else
nagios_pid_NO=`head -n 1 $nagios_run_path/nagios.lock`
echo "nagios( pid:$nagios_pid_NO ) is running."
fi
}

Gentoo下ndo2db系统启动脚本

#!/sbin/runscript
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
depend() {
need net
}
if [ -f /etc/rc.d/init.d/functions ]; then
. /etc/rc.d/init.d/functions
elif [ -f /etc/init.d/functions ]; then
. /etc/init.d/functions
fi
checkconfig() {
ndo2db_bin_file=/var/www/localhost/htdocs/nagios/bin/ndo2db-3x
ndo2db_cfg_file=/var/www/localhost/htdocs/nagios/etc/ndo2db.cfg
if [ ! -f "$ndo2db_bin_file" ]; then
echo "$ndo2db_bin_file is not exist."
exit 1
fi
if [ ! -f "$ndo2db_cfg_file" ]; then
echo "$ndo2db_cfg_file is not exist."
exit 1
fi
}
start() {
ndo2db_script_file=/var/www/localhost/htdocs/nagios/sbin/ndo2db
checkconfig
ebegin "starting ndo2db"
start-stop-daemon --start --exec $ndo2db_script_file
eend $?
}
stop() {
ndo2db_pid_file=/var/www/localhost/htdocs/nagios/var/ndo2db.lock
ebegin "Stopping ndo2db"
start-stop-daemon --stop --retry 30 --pidfile $ndo2db_pid_file
eend $?
}
status() {
ndo2db_run_path=/var/www/localhost/htdocs/nagios/var
if [ ! -f $ndo2db_run_path/ndo2db.lock ]; then
echo "ndo2db service is not running."
else
ndo2db_pid_NO=`head -n 1 $ndo2db_run_path/ndo2db.lock`
echo "ndo2db( pid:$ndo2db_pid_NO ) is running."
fi
}

 


网站标题:Nagios和ndo2db系统脚本---forgentoo
网页链接:http://bjjierui.cn/article/ppeiip.html

其他资讯