亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費(fèi)注冊(cè) 查看新帖 |

Chinaunix

  平臺(tái) 論壇 博客 文庫(kù)
最近訪問(wèn)板塊 發(fā)新帖
查看: 2765 | 回復(fù): 2
打印 上一主題 下一主題

nagios eventhandler的問(wèn)題 [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報(bào)告]
發(fā)表于 2009-04-22 09:39 |只看該作者 |倒序?yàn)g覽
本帖最后由 soap2003 于 2011-04-23 09:04 編輯

我想通過(guò)nagios先監(jiān)控本機(jī)的ssh進(jìn)程,當(dāng)發(fā)現(xiàn)進(jìn)程宕機(jī)的時(shí)候,則自動(dòng)重啟。

<<services.cfg>>

define service{
        host_name                               localhost
        service_description             local_procs_sshd
        check_command                   check_local_procs_sshd
        max_check_attempts                      3
        normal_check_interval           5
        retry_check_interval            5
        check_period                    24x7
        event_handler                   restart_sshd
        event_handler_enabled           1
        process_perf_data                       1
        notification_interval           5
        notification_period             24x7
        notification_options            w,u,c
        contact_groups                  admin
}

<<misccommands.cfg>>

define command{
        command_name                  restart_sshd
        command_line                    $USER1$/restart_sshd $SERVICESTATE$ $SERVICESTA
TETYPE$ $SERVICEATTEMPT$
}

<<restart_ssh>>

#!/bin/sh
#
# Event handler script for restarting the cypress server on the local machine
#
#


# What state is the search service in?
/usr/bin/printf "We enter" >> /usr/lib/nagios/plugins/sshd.log
yourdate=`date   +%Y%m%d%H%M%S`
case "$1" in
OK)
         
    # The service just came back up, so don't do anything...
    /usr/bin/printf "check OK $yourdate \n" >> /usr/lib/nagios/plugins/sshd.log
    ;;   
CRITICAL)
    # Aha!  The cypress service appears to have a problem - perhaps we should restart the server...
    /usr/bin/printf " The cypress service appears to have a problem $yourdate \n " >> /usr/lib/nagios/plugins/sshd.log
    service sshd restart
    ;;
esac
exit 0

配置基本這些,nagios。cfg中已經(jīng)
enable_event_handlers=1
當(dāng)監(jiān)控到服務(wù)停止的時(shí)候,就是不會(huì)調(diào)用哪個(gè)shell(restart_ssh),哪位高人幫忙分析一下,還有關(guān)于這些方面的調(diào)試應(yīng)該按照什么邏輯思路來(lái)查找問(wèn)題,原理方面還不是很懂,多謝

以下是eventlog
22-04-2009 10:25:17] SERVICE EVENT HANDLER: localhost;local_procs_sshd;CRITICAL;HARD;3;restart_sshd
[22-04-2009 10:25:05] SERVICE NOTIFICATION: nagiosadmin;localhost;local_procs_sshd;CRITICAL;notify-by-sms-serviceROCS CRITICAL: 0 processes with args /usr/sbin/sshd
[22-04-2009 10:25:05] SERVICE ALERT: localhost;local_procs_sshd;CRITICAL;HARD;3ROCS CRITICAL: 0 processes with args '/usr/sbin/sshd'
[22-04-2009 10:20:05] SERVICE EVENT HANDLER: localhost;local_procs_sshd;CRITICAL;SOFT;2;restart_sshd
[22-04-2009 10:20:05] SERVICE ALERT: localhost;local_procs_sshd;CRITICAL;SOFT;2ROCS CRITICAL: 0 processes with args '/usr/sbin/sshd'
[22-04-2009 10:20:01] EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;localhost;local_procs_sshd;1240366795
[22-04-2009 10:19:05] SERVICE EVENT HANDLER: localhost;local_procs_sshd;CRITICAL;SOFT;1;restart_sshd
[22-04-2009 10:19:05] SERVICE ALERT: localhost;local_procs_sshd;CRITICAL;SOFT;1ROCS CRITICAL: 0 processes with args '/usr/sbin/sshd'
[22-04-2009 10:19:03] EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;localhost;local_procs_sshd;1240366736


[ 本帖最后由 soap2003 于 2009-4-22 10:27 編輯 ]

論壇徽章:
0
2 [報(bào)告]
發(fā)表于 2009-04-24 09:50 |只看該作者

加油

看來(lái)無(wú)人問(wèn)津,難道沒(méi)有相關(guān)的同行?

論壇徽章:
0
3 [報(bào)告]
發(fā)表于 2009-05-04 22:15 |只看該作者
基本和你相同吧,能檢測(cè)到宕機(jī),但是腳本不運(yùn)行,不起作用,不知道是不是權(quán)限問(wèn)題,試試 sudo,成功后請(qǐng)回復(fù)。
您需要登錄后才可以回帖 登錄 | 注冊(cè)

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號(hào)-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號(hào):11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報(bào)專區(qū)
中國(guó)互聯(lián)網(wǎng)協(xié)會(huì)會(huì)員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過(guò)ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請(qǐng)注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP