成人午夜视频全免费观看高清-秋霞福利视频一区二区三区-国产精品久久久久电影小说-亚洲不卡区三一区三区一区

nagios監(jiān)控(三)-創(chuàng)新互聯(lián)

同理添加要監(jiān)控的服務(wù)配置到service.cfg

我們提供的服務(wù)有:網(wǎng)站建設(shè)、做網(wǎng)站、微信公眾號(hào)開(kāi)發(fā)、網(wǎng)站優(yōu)化、網(wǎng)站認(rèn)證、惠安ssl等。為近千家企事業(yè)單位解決了網(wǎng)站和推廣的問(wèn)題。提供周到的售前咨詢(xún)和貼心的售后服務(wù),是有科學(xué)管理、有技術(shù)的惠安網(wǎng)站制作公司

vi service.cfg

define service {

use generic-service

host_name 197-etiantian-1-1

service_description Current Load

check_command check_nrpe!check_load

max_check_attempts 2

normal_check_interval 4

retry_check_interval 4

check_period 24x7

notification_interval 1440

notification_period 24x7

notification_options w,u,c,r

contact_groups admins

process_perf_data 1

}

define service {

use generic-service

host_name 197-etiantian-1-1

service_description MEM Useage

check_command check_nrpe!check_mem

max_check_attempts 2

normal_check_interval 4

retry_check_interval 4

check_period 24x7

notification_interval 1440

notification_period 24x7

notification_options w,u,c,r

contact_groups admins

process_perf_data 1

}

define service {

use generic-service

host_name 197-etiantian-1-1

service_description Swap Useage

check_command check_nrpe!check_swap

max_check_attempts 10

normal_check_interval 3

retry_check_interval 4

check_period 24x7

notification_interval 480

notification_period workhours

notification_options w,u,c,r

contact_groups admins

process_perf_data 1

}

define service {

use generic-service

host_name 197-etiantian-1-1

service_description Disk Partition

check_command check_nrpe!check_disk

max_check_attempts 8

normal_check_interval 3

retry_check_interval 2

check_period 24x7

notification_interval 360

notification_period 24x7

notification_options w,u,c,r

contact_groups admins

process_perf_data 1

}

define service {

use generic-service

host_name 197-etiantian-1-1

service_description Disk Iostat

check_command check_nrpe!check_iostat!5!11

max_check_attempts 2

normal_check_interval 4

retry_check_interval 4

check_period 24x7

notification_interval 1440

notification_period 24x7

notification_options w,u,c,r

contact_groups admins

process_perf_data 1

}

#*:

1.以上service.cfg中添加了對(duì)磁盤(pán)分區(qū)、Load、Mem、Swap、磁盤(pán)io的監(jiān)控

2.以上hots.cfgservice的內(nèi)容的詳細(xì)解釋見(jiàn)附錄八

若此時(shí)執(zhí)行如下檢查nagios語(yǔ)法命令:

檢查語(yǔ)法:

/etc/init.d/nagios checkconfig

會(huì)發(fā)現(xiàn)報(bào)錯(cuò):

Checking services...

Error: Service check command 'check_nrpe'specified in service 'Swap Useage' for host '197-etiantian-1-1' not

defined anywhere!

省略若干。。

Total Warnings: 0

Total Errors: 5

根據(jù)錯(cuò)誤提示,我們可以知道,是check_nrpe插件沒(méi)有定義導(dǎo)致。

#注意沒(méi)有出現(xiàn)

Total Warnings: 0

Total Errors: 5

而是出現(xiàn)的

[root@linux objects]# /etc/init.d/nagios checkconfig

Running configuration check...

Nagios Core 3.2.0

……………………….

Processing object config file '/usr/local/nagios/etc/objects/commands.cfg'...

Processing object config file '/usr/local/nagios/etc/objects/contacts.cfg'...

Processing object config file '/usr/local/nagios/etc/objects/timeperiods.cfg'...

Processing object config file '/usr/local/nagios/etc/objects/templates.cfg'...

Processing object config directory '/usr/local/nagios/etc/commands'...

Error: Could not open config directory '/usr/local/nagios/etc/commands' for reading.

………………………….

 CONFIG ERROR! Check your Nagios configuration.

#配置文件沒(méi)有改IP

需要在commands.cfg中加入check_nrpe 的插件配置

#vi commands.cfg進(jìn)入后按shift+g 切到結(jié)尾加入下面內(nèi)容。

# 'check_nrpe' command definition

define command{

command_name check_nrpe

command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$

}

此時(shí)重新執(zhí)行檢查語(yǔ)法命令:

檢查語(yǔ)法:

/etc/init.d/nagios checkconfig

Total Warnings: 0

Total Errors: 0

注*:修改配置不需要restart

打開(kāi)網(wǎng)頁(yè)會(huì)出現(xiàn)

It appears as though you do not have permission to view information for any of theservices you requested...

解決方法

[root@nagiosserver objects]#cd /usr/local/nagios/etc

[root@nagiosserver objects]#vi cgi.cfg +119

#把在1.6 節(jié)建立的用戶(hù)oldboy 加到后面,注意用逗號(hào)隔開(kāi)。

#default_user_name=oldboy

authorized_for_system_information=nagiosadmin,oldboy

authorized_for_configuration_information=nagiosadmin,oldboy

authorized_for_system_commands=nagiosadmin,oldboy

authorized_for_all_services=nagiosadmin,oldboy

authorized_for_all_hosts=nagiosadmin,oldboy

authorized_for_all_service_commands=nagiosadmin,oldboy

authorized_for_all_host_commands=nagiosadmin,oldboy

記得reload nagios 命令為:/etc/init.d/nagios reload

增加從nagios服務(wù)器端發(fā)起的監(jiān)控:如url地址,端口監(jiān)控

1.添加要監(jiān)控的服務(wù)配置到service.cfg

########check url

#check_weburl (http://blog.etiantian.org) 197-etiantian-1-1

define service{

use generic-service

host_name 197-etiantian-1-1

service_description blog_url

check_command check_weburl!-H blog.etiantian.org

max_check_attempts 3

normal_check_interval 2

retry_check_interval 1

check_period 24x7

notification_interval 30

notification_period 24x7

notification_options w,u,c,r

contact_groups admins

}

#check_weburl(http://blog.etiantian.org/oldboy/) 197-etiantian-1-1

define service{

use generic-service

host_name 197-etiantian-1-1

service_description blog_oldboy_url

check_command check_weburl!-H blog.etiantian.org -u /oldboy/

max_check_attempts 3

normal_check_interval 2

retry_check_interval 1

check_period 24x7

notification_interval 30

notification_period 24x7

notification_options w,u,c,r

contact_groups admins

}

#請(qǐng)注意看以上監(jiān)控URL 的不同

# 如果你的機(jī)器沒(méi)有blog.etiantian.org 的WEB 配置, 可以直接用我的博客的公網(wǎng)地址

http://blog.etiantian.org/oldboy/,這樣下面就不需要本地解析了。

檢查語(yǔ)法:

/etc/init.d/nagios checkconfig

會(huì)發(fā)現(xiàn)報(bào)錯(cuò):

Checking services...

Error: Service check command 'check_weburl' specified in service 'blog_oldboy_url' for host '197-etiantian-1-1' not defined

anywhere!

Error: Service check command 'check_weburl' specified in service 'blog_url' for host '197-etiantian-1-1' not defined anywhere!

…省略若干…

Total Warnings: 0

Total Errors: 2

根據(jù)錯(cuò)誤可以知道,是check_weburl 插件沒(méi)有定義導(dǎo)致。

、需要在commands.cfg 中加入check_weburl 的插件配置

# 'check_weburl' command definition

define command{

command_name check_weburl

command_line $USER1$/check_http $ARG1$ -w 10 -c 30

}

注意還要添加本地監(jiān)控的插件:

# 'check_mem' command definition

define command{

command_name check_mem

command_line $USER1$/check_mem -w $ARG1$ -c $ARG2$

}

# 'check_load' command definition

define command{

command_name check_load

command_line $USER1$/check_load -w $ARG1$ -c $ARG2$

#command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$

}

# 'check_disk' command definition

define command{

command_name check_disk

command_line $USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$

}

注意:以上三個(gè)插件命令沒(méi)加也是正常的,這點(diǎn)有空偶在細(xì)看看。

如果是測(cè)試,注意在nagios 服務(wù)器端的/etc/hosts 下加

192.168.1.106 blog.etiantian.org

192.168.1.107 www.etiantian.org

檢查語(yǔ)法:

/etc/init.d/nagios checkconfig

Total Warnings: 0

Total Errors: 0

使配置文件生效命令/etc/init.d/nagios reload

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無(wú)理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性?xún)r(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專(zhuān)為企業(yè)上云打造定制,能夠滿(mǎn)足用戶(hù)豐富、多元化的應(yīng)用場(chǎng)景需求。

當(dāng)前題目:nagios監(jiān)控(三)-創(chuàng)新互聯(lián)
文章源于:http://jinyejixie.com/article28/dicgjp.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供品牌網(wǎng)站建設(shè)、網(wǎng)頁(yè)設(shè)計(jì)公司、面包屑導(dǎo)航、移動(dòng)網(wǎng)站建設(shè)、靜態(tài)網(wǎng)站動(dòng)態(tài)網(wǎng)站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶(hù)投稿、用戶(hù)轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

小程序開(kāi)發(fā)
阿巴嘎旗| 嵊泗县| 天水市| 常山县| 乐陵市| 阜南县| 冀州市| 纳雍县| 东乌珠穆沁旗| 苍溪县| 龙江县| 三都| 石嘴山市| 普定县| 正镶白旗| 张家界市| 泰来县| 丰顺县| 永宁县| 平和县| 蓬溪县| 思南县| 白河县| 青铜峡市| 报价| 延庆县| 古交市| 临汾市| 体育| 咸阳市| 龙州县| 恩平市| 开封市| 昌乐县| 伊金霍洛旗| 南充市| 增城市| 芷江| 合川市| 铁力市| 沾益县|