nagios安裝過程

2021-08-30 07:00:39 字數 2608 閱讀 8414

nagios的有點在於他本身只是乙個框架,對於nagios擴充套件監控模組,以及報警模組非常方便,能很方便的加入自己編寫的服務監控,以及手機簡訊,郵件,gtalk ,msn報警等等。

以下是nagios在linux redhat as4u4 下的安裝和簡單的配置過程:

wget

wget

wget

新增使用者:

useradd -m nagios

passwd nagios

groupadd nagcmd

usermod -g nagcmd nagios

usermod -g nagcmd daemon

編譯安裝nagios

tar -xvzf nagios-3.0.3.tar.gz

cd nagios-3.0.3

./configure --with-command-group=nagcmd

make all

make install

make install-init

make install-config

make install-commandmode

設定apache伺服器訪問密碼:

配置apache的cgi ,具體配置如下:

scriptalias /nagios/cgi-bin /usr/local/nagios/sbin

options execcgi

allowoverride none

order allow,deny

allow from all

authname "nagios access"

authtype basic

authuserfile /usr/local/nagios/etc/htpasswd.users

require valid-user

alias /nagios /usr/local/nagios/share

options none

allowoverride none

order allow,deny

allow from all

authname "nagios access"

authtype basic

authuserfile /usr/local/nagios/etc/htpasswd.users

require valid-user

重啟apache

/usr/local/apache/bin/apachectl configtest

/usr/local/apache/bin/apachectl stop

/usr/local/apache/bin/apachectl start

安裝nagios外掛程式

tar -xvzf nagios-plugins-1.4.12.tar.gz

cd nagios-plugins-1.4.12

./configure --with-nagios-user=nagios --with-nagios-group=nagios

make

make install

chkconfig --add nagios

chkconfig nagios on

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

service nagios start

現在你可以通過瀏覽器訪問監控的介面了,

現在你僅僅能看到對於本機的監控,接下來我們新增乙個http服務的監控

cd /usr/local/nagios/

vi nagios.cfg

新增一行:

cfg_file=/usr/local/nagios/etc/objects/wwws.cfg

編寫配置wwws.cfg

touch objects/hosts.cfg objects/wwws.cfg

vi objects/wwws.cfg

具體內容如下:

define host

define hostgroup

define service

請根據具體情況修改為你要監控的主機以及網域名稱,現在來看看你的配置檔案是否正確:

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

如果爭取,請重啟nagios伺服器

service nagios start

接下來請去瀏覽器看看吧,如果在host部分看到pending別奇怪啊,我們只設定了監控www伺服器,如果你需要監控alive ,請參考localhost.cfg配置檔案。

在libexec目錄下,所有的監控指令碼和應用都在,你可以用 prog -h ,檢視如何使用這些監控指令碼和程式。如果你自己寫的程式最好也放在這個目錄下。

官網 Nagios快速安裝過程詳解(只提供參考)

在做安裝之前確認要對該機器擁有root許可權 確認你安裝好的linux系統上已經安裝如下軟體包再繼續 gcc編譯器 yum安裝 gd庫與開發庫 yum安裝 可以用yum命令來安裝這些軟體包 當然也可以用原始碼手動編譯安裝 鍵入命令 yum install httpd yum install gcc ...

tripwire安裝過程

在as4上測試通過。找到twinstall.sh檔案所在的位置 我安裝的時候找到http download1.csdn.net down3 20070523 23220246809.rpm的是twinstall.sh.in 拷貝到 etc tripwire目錄下,並修改檔案,設定好twadmin檔案...

XAMPP安裝過程

方法 a 使用安裝包進行安裝 使用安裝包來安裝 xampp 是最簡單的方法。xampp win32 的安裝嚮導 安裝過程結束後,您會在 開始 程式 xampp 選單下找到 xampp。您可以使用 xampp 控制面板來啟動 停止所有服務或安裝 解除安裝所有服務。xampp 控制面板能啟動 停止 ap...