nagios用戶端安裝設定

來源:互聯網
上載者:User

標籤:nagios用戶端

下載安裝包

cd /opt
wget http://nagios-plugins.org/download/nagios-plugins-2.2.1.tar.gz
wget https://github.com/NagiosEnterprises/nrpe/archive/nrpe-3.0.tar.gz

安裝依賴包

yum install -y gcc glibc make cmake glibc-common gd gd-devel php perl-devel mysql-server

編譯安裝nagios-plugins

cd /opt/nagios-plugins-2.1.2
./configure --prefix=/usr/local/nagios
make && make install && echo $?

編譯安裝nrpe

cd /opt/nrpe-3.2.1
./configure --prefix=/usr/local/nagios --enable-command-args
make all
#添加nagios使用者
make install-groups-users
#安裝
make install
#添加主設定檔
make install-config
#配置xinetd
make install-inetd
#設定nrpe管理命令
make install-init
#編譯外掛程式
make check_nrpe
#安裝外掛程式
make install-plugin

配置

#先備份
cp /usr/local/nagios/etc/nrpe.cfg{,.bak}
#修改設定檔
vim /usr/local/nagios/etc/nrpe.cfg
#將hda1改為sda1

command[check_sda1]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/sda1
啟動nrpe

/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d

伺服器端

#組建組態檔案(建議cp原因的設定檔進行修改)(這裡以test命名,建議用主機名稱命名)
cd /usr/local/nagios/etc/servers/
vim test.cfg

## HOST  DEFINITION#define host{        use                     linux-server            ; Name of host template to use                                                        ; This host definition will inherit all variables that are defined                                                        ; in (or inherited by) the linux-server host template definition.        host_name               test #用戶端主機名稱        alias                   test        address                 用戶端IP地址        }## HOST GROUP DEFINITION#               define hostgroup{        hostgroup_name  test; The name of the hostgroup        alias           test; Long name of the group        members         test     ; Comma separated list of hosts that belong to this group        }## service DEFINITION#                   define service{        use                             local-service         ; Name of service template to use        host_name                       test        service_description             Root Partition        check_command                   check_local_disk!20%!10%!/        }               define service{        use                             local-service         ; Name of service template to use        host_name                       study        service_description             Root Partition        check_command                   check_local_disk!20%!10%!/        }                               ......              
重新讀取設定檔

systemctl reload nagios

nagios用戶端安裝設定

相關文章

聯繫我們

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

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

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.