nagios的日常管理和維護

來源:互聯網
上載者:User

1、驗證Nagios設定檔的正確性

nagios在驗證設定檔方面做的非常到位,只需通過一個命令即可完成:/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfgNagios提供的這個驗證功能非常有用,在錯誤資訊中通常會列印出錯誤的設定檔以及檔案中的哪一行,這使得nagios的配置變得非常容易,警示資訊通常是可以忽略的,因為一般那些只是建議性的。

2、 啟動與停止nagios

(1)啟動nagiosü通過初始化指令碼啟動nagios/etc/init.d/nagios start或者Service nagios startü手工方式啟動nagios通過nagios命令的“-d”參數來啟動nagios守護進程:/usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg

(2)關閉nagiosü通過初始化指令碼關閉nagios服務/etc/init.d/nagios stop或者Service nagios stopü通過kill方式關閉nagioskill <nagios_pid>

(3)重啟nagiosü通過初始化指令碼來重啟nagios/etc/rc.d/init.d/nagios reload/etc/rc.d/init.d/nagios restartü通過web監控頁重啟nagios

3.nagios效能分析圖表

(1)nagios效能分析圖表的作用Nagios對服務或主機監控的是一個瞬時狀態,有時候系統管理員如果需要瞭解主機在一段時間內的效能以及服務的響應狀態,並且形成圖表時,就需要通過查看日誌資料來分析,但是這種方式不但繁瑣,而且抽象,不過幸運的是,PNP可以協助我們來完成這個工作。

(2) PNP的概念與安裝環境PNP是一個小巧的開源軟體包,它基於PHP和PERL,PNP可以利用rrdtool工具將Nagios採集的資料繪製成相關的圖表,然後顯示主機或者服務在一段時間內的健全狀態。PNP官方網站為:http://www.pnp4nagios.org如果要安裝PNP,首先需要安裝如下環境:1:整合後的apache何PHP環境,需支援GDzlibjpeg2:安裝rrdtool工具3:安裝perl

RRDtool是一個圖表產生工具,可以從http://www.mrtg.org/rrdtool/獲得資訊。這裡下載的版本是rrdtool-1.4.5.tar.gz,

安裝過程如下:

[root@nagios rrdtool]# tar zxvf rrdtool-1.4.5.tar.gz

[root@nagios rrdtool]# cd rrdtool-1.4.5

[root@nagios rrdtool-1.4.5]# ./configure --perfix=/usr/local/rrdtool

[root@nagios rrdtool-1.4.5]# make

[root@nagios rrdtool-1.4.5]# make install

配置時報錯:./configure --prefix=/usr/local/rrdtool

configure: WARNING:
----------------------------------------------------------------------------
* I could not find a working copy of glib-2.0. Check config.log for hints on why
this is the case. Maybe you need to set LDFLAGS and CPPFLAGS appropriately
so that compiler and the linker can find libglib-2.0 and its header files. If
you have not installed glib-2.0, you can get it either from its original home on

ftp://ftp.gtk.org/pub/glib/2.12/

You can find also find an archive copy on

http://oss.oetiker.ch/rrdtool/pub/libs

The last tested version of glib-2.0 is 2.12.12.

     LIBS=-lm  -lwrap
 LDFLAGS=
CPPFLAGS=

----------------------------------------------------------------------------

checking for pango_cairo_context_set_font_options in -lpangocairo-1.0... no
checking for pkg-config... (cached) pkg-config
configure: WARNING:
----------------------------------------------------------------------------
* I found a copy of pkgconfig, but there is no pangocairo.pc file around.
You may want to set the PKG_CONFIG_PATH variable to point to its
location.
----------------------------------------------------------------------------

configure: WARNING:
----------------------------------------------------------------------------
* I could not find a working copy of pangocairo. Check config.log for hints on why
this is the case. Maybe you need to set LDFLAGS and CPPFLAGS appropriately
so that compiler and the linker can find libpangocairo-1.0 and its header files. If
you have not installed pangocairo, you can get it either from its original home on

http://ftp.gnome.org/pub/GNOME/sources/pango/1.17

You can find also find an archive copy on

http://oss.oetiker.ch/rrdtool/pub/libs

The last tested version of pangocairo is 1.17.

     LIBS=-lm  -lwrap
 LDFLAGS=
CPPFLAGS=

----------------------------------------------------------------------------

checking for xmlParseFile in -lxml2... yes
checking libxml/parser.h usability... yes
checking libxml/parser.h presence... yes
checking for libxml/parser.h... yes
configure: error: Please fix the library issues listed above and try again.

解決方案是:

yum install -y glib libpng pixman pango-devel

相關文章

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。