nagios4.3.2部署安裝

系統(tǒng)版本

[root@localhost ~]# cat /etc/issue
CentOS release 6.9 (Final)

在此演示安裝版本為nagios-4.3.2休里,nagios-plugins-2.2.1呀伙,nrpe-3.2.0(未安裝)

一、nagios-4.3.2 安裝

1.安裝前的依賴檢查

[root@localhost ~]# yum install httpd php gcc glibc glibc-common gd gd-devel
[root@localhost ~]# useradd -m nagios 
[root@localhost ~]# groupadd nagcmd 
[root@localhost ~]# usermod -a -G nagcmd nagios 
[root@localhost ~]# usermod -a -G nagcmd apache

2.解壓

[root@localhost ~]# cd usr/local/src/
[root@localhost src]# tar xvf nagios-4.3.2.tar.gz
[root@localhost src]# cd nagios-4.3.2

3.安裝

[root@localhost nagios-4.3.2]# ./configure --prefix=/usr/local/nagios --with-command-group=nagcmd --with-nagios-user=nagios --with-nagios-group=Nagios

[root@localhost nagios-4.3.2]# make all 
[root@localhost nagios-4.3.2]# make install 
[root@localhost nagios-4.3.2]# make install-init (生成init啟動(dòng)腳本) 
[root@localhost nagios-4.3.2]# make install-config (生成一些模板配置文件) 
[root@localhost nagios-4.3.2]# make install-commandmode (設(shè)置相應(yīng)的權(quán)限) 
[root@localhost nagios-4.3.2]# make install-webconf (生成Apache配置文件nagios.conf)

4.為Nagios設(shè)置Web驗(yàn)證的密碼派敷。(注意第一次添加用戶用-c選項(xiàng),以后再添加千萬別在用這個(gè)選項(xiàng)了押赊,會(huì)覆蓋以前的所有用戶的抠刺。)

[root@localhost nagios-4.3.2]# htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
New password: 
Re-type new password: 
Adding password for user nagiosadmin

5.設(shè)置nagios的開機(jī)啟動(dòng)

[root@localhost nagios-4.3.2]# chkconfig --add nagios 
[root@localhost nagios-4.3.2]# chkconfig nagios on
[root@localhost nagios-4.3.2]# chkconfig httpd on

6.關(guān)閉SELinux

[root@localhost nagios-4.3.2]# vi /etc/sysconfig/selinux 

SELINUX=disabled 

二、安裝Nagios的插件nagios-plugin

[root@localhost src]# pwd
/usr/local/src
[root@localhost src]# tar xvf nagios-plugins-2.2.1.tar.gz
[root@localhost src]# cd nagios-plugins-2.2.1
[root@localhost nagios-plugins-2.2.1]# ./configure --prefix=/usr/local/nagios --with-nagios-user=nagios --with-nagios-group=Nagios
[root@localhost nagios-plugins-2.2.1]# make && make install

三等孵、驗(yàn)證Nagios的樣例配置文件

[root@localhost nagios-plugins-2.2.1]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Nagios Core 4.3.2
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 2017-05-09
License: GPL

Website: https://www.nagios.org
Reading configuration data...
   Read main config file okay...
   Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
    Checked 8 services.
    Checked 1 hosts.
    Checked 1 host groups.
    Checked 0 service groups.
    Checked 1 contacts.
    Checked 1 contact groups.
    Checked 24 commands.
    Checked 5 time periods.
    Checked 0 host escalations.
    Checked 0 service escalations.
Checking for circular paths...
    Checked 1 hosts
    Checked 0 service dependencies
    Checked 0 host dependencies
    Checked 5 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors:   0

Things look okay - No serious problems were detected during the pre-flight check
如果沒有報(bào)錯(cuò)稚照,可以啟動(dòng)Nagios服務(wù)
service nagios start
使用http://localhost/nagios/來訪問

ps:如果遇到問題!8┟取9肌!

如果遇到關(guān)于cgi什么權(quán)限問題咐熙!察看下/usr/local/nagios的屬主組權(quán)限弱恒,
包括里面的內(nèi)容,
尤其是/usr/local/nagios/etc/htpasswd.users這個(gè)文件的權(quán)限棋恼!都應(yīng)該是nagios:nagios
另外嘗試編輯
vi /usr/local/nagios/etc/cgi.cfg
use_authentication=1
修改為
use_authentication=0
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末返弹,一起剝皮案震驚了整個(gè)濱河市锈玉,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌义起,老刑警劉巖拉背,帶你破解...
    沈念sama閱讀 219,110評(píng)論 6 508
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場(chǎng)離奇詭異默终,居然都是意外死亡椅棺,警方通過查閱死者的電腦和手機(jī)襟沮,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 93,443評(píng)論 3 395
  • 文/潘曉璐 我一進(jìn)店門焕蹄,熙熙樓的掌柜王于貴愁眉苦臉地迎上來本涕,“玉大人赵哲,你說我怎么就攤上這事丛忆》簦” “怎么了蚌铜?”我有些...
    開封第一講書人閱讀 165,474評(píng)論 0 356
  • 文/不壞的土叔 我叫張陵匾嘱,是天一觀的道長(zhǎng)谈况。 經(jīng)常有香客問我勺美,道長(zhǎng),這世上最難降的妖魔是什么鸦做? 我笑而不...
    開封第一講書人閱讀 58,881評(píng)論 1 295
  • 正文 為了忘掉前任励烦,我火速辦了婚禮,結(jié)果婚禮上泼诱,老公的妹妹穿的比我還像新娘坛掠。我一直安慰自己,他們只是感情好治筒,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,902評(píng)論 6 392
  • 文/花漫 我一把揭開白布屉栓。 她就那樣靜靜地躺著,像睡著了一般耸袜。 火紅的嫁衣襯著肌膚如雪友多。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 51,698評(píng)論 1 305
  • 那天堤框,我揣著相機(jī)與錄音域滥,去河邊找鬼。 笑死蜈抓,一個(gè)胖子當(dāng)著我的面吹牛启绰,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播沟使,決...
    沈念sama閱讀 40,418評(píng)論 3 419
  • 文/蒼蘭香墨 我猛地睜開眼委可,長(zhǎng)吁一口氣:“原來是場(chǎng)噩夢(mèng)啊……” “哼!你這毒婦竟也來了腊嗡?” 一聲冷哼從身側(cè)響起着倾,我...
    開封第一講書人閱讀 39,332評(píng)論 0 276
  • 序言:老撾萬榮一對(duì)情侶失蹤拾酝,失蹤者是張志新(化名)和其女友劉穎,沒想到半個(gè)月后卡者,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體蒿囤,經(jīng)...
    沈念sama閱讀 45,796評(píng)論 1 316
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,968評(píng)論 3 337
  • 正文 我和宋清朗相戀三年崇决,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了蟋软。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點(diǎn)故事閱讀 40,110評(píng)論 1 351
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡嗽桩,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出凄敢,到底是詐尸還是另有隱情碌冶,我是刑警寧澤,帶...
    沈念sama閱讀 35,792評(píng)論 5 346
  • 正文 年R本政府宣布涝缝,位于F島的核電站扑庞,受9級(jí)特大地震影響,放射性物質(zhì)發(fā)生泄漏拒逮。R本人自食惡果不足惜罐氨,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,455評(píng)論 3 331
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望滩援。 院中可真熱鬧栅隐,春花似錦、人聲如沸玩徊。這莊子的主人今日做“春日...
    開封第一講書人閱讀 32,003評(píng)論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽恩袱。三九已至泣棋,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間畔塔,已是汗流浹背潭辈。 一陣腳步聲響...
    開封第一講書人閱讀 33,130評(píng)論 1 272
  • 我被黑心中介騙來泰國(guó)打工, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留澈吨,地道東北人把敢。 一個(gè)月前我還...
    沈念sama閱讀 48,348評(píng)論 3 373
  • 正文 我出身青樓,卻偏偏與公主長(zhǎng)得像棚辽,于是被迫代替她去往敵國(guó)和親技竟。 傳聞我的和親對(duì)象是個(gè)殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 45,047評(píng)論 2 355

推薦閱讀更多精彩內(nèi)容