亚洲激情专区-91九色丨porny丨老师-久久久久久久女国产乱让韩-国产精品午夜小视频观看

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

Custom plug(一)

發布時間:2020-05-27 12:54:36 來源:網絡 閱讀:635 作者:卍偽裝卍 欄目:移動開發


Monitoring plugin:

[root@RHEL5 ~]# cd /usr/local/nagios/
[root@RHEL5 nagios]# mkdir customexec
[root@RHEL5 nagios]# vi customexec/check_procs.sh

#!/bin/sh
#Author:zhai_kang,20131024
COUNT=`ps -ef | grep -v grep | grep $2 | wc -l`
PROC=`expr $COUNT - 2`
if [[ $PROC -ge $6 ]]
then
        line=`echo "Critical - PROC=$PROC"`
        RC=2
elif [[ $PROC -ge $4 ]]
then
        line=`echo "Warning - PROC=$PROC"`
        RC=1
elif [[ $PROC -ge 1 ]]
then
        line=`echo "OK - PROC=$PROC"`
        RC=0
else
        line=`echo "Unknown - PROC=null"`
        RC=3
fi
echo $line \| proc=$PROC
exit $RC


[root@RHEL5 nagios]# chown -R nagios:nagios customexec/
[root@RHEL5 nagios]# chmod +x customexec/check_procs.sh


Set the path to the plugins:
[root@RHEL5 nagios]# vi /etc/nagios/resource.cfg

#Add by Kingcraft
$USER5$=/usr/local/nagios/customexec



Integration of the PNP4Nagios and Nagios:
[root@RHEL5 nagios]# vi /etc/nagios/nagios.cfg

process_performance_data=1
host_perfdata_command=process-host-perfdata
service_perfdata_command=process-service-perfdata


[root@RHEL5 nagios]# vi /etc/nagios/objects/templates.cfg

#Add by Kingcraft
define host{
    name            host-pnp
    register        0
    action_url      /pnp4nagios/graph?host=$HOSTNAME$
    }
define service{
    name            srv-pnp
    register        0
    action_url      /pnp4nagios/graph?host=$HOSTNAME$&srv=$SERVICEDESC$
    }


Define the monitoring command:
[root@RHEL5 nagios]# vi /etc/nagios/objects/commands.cfg

define command{
    command_name   process-host-perfdata
    command_line   /usr/bin/perl /usr/local/pnp4nagios/libexec/process_perfdata.pl -d HOSTPERFDATA
}
define command{
    command_name   process-service-perfdata
    command_line      /usr/bin/perl /usr/local/pnp4nagios/libexec/process_perfdata.pl
}
define command{
        command_name    check_procs
        command_line    $USER5$/check_procs.sh -a $ARG1$ -w $ARG2$ -c $ARG3$
        }


Definition monitor file:
[root@RHEL5 nagios]# vi /etc/nagios/Linuxhosts/localhost.cfg

# Define a host for the local machine
define host{
        use                     linux-server,host-pnp
        host_name               Monitor
        alias                   Monitor
        address                 172.17.10.4
        }
define service{
        use                     local-service,srv-pnp
        host_name               Monitor
        service_description     check_procs
        check_command           check_procs!ndo2db!4!6
        }


Syntax checking && restart nagios:
[root@RHEL5 nagios]# /usr/local/nagios/bin/nagios -v /etc/nagios/nagios.cfg
[root@RHEL5 nagios]# service nagios restart


Verification


Custom plug(一)





向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

兰州市| 龙泉市| 峨眉山市| 勃利县| 新野县| 林州市| 宝丰县| 肥乡县| 博乐市| 南岸区| 安吉县| 马边| 措美县| 嘉兴市| 瓮安县| 华容县| 镇巴县| 七台河市| 炎陵县| 张掖市| 乐安县| 雅安市| 景泰县| 兴城市| 漳浦县| 资溪县| 高碑店市| 新余市| 大余县| 南部县| 陇南市| 陕西省| 广东省| 临清市| 利辛县| 兰溪市| 若羌县| 资兴市| 运城市| 息烽县| 长春市|