日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

nagios客户端nrped服务方式启动脚本

發布時間:2025/3/8 编程问答 23 豆豆
生活随笔 收集整理的這篇文章主要介紹了 nagios客户端nrped服务方式启动脚本 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

1、平時配置nagios客戶端nrped啟動最常用的就是在/etc/rc.local文件配置:

/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d


2、但是還有更好的方式(這樣方便使用腳本啟動或者關閉):

在/etc/init.d目錄下創建nrped腳本文件,并執行?chmod +x /etc/init.d/nrped 賦予執行權限

chkconfig --add nrped 或執行直接執行chkconfig nrped on 來添加為服務啟動




nrped 腳本文件內容(這個腳本不是我寫的):

#!/bin/sh

#

# ?Created 2000-01-03 by jaclu@grm.se

#

# nrpe ? ? ? ? ?This shell script takes care of starting and stopping

# ? ? ? ? ? ? ? nrpe.

#

# chkconfig: 2345 80 30

# description: nrpe is a daemon for a remote nagios server, \

# ? ? ? ? ? ? ?running nagios plugins on this host.

# processname: nrpe

# config: /usr/local/nagios/etc/nrpe.cfg



# Source function library

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

elif [ -f /etc/rc.d/functions ]; then

. /etc/rc.d/functions

fi


# Source networking configuration.

. /etc/sysconfig/network


# Check that networking is up.

[ ${NETWORKING} = "no" ] && exit 0


NrpeBin=/usr/local/nagios/bin/nrpe

NrpeCfg=/usr/local/nagios/etc/nrpe.cfg

LockFile=/var/lock/subsys/nrpe


# See how we were called.

case "$1" in

? start)

? ? ? ? # Start daemons.

? ? ? ? echo -n "Starting nrpe: "

? ? ? ? daemon $NrpeBin -c $NrpeCfg -d

? ? ? ? echo

? ? ? ? touch $LockFile

? ? ? ? ;;

? stop)

? ? ? ? # Stop daemons.

? ? ? ? echo -n "Shutting down nrpe: "

? ? ? ? killproc nrpe

? ? ? ? echo

? ? ? ? rm -f $LockFile

? ? ? ? ;;

? restart)

? ? ? ? $0 stop

? ? ? ? $0 start

? ? ? ? ;;

? status)

? ? ? ? status nrpe

? ? ? ? exit $?

? ? ? ? ;;

? *)

? ? ? ? echo "Usage: nrpe {start|stop|restart|status}"

? ? ? ? exit 1

esac


exit 0


轉載于:https://blog.51cto.com/xinyuan8/1616376

創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎

總結

以上是生活随笔為你收集整理的nagios客户端nrped服务方式启动脚本的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。