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

NAGIOS+PNP4NAGIOS+SendEmail-創(chuàng)新互聯(lián)

1、最小化安裝Centos系統(tǒng)。
配置網(wǎng)絡(luò)地址使其可以上網(wǎng)。
2、安裝setup工具
yum  -y install   setuptool  ntsysv iptables system-config-securitylevel-tui system-config-network-tui system-config-firewall-tui make vim
3、修改顯示語(yǔ)言
[root@localhost ~]# more /etc/sysconfig/i18n
#LANG=”zh_CN.UTF-8″
LANG=”zh_CN.GB18030″
SYSFONT=”latarcyrheb-sun16″
4、安裝依賴包。
[root@KING ~]# yum -y install gcc glibc glibc-common gd gd-devel httpd
5、添加相應(yīng)用戶及組
[root@KING conf]# groupadd nagcmd
[root@KING conf]# useradd -G nagcmd nagios
[root@KING conf]# useradd -G nagcmd apache
6、正式安裝nagios
#tar zxf nagios-3.4.1.tar.gz
#cd nagios
#./configure –prefix=/usr/local/nagios –with-command-group=nagcmd
#make all
#make install
#make install-init
#make install-config
#make install-commandmode
#make install-webconf
#htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
7、編譯安裝nagios插件
#tar zvxf nagios-plugins-1.4.15.tar.gz
#cd nagios-plugins-1.4.15
#./configure –prefix=/usr/local/nagios –with-nagios-user=nagios –with-nagios-group=nagios
#make && make install
#chkconfig –add nagios
#chkconfig nagios on
#chkconfig httpd on
#/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
#service nagios start

網(wǎng)站建設(shè)哪家好,找創(chuàng)新互聯(lián)!專注于網(wǎng)頁(yè)設(shè)計(jì)、網(wǎng)站建設(shè)、微信開發(fā)、成都微信小程序、集團(tuán)企業(yè)網(wǎng)站建設(shè)等服務(wù)項(xiàng)目。為回饋新老客戶創(chuàng)新互聯(lián)還提供了長(zhǎng)樂免費(fèi)建站歡迎大家使用!

#vim /root/.bashrc
#添加一條alias check=’/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg’
#source /root/.bashrc

8、安裝后常見問題解決
問題1打開http://192.168.5.64/nagios輸入口令驗(yàn)證后出現(xiàn)“You don’t have permission to access /nagios/ on this server”
解決方法沒裝php導(dǎo)致yum -y install php裝好重啟httpd和nagios

問題2如果提示“Whoops!   Error: Could not read object configuration data! ”這是因?yàn)闆]有啟動(dòng)nagios后臺(tái)進(jìn)程執(zhí)行以下命令
解決方法/usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg

問題3Nagios顯示類似錯(cuò)誤HTTP WARNING: HTTP/1.1 403 Forbidden – 5240 bytes in 0.002 second response time。該錯(cuò)誤表明在apache web根目錄沒有index.html文件。
解決方法在web根目錄如:/var/www/html/目錄建立index.html文件重啟apache和nagios即可。

 問題4安裝nagios-pluginsmake時(shí)出現(xiàn)如下報(bào)錯(cuò)
make[2]: *** [check_http.o] Error 1
make[2]: Leaving directory `/mnt/nagios-plugins-1.4.13/plugins’
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/mnt/nagios-plugins-1.4.13′
make: *** [all] Error 2

解決辦法yum -y install openssl openssl-devel然后重新執(zhí)行./configure再編譯安裝。

9、設(shè)置nagios.cmd寫權(quán)限
chmod 777 /usr/local/nagios/var/rw/nagios.cmd
10、安裝nrpe客戶端
首先安裝SSL支持包[root@KING conf.d]# yum -y install openssl openssl-devel xinetd
安裝nrpe[root@KING nagios]# tar -zvxf nrpe-2.12.tar.gz
#cd nrpe-2.12
#./configure
#make all
#make install-plugin
#make install-daemon
#make install-daemon-config
#make install-xinetd
vim /etc/xinetd.d/nrpe
only_from = 192.168.5.57
vim /etc/services
添加nrpe 5666/tcp #NRPE
重啟xinetd服務(wù)。

測(cè)試下連通性在監(jiān)控端執(zhí)行
/usr/local/nagios/libexec/check_nrpe -H 被監(jiān)控端的地址
如能顯示 “NRPE v2.12”表明NRPE可以和被監(jiān)控端正常通信。

被監(jiān)控端安裝nrpe
同監(jiān)控端額外安裝插件
useradd -s /sbin/nologin nagios
#tar xzf nagios-plugins-1.4.15.tar.gz
#cd nagios-plugins-1.4.15
#./configure –prefix=/usr/local/nagios –with-nagios-user=nagios –with-nagios-group=nagios
#make && make install
修改/usr/local/nagios/etc/objects/commands.cfg定義命令的文件添加如下內(nèi)容
define command {
    command_name    check_nrpe
    command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}
11、定義監(jiān)控
修改/usr/local/nagios/etc/nagios.cfg
去掉cfg_dir=/usr/local/nagios/etc/servers前面的注釋
mkdir //usr/local/nagios/etc/servers
添加文件cacti_56.cfg

define host{
        use     linux-server
        host_name    Cacti-56
        alias     Cacti-56
        address    192.168.5.56
}
define service{
        use     generic-service
        host_name    Cacti-56
        service_description   CPU Load
        check_command    check_nrpe!check_load
}
define service{
        use     generic-service
        host_name    Cacti-56
        service_description   Current Users
        check_command    check_nrpe!check_users
}
define service{
        use     generic-service
        host_name    Cacti-56
        service_description   Disk Free Space /
        check_command    check_nrpe!check_root
}
define service{
        use     generic-service
        host_name    Cacti-56
        service_description   Total Processes
        check_command    check_nrpe!check_total_procs
}
define service{
        use     generic-service
        host_name    Cacti-56
        service_description   Zombie Processes
        check_command    check_nrpe!check_zombie_procs
}
define service{
        use                             generic-service
        host_name                       Cacti-56
        service_description             Swap Usage
        check_command                   check_nrpe!check_swap
}
define service{
        use                             generic-service
        host_name                       Cacti-56
        service_description             disk_/
        check_command                   check_nrpe!check_disk_/
}

define service{
        use                             generic-service
        host_name                       Cacti-56
        service_description             check_tcp_3306
        check_command                   check_tcp!3306
}

檢查配置文件service nagios checkconfig
重新載入service nagios reload

12、修改聯(lián)系人配置文件/usr/local/nagios/etc/objects/contacts.cfg
define contact{
        contact_name                    nagiosadmin
        use                             generic-contact
        alias                           Nagios Admin
        host_notification_commands      notify-host-by-email
        service_notification_commands   notify-service-by-email
        email                           nagios@bobo365.com
        }

define contact{
        contact_name                    nagios
        use                             generic-contact
        alias                           nagios
        service_notification_commands   notify-service-by-email
        host_notification_commands      notify-host-by-email
        email                           nagios@bobo365.com
        }

13、安裝圖形擴(kuò)展工具pnp4nagios
安裝依賴包yum -y install php-gd rrdtool-perl rrdtool librrds-perl perl-Time-HiRes

tar zxf pnp4nagios-0.6.6.tar.gz
cd pnp4nagios-0.6.6.tar.gz
./configure –with-nagios-user=nagios –with-nagios-group=nagcmd
make all
make install
make install-webconf
make install-config
make install-init

[root@KING pnp4nagios-0.6.19]# cd /usr/local/pnp4nagios/etc
[root@KING etc]# rename .cfg-sample .cfg *.cfg-sample
[root@KING etc]# cd pages/
[root@KING pages]# rename .cfg-sample .cfg *.cfg-sample
[root@KING pages]# cd ../check_commands/
[root@KING check_commands]# rename .cfg-sample .cfg *.cfg-sample

service npcd restart

修改nagios的主配置文件打開數(shù)據(jù)傳輸
vim nagios.cfg
process_performance_data=1
host_perfdata_command=process-host-perfdata
service_perfdata_command=process-service-perfdata   #去掉注釋

修改nagios的命令配置文件定義其使用的插件
vim commands.cfg
##添加
# ‘process-host-perfdata’ command definition
define command{
        command_name    process-host-perfdata
        command_line    /usr/local/pnp4nagios/libexec/process_perfdata.pl
        }
# ‘process-service-perfdata’ command definition
define command{
        command_name    process-service-perfdata
        command_line    /usr/local/pnp4nagios/libexec/process_perfdata.pl
        }

配置nagios的樣本文件定義后續(xù)要引用的類
vim templates.cfg
define host {
name       hosts-pnp
action_url /pnp4nagios/graph?host=$HOSTNAME$&srv=_HOST_
register   0
}
define service {
name       services-pnp
action_url /pnp4nagios/graph?host=$HOSTNAME$&srv=$SERVICEDESC$
register   0
}
引用的類后面加上hosts-pnn或者services-pnp以“”隔開

重載nagios服務(wù)
/usr/local/pnp4nagios/var/perfdata/下生成以監(jiān)控主機(jī)的cfg文件名的文件夾里面會(huì)有.rrd和.xml的文件

刪除安裝文件重啟apache。
/usr/local/pnp4nagios/share/install.php

14、nagios報(bào)警郵件
關(guān)閉系統(tǒng)自身的郵件系統(tǒng)postfixservice postfix stop
wget http://caspian.dotconf.net/menu/Software/SendEmail/sendEmail-v1.55.tar.gz
tar zxf sendEmail-v1.55.tar.gz
cd sendEmail-v1.55
cp sendEmail /usr/local/bin
chmod 755 /usr/local/bin/sendEmail
修改command.cfg文件:
command_line    /usr/bin/printf “%b” “***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$

\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n” | /usr/local/bin/sendEmail -f nagios@bobo365.com -t $CONTACTEMAIL$ -s mail.bobo365.com -u “**

$NOTIFICATIONTYPE$ alert – $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **” -xu nagios -xp XXXXXX

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&7

1 永久方法 – 需要重啟服務(wù)器

修改/etc/selinux/config文件中設(shè)置SELINUX=disabled 然后重啟服務(wù)器。

2 臨時(shí)方法 – 設(shè)置系統(tǒng)參數(shù)

使用命令setenforce 0


setenforce 1 設(shè)置SELinux 成為enforcing模式
setenforce 0 設(shè)置SELinux 成為permissive模式

另外有需要云服務(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ù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。

本文題目:NAGIOS+PNP4NAGIOS+SendEmail-創(chuàng)新互聯(lián)
URL分享:http://jinyejixie.com/article28/dehijp.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供關(guān)鍵詞優(yōu)化企業(yè)網(wǎng)站制作、網(wǎng)站設(shè)計(jì)、動(dòng)態(tài)網(wǎng)站外貿(mào)建站、面包屑導(dǎo)航

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(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í)需注明來源: 創(chuàng)新互聯(lián)

網(wǎng)站托管運(yùn)營(yíng)
甘德县| 双柏县| 林甸县| 桦川县| 民勤县| 福泉市| 资中县| 隆安县| 吕梁市| 杭锦旗| SHOW| 于田县| 垫江县| 民权县| 芮城县| 泸水县| 江西省| 双桥区| 万山特区| 沅江市| 天峻县| 宁晋县| 鹿邑县| 丹寨县| 磐石市| 禹城市| 安宁市| 大姚县| 镇沅| 泰和县| 新化县| 万盛区| 噶尔县| 香格里拉县| 天镇县| 辽宁省| 彰化市| 上林县| 鄂伦春自治旗| 正安县| 清镇市|