91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

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

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

Control Drawing Effect(二)

發布時間:2020-07-17 10:18:40 來源:網絡 閱讀:413 作者:卍偽裝卍 欄目:移動開發


Custom drawing templates:
[root@RHEL5 ~]# cd /usr/local/pnp4nagios/share/templates/
[root@RHEL5 templates]# vi check_cpu.php

<?php
#-----The Color of The Three Primary Colors-----
$colors = array(
        'red' => '#FF0000',
        'green' => '#00FF00',
        'blue' => '#0000FF',
        'yellow' => '#FFFF00',
        'black' => '#000000',
        'deepred' => '#330000',
        );
#------------------Image Title------------------
$opt[1] = "--title \"CPU_Load For $hostname / $servicedesc\" ";
#-------------1 Minutes Average Load------------
$def[1] =  "DEF:var1=$RRDFILE[1]:$DS[1]:AVERAGE " ;
$def[1] .= "HRULE:$WARN[1]#00FF00 ";
$def[1] .= "HRULE:$CRIT[1]#FF0000 ";
$def[1] .= "LINE1:var1#0000FF:\"1-Mins \" " ;
$def[1] .= "GPRINT:var1:MIN:\"%3.4lg %s$UNIT[1] Min \\t\" ";
$def[1] .= "GPRINT:var1:MAX:\"%3.4lg %s$UNIT[1] Max \\t\" ";
$def[1] .= "GPRINT:var1:AVERAGE:\"%3.4lg %s$UNIT[1] Average \\n\" ";
#-------------15 Minutes Average Load-----------
$def[1] .=  "DEF:var2=$RRDFILE[2]:$DS[2]:AVERAGE " ;
$def[1] .= "LINE2:var2$colors[black]:\"15-Mins \" " ;
$def[1] .= "GPRINT:var2:MIN:\"%3.4lg  Min \\t\" ";
$def[1] .= "GPRINT:var2:MAX:\"%3.4lg  Max \\t\" ";
$def[1] .= "GPRINT:var2:AVERAGE:\"%3.4lg  Average \\n\" ";
?>


[root@RHEL5 templates]# chown nagios:nagios *


Monitoring plugin:
[root@RHEL5 ~]# tail -n 2 /etc/nagios/resource.cfg

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



[root@RHEL5 ~]# vi /usr/local/nagios/customexec/check_cpu.sh

#!/bin/sh
#Author:zhai_kang,20131026
WARN=$2
CRIT=$4
#1 minutes load,15 minutes load
Load_One=`uptime | awk -F "[:]" '{print $NF}' | awk -F "[,]" '{print $1}'`
Load_Fifteen=`uptime | awk -F "[:]" '{print $NF}' | awk -F "[,]" '{print $3}'`
#to obtain Max value
Max=$Load_One
SIGN=`echo $Max $Load_Fifteen | awk '{if($1<$2)print 1;else print 0}'`
if [[ $SIGN -ge 1 ]]
then
        Max=$Load_Fifteen
fi
#get return data
SIGN_C=`echo $CRIT $Max | awk '{if($1<$2)print 1;else print 0}'`
SIGN_W=`echo $WARN $Max | awk '{if($1<$2)print 1;else print 0}'`
SIGN_O=`echo 0 $Max | awk '{if($1<$2)print 1;else print 0}'`
if [[ $SIGN_C -eq 1 ]]
then
        line=`echo "Critical : 1-Mins = $Load_One; 15-Mins = $Load_Fifteen"`
        RC=2
elif [[ $SIGN_W -eq 1 ]]
then
        line=`echo "Warning : 1-Mins = $Load_One; 15-Mins = $Load_Fifteen"`
        RC=1
elif [[ $SIGN_O -eq 1 ]]
then
        line=`echo "OK : 1-Mins = $Load_One; 15-Mins = $Load_Fifteen"`
        RC=0
else
        line=`echo "Unknown"`
        RC=3
fi
echo $line \| CPU_Load="$Load_One;$WARN;$CRIT" CPU_Load="$Load_Fifteen"
exit $RC



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

define command{
        command_name    check_cpu
        command_line    $USER5$/check_cpu.sh -w $ARG1$ -c $ARG2$
        }



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

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_cpu
        check_command                   check_cpu!2!3
        }



Restart:
[root@RHEL5 ~]# service nagios restart



Verification:

Control Drawing Effect(二)




向AI問一下細節

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

AI

扎囊县| 阳江市| 澎湖县| 陆河县| 青川县| 扶绥县| 灌南县| 固安县| 德化县| 昌邑市| 沈阳市| 大新县| 峨山| 新密市| 定远县| 镇雄县| 南华县| 沅陵县| 图片| 巩义市| 丰都县| 汽车| 林芝县| 安宁市| 庆元县| 佛山市| 安顺市| 大石桥市| 岢岚县| 天津市| 仙桃市| 伊春市| 城口县| 枣阳市| 莒南县| 兴海县| 浙江省| 常德市| 汝城县| 肥东县| 延川县|