久久久精品一区ed2k-女人被男人叉到高潮的视频-中文字幕乱码一区久久麻豆樱花-俄罗斯熟妇真实视频

Cacti+Nagios完全攻略(二)nagios配置安裝

Nagios簡介
 
      Nagios是一個用來監(jiān)視系統(tǒng)和網(wǎng)絡的開源應用軟件,它通常運行于一個主服務器上,這個服務器運行 Liunx 或 Unix 操作系統(tǒng)。Nagios 利用其眾多的插件實現(xiàn)對本機和遠端服務的監(jiān)控,當被監(jiān)控對象出現(xiàn)異常,Nagios 就會及時給管理人員告警。它是一個基于TCP/IP協(xié)議的軟件包,包含有nagios主程序和它的各個插件,配置非常靈活,可以監(jiān)視的項目很多,也可以通過自定義 shell 腳本進行監(jiān)控服務,非常適合各類企業(yè)的網(wǎng)絡應用。
       Nagios功能非常強大,它可以監(jiān)控服務和主機,但是他自身并不包括這部分功能的代碼,所有的監(jiān)控、檢測功能都是有插件來完成的。再說報警功能,如果監(jiān)控系統(tǒng)發(fā)現(xiàn)問題不能報警那就沒有意義了,所以報警也是nagios很重要的功能之一。但是,同樣的,nagios自身也沒有報警部分的代碼,甚至沒有插件,而是交給用戶或者其他相關開源項目組去完成。nagios安裝,是指基本平臺,也就是nagios軟件包的安裝。它是監(jiān)控體系的框架,也是所有監(jiān)控的基礎。
       打開nagios官方的文檔,會發(fā)現(xiàn)nagios基本上沒有什么依賴包,只要求系統(tǒng)是linux或者其他nagios支持的系統(tǒng)。不過如果你沒有安裝apache(http服務),那么你就沒有那么直觀的界面來查看監(jiān)控信息了,所以apache姑且算是一個前提條件。
   
Nagios 系統(tǒng)的特點主要有下面幾點:
  • 監(jiān)控主機資源和網(wǎng)絡服務
  •  
  • 允許用戶通過設計實現(xiàn)簡單的插件來監(jiān)控自己特定的服務
  •  
  • 當被監(jiān)控對象出現(xiàn)問題時,會及時通知管理人員
  •  
  • 事先定義事件處理程序,當對象出現(xiàn)問題時自動調(diào)用對應的處理程序
  •  
  • 通過 web 頁面來監(jiān)視對象狀態(tài),警告提示和日志文件。
 
需要安裝軟件列表
 
nagios-3.2.0.tar.gz
php-devel-5.1.6-39.el5_8.rpm
php-json-ext-1.2.1.tar.bz2
 
 

開啟系統(tǒng)sendmail服務
 在nagios監(jiān)控服務器上開啟sendmail服務的主要作用是讓nagios在檢測到故障時可以發(fā)送報警郵件,目前幾乎所有的linux發(fā)行版本都默認自帶了sendmail服務,所以,在安裝系統(tǒng)時只需開啟sendmail服務即可,并且不需要在sendmail上做任何配置。

成都創(chuàng)新互聯(lián)-專業(yè)網(wǎng)站定制、快速模板網(wǎng)站建設、高性價比呼圖壁網(wǎng)站開發(fā)、企業(yè)建站全套包干低至880元,成熟完善的模板庫,直接使用。一站式呼圖壁網(wǎng)站制作公司更省心,省錢,快速模板網(wǎng)站建設找我們,業(yè)務覆蓋呼圖壁地區(qū)。費用合理售后完善,十載實體公司更值得信賴。

 

Nagios安裝
1、 創(chuàng)建nagios用戶和組
[root@cacti-qmail nagios-3.2.0]# useradd nagios
[root@cacti-qmail nagios-3.2.0]#mkdir /usr/local/nagios
[root@cacti-qmail nagios-3.2.0]#chown nagios.nagios /usr/local/nagios
 
2、安裝nagios
[root@cacti-qmail soft]# wget http://ncu.dl.sourceforge.net/project/nagios/nagios-3.x/nagios-3.2.1/nagios-3.2.0.tar.gz 
[root@cacti-qmail soft]# tar -zxvf nagios-3.2.0.tar.gz 
[root@cacti-qmail soft]#cd nagios-3.2.0
[root@cacti-qmail nagios-3.2.0]# ./configure --prefix=/usr/local/nagios
[root@cacti-qmail nagios-3.2.0]#make all
 
輸入make all 得到下面具體信息
 
==============================================================
 
*** Compile finished ***
 
If the main program and CGIs compiled without any errors, you
can continue with installing Nagios as follows (type 'make'
without any arguments for a list of all possible options):
 
 make install
     - This installs the main program, CGIs, and HTML files
   
   使用make install來安裝主程序,CGI和HTML文件
 
 make install-init
     - This installs the init script in /etc/rc.d/init.d
 
   使用make install-init在/etc/rc.d/init.d安裝啟動腳本
 
 make install-commandmode
     - This installs and configures permissions on the
       directory for holding the external command file
 
   使用make install-commandmode來配置目錄權限
 
 make install-config
     - This installs *SAMPLE* config files in /usr/local/nagios/etc
       You'll have to modify these sample files before you can
       use Nagios. Read the HTML documentation for more info
       on doing this. Pay particular attention to the docs on
       object configuration files, as they determine what/how
       things get monitored!
   使用make install-commandmode來安裝示例配置文件,安裝的路徑是/usr/local/nagios/etc
 
 make install-webconf
     - This installs the Apache config file for the Nagios
       web interface
  使用make install-webconf來安裝apache的配置文件
 
=================================================================
 
make install出現(xiàn)以下錯誤是因為沒有創(chuàng)建nagios用戶及組并且賦權:
=================================================================
cd ./base && make install
make[1]: Entering directory `/home/yahoon/nagios/nagios-2.9/base'
make install-basic
make[2]: Entering directory `/home/yahoon/nagios/nagios-2.9/base'
/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/bin
/usr/bin/install: invalid user `nagios' 非法用戶nagios
make[2]: *** [install-basic] Error 1
make[2]: Leaving directory `/home/yahoon/nagios/nagios-2.9/base'
make[1]: *** [install] Error 2
make[1]: Leaving directory `/home/yahoon/nagios/nagios-2.9/base'
make: *** [install] Error 2
=====================================================================
 
 
[root@cacti-qmail nagios-3.2.0]#make all
[root@cacti-qmail nagios-3.2.0]#make install && make install-init && make install-commandmode && make install-config && make install-webconf
驗證程序是否被正確安裝
 切換目錄到安裝路徑(這里是/usr/local/nagios),看是否存在 etc、bin、 sbin、 share、 var這五個目錄,如果存在則可以表明程序被正確的安裝到系統(tǒng)了。后表是五個目錄功能的簡要說明:
bin Nagios執(zhí)行程序所在目錄,nagios文件即為主程序
etc Nagios配置文件位置,初始安裝完后,只有幾個*.cfg-sample文件
sbin Nagios Cgi文件所在目錄,也就是執(zhí)行外部命令所需文件所在的目錄
Share Nagios網(wǎng)頁文件所在的目錄
Var Nagios日志文件、spid 等文件所在的目錄
修改nagios頁面文件
[root@cacti-qmail nagios-3.2.1]# more /etc/httpd/conf/nagios.conf
# SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER
# Last Modified: 11-26-2005
#
# This file contains examples of entries that need
# to be incorporated into your Apache web server
# configuration file. Customize the paths, etc. as
# needed to fit your system.
 
ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"
 
<Directory "/usr/local/nagios/sbin">
# SSLRequireSSL
   Options ExecCGI
   AllowOverride None
   Order allow,deny
   Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
   AuthName "Nagios Access"
   AuthType Basic
   AuthUserFile /usr/local/nagios/etc/htpasswd.users
   Require valid-user
</Directory>
 
Alias /nagios "/usr/local/nagios/share"
 
<Directory "/usr/local/nagios/share">
# SSLRequireSSL
   Options None
   AllowOverride None
   Order allow,deny
   Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
   AuthName "Nagios Access"
   AuthType Basic
  AuthUserFile /usr/local/nagios/etc/htpasswd.users
   Require valid-user
</Directory>
基本上這個文件可以直接使用,所以直接復制過去
[root@cacti-qmail nagios-3.2.1]# cp /etc/httpd/conf/nagios.conf  /var/www/html/
生成nagios頁面訪問賬號
根據(jù)這個配置文件中指定的AuthUserFile項,它指定的是通過Apache訪問Nagios的合法用戶的帳戶名單庫文件,需要使用htpasswd命令對這個名單庫進行用戶的添加。而默認安裝環(huán)境下在/usr/local/nagios/etc/目錄下是沒有 htpasswd.uses這個文件的,所以需要手動添加。請?zhí)貏e注意,用root身份建立的htpasswd.user文件的權限問題,應該在建立該文件完畢后立即更改為nagios用戶nagios組的所有權
 
[root@cacti-qmail ~]# touch /usr/local/nagios/etc/htpasswd.users
 
建立Nagios的網(wǎng)頁訪問用戶帳戶文件(這里必須要與Nagios網(wǎng)頁配置文件當中AuthUserFile指定的路徑文件名一致)
 
[root@cacti-qmail ~]# /usr/bin/htpasswd -c /usr/local/nagios/etc/htpasswd.users  killer
New password:
Re-type new password:
Adding password for user killer
 
[root@cacti-qmail nagios-3.2.0]# cat /usr/local/nagios/etc/htpasswd.user                         
killer:HbfEis6w0gKqI
 
修改nagios主配置文件 
[root@cacti-qmail nagios-3.2.0]# vi /usr/local/nagios/etc/nagios.cfg
log_file=/usr/local/nagios/var/nagios.log( 默認無nagios.log文件,需要手動創(chuàng)建)
command_check_interval=15s
#command_check_interval=-1
設定命令檢查的時間間隔,將原來值-1的項注釋掉,啟用原來備用值為15s(15秒)。這項的時間間隔值請按實際需求情況設定。
[root@cacti-qmail nagios-3.2.0]# touch /usr/local/nagios/var/nagios.log   
[root@cacti-qmail nagios-3.2.0]# chown nagios.nagios /usr/local/nagios/var/nagios.log    
Nagios的CGI配置文件                      
[root@cacti-qmail nagios-3.2.0]# vi /usr/local/nagios/etc/cgi.cfg
use_authentication=1 (默認是啟動身份驗證)
設定啟用身份驗證
authorized_for_system_information=killer
設定系統(tǒng)信息的授權用戶
authorized_for_configuration_information=killer
設定配置信息的授權用戶
authorized_for_system_commands=killer
設定系統(tǒng)命令的授權用戶
authorized_for_all_services=killer
設定全部監(jiān)測服務的授權用戶。
authorized_for_all_hosts=killer
設定全部被監(jiān)測主機的授權用戶
authorized_for_all_service_commands=killer
設定全部監(jiān)測服務命令的授權用
authorized_for_all_host_commands=killer
設定全部主機命令的授權用戶

apache關于nagios 的配置

 

將apache的運行用戶加到nagios組里面,從httpd.conf中過濾出當前的apache運行用戶
grep "User" /etc/httpd/conf/httpd.conf
usermod -G nagios apache  
或者 直接把User和Group 都改為nagios
User  nagios
Group nagios
 
vim /etc/httpd/conf/httpd.conf
 然后找到
DirectoryIndex index.html index.html.var
修改為
DirectoryIndex index.html index.php
接著增加如下內(nèi)容:
AddType application/x-httpd-php .php
測試nagios是否成功
設置nagios為開機啟動
[root@cacti-qmail ~]#chkconfig nagios on
[root@cacti-qmail ~]# service nagios start
測試nagios是否成功啟動
在IE輸入 http://192.168.100.1/nagios/ 跳出以下窗口

Cacti+Nagios完全攻略(二)nagios配置安裝 Cacti+Nagios完全攻略(二)nagios配置安裝

 
 

網(wǎng)站題目:Cacti+Nagios完全攻略(二)nagios配置安裝
本文鏈接:http://sd-ha.com/article6/jgeoig.html

成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供營銷型網(wǎng)站建設、面包屑導航用戶體驗、網(wǎng)站設計公司小程序開發(fā)、做網(wǎng)站

廣告

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

h5響應式網(wǎng)站建設