溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

nagios編譯安裝、搭建

發(fā)布時(shí)間:2020-06-22 16:19:02 來(lái)源:網(wǎng)絡(luò) 閱讀:659 作者:xi慣孤單 欄目:移動(dòng)開發(fā)

基本準(zhǔn)備

yum -y install httpd php mysql-devel php-mysql            安裝需要的包

groupadd nagcmd                                    創(chuàng)建nagios的管理組

useradd –g nagcmd nagios                            nagios添加到組nagioscmd內(nèi)

usermod -a -G nagcmd apache                        apache加入到組nagcmd內(nèi)

yum –y install gcc                                     編譯安裝的需要

安裝httpdapache環(huán)境】

[root@zhangpub]# tar zxvf nagios-3.0.6.tar.gz

[root@localhosthttpd-2.2.6]# cd /var/ftp/upload/httpd-2.2.6

[root@localhosthttpd-2.2.6]# ./configure --prefix=/usr/local/apache  

[root@localhosthttpd-2.2.6]# make

[root@localhosthttpd-2.2.6]# make install


[root@localhost httpd-2.2.6]#service httpd start

Starting httpd: httpd: Could notreliably determine the server's fully qualified domain name, usinglocalhost.localdomain for ServerName

(98)Address already in use:make_sock: could not bind to address [::]:80

(98)Address already in use:make_sock: could not bind to address 0.0.0.0:80

no listening sockets available,shutting down

Unable to open logs

                                                         [FAILED]

[root@localhost httpd-2.2.6]#(98)Address already in use: make_sock: could not bind to address [::]:80

-bash: syntax error nearunexpected token `Address'

[root@localhost httpd-2.2.6]#(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80

-bash: syntax error nearunexpected token `Address'


啟動(dòng)報(bào)錯(cuò):


[root@localhosthttpd-2.2.6]# netstat -lnp|grep 80

tcp        0     0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      3536/nginx

tcp        0     0 127.0.0.1:631              0.0.0.0:*                   LISTEN      1802/cupsd

tcp        0     0 ::1:631                    :::*                        LISTEN      1802/cupsd

udp        0     0 0.0.0.0:631                0.0.0.0:*                              1802/cupsd

unix  2     [ ACC ]     STREAM     LISTENING     15688 2517/gnome-power-ma /tmp/orbit-root/linc-9d5-0-e7ccb8c8800b

unix  2     [ ACC ]     STREAM     LISTENING     10437 1802/cupsd         /var/run/cups/cups.sock


kill 掉進(jìn)程。


Kill -93536


再次啟動(dòng)httpd服務(wù)

[root@localhosthttpd-2.2.6]#service httpd start


安裝nagios

#useraddnagios –s /sbin/nologin

#tar zxvfnagios-3.0.6.tar.gz

#cdnagios-3.0.6


./configure--sysconfdir=/etc/nagios --with-commend-group=nagcmd --enable-event-broker


#make all 查看安裝步驟

有如下內(nèi)容

*** Compile finished ***

If the main program and CGIscompiled without any errors, you

can continue with installingNagios as follows (type 'make'

without any arguments for a listof all possible options):

make install

    - This installs the main program, CGIs,and HTML files

make install-init

    - This installs the init script in/etc/rc.d/init.d

makeinstall-commandmode

    - This installs and configures permissionson the

      directory for holding the externalcommand file

makeinstall-config

    - This installs *SAMPLE* config files in/usr/local/nagios--with-nagios-user=nagios--with-nagios-group=nagios/etc

      You'll have to modify these sample filesbefore 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 theydetermine what/how

      things get monitored!

makeinstall-webconf

    - This installs the Apache config file forthe Nagios

      web interface

*** Support Notes*******************************************


編譯安裝

make all                                            安裝主程序、CGIHTML文件

make install                                        /etc/rc.d/init.d 安裝啟動(dòng)腳本

make install-init    nagios做成一個(gè)運(yùn)行腳本,使nagios隨系統(tǒng)開機(jī)啟動(dòng),這是一個(gè)很方便的措施。

make install-commendmode                來(lái)配置目錄權(quán)限

make install-config    把配置文件的例子復(fù)制到nagios的安裝目錄

make install-webconf        創(chuàng)建一個(gè)nagiosadmin的用戶用于nagiosweb接口登錄



htpasswd-c /etc/nagios/htpasswd.users nagiosadmin

Newpassword:

Re-typenew password:

Addingpassword for user nagiosadmin

配置密碼。


service httpd restart                                啟動(dòng)apache服務(wù)

chkconfig --add nagios   nagios加入到服務(wù)中

chkconfig nagios on  開機(jī)啟動(dòng)

servicenagios start


Nagios-plugins 安裝

[root@localhost upload]# tar zxvf nagios-plugins-1.4.13        解壓

[root@localhost upload]# cd nagios-plugins-1.4.13        進(jìn)入文件夾

[root@localhost nagios-plugins-1.4.13]#./configure--with-nagios-user=nagios --with-nagios-group=nagios                                        執(zhí)行配置



[root@localhost nagios-plugins-1.4.13]# make            進(jìn)行編譯安裝

[root@localhostnagios-plugins-1.4.13]# make install

[root@localhostnagios-plugins-1.4.13]# service nagios restart


關(guān)閉selinux

setenforce0


訪問nagios

IP/nagios

nagios編譯安裝、搭建

輸入賬號(hào)密碼。


默認(rèn)已在監(jiān)控localhost


向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI