Nagios安裝步驟
客戶端
nrpe-2.15.tar.gz
nagios-plugins-2.0.2.tar.gz
服務端
nagios-4.0.8.tar.gz
nrpe-2.15.tar.gz
nagios-plugins-2.0.2.tar.gz
服務端不安裝nrpe-2.15.tar.gz包會報錯/usr/local/nagios/libexec/check_nrpe, ... failed. errno is 2: No such file or directory
伺服器端需要安裝下面三個包,客戶端只需要安裝後兩個包:
Nagios Core nagios-4.0.8.tar.gz
Nagios Plugins nagios-plugins-2.0.2.tar.gz
Nagios Addons nrpe-2.15.tar.gz
NSClient++也是Nagios Addons中的一種
下載地址
nagios-4.0.8.tar.gz和nrpe-2.15.tar.gz
nagios-plugins-2.0.2.tar.gz
客戶端安裝
參考NRPE.pdf中Remote Host Setup
其中/etc/xinetd.d/nrpe檔案的only_from填寫是本機127.0.0.1和伺服器端的IP
1、useradd nagios
passwd nagios
2、tar -xzvf nagios-plugins-2.0.2.tar.gz
cd nagios-plugins-2.0.2
./configure
make
make install
3、chown nagios.nagios /usr/local/nagios
chown -R nagios.nagios /usr/local/nagios/libexec
4、yum install xinetd
5、tar -zxvf nrpe-2.15.tar.gz
cd nrpe-2.15
./configure
make all
make install-plugin
make install-daemon
make install-daemon-config
make install-xinetd
6、vi /etc/xinetd.d/nrpe
only_from=127.0.0.1 服務端IP
比如:only_from = 127.0.0.1 192.168.30.190
vi /etc/services
nrpe 5666/tcp # NRPE
7、service xinetd restart
netstat -at | grep nrpe結果如下即可
tcp 0 0 *:nrpe *:* LISTEN
/usr/local/nagios/libexec/check_nrpe -H 127.0.0.1返回如下結果即可
NRPE v2.15
8、如果客戶端配置了防火牆,vi /etc/sysconfig/iptables新增如下5666埠例外的規則
-A INPUT -m state --state NEW -m tcp -p tcp --dport 5666 -j ACCEPT
服務端安裝
參考或
#CentOS或
http://blog.51cto.com/guojiping/1293933
百度關鍵字《Quickstart · Nagios Core Documentation》
1、關閉SELINUX安全檢查,即getenforce命令的結果不能是Enforcing
sed -i 's/SELINUX=.*/SELINUX=disabled/g' /etc/selinux/config
setenforce 0
2、安裝必要的補丁包
yum install -y gcc glibc glibc-common wget unzip httpd php gd gd-devel perl postfix
3、編譯nagios服務端rpm包nagios-4.0.8.tar.gz
tar xzf nagioscore.tar.gz
cd nagioscore-nagios-4.4.1/
./configure
make all
4、建立nagios使用者,並把apache使用者加入nagios組
useradd nagios
usermod -a -G nagios apache
5、繼續上面3之後的編譯安裝
make install
make install-daemoninit
make install-commandmode
make install-config
make install-webconf
6、把apache加入自啟動,關閉防火牆或把80埠放入防火牆白名單
chkconfig --level 2345 httpd on
service iptales stop
7、建立nagios的web登入賬戶nagiosadmin
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
8、啟動apache和nagios
service httpd start
service nagios start
9、登入nagios伺服器的web介面
10、再安裝
nrpe-2.15.tar.gz
nagios-plugins-2.0.2.tar.gz
11、重啟nagios
service nagios restart
如果不想監控伺服器本機,就把伺服器端/usr/local/nagios/etc/nagios.cfg中的配置cfg_file=/usr/local/nagios/etc/objects/localhost.cfg註釋掉
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30126024/viewspace-2199963/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- vnc安裝步驟,vnc安裝步驟詳解VNC
- [ 安裝 ] Zeppelin安裝步驟!
- xftp安裝步驟,xftp安裝的2大步驟FTP
- STF 安裝步驟
- anaconda安裝步驟
- Linux 安裝步驟Linux
- vnc安裝步驟,如何在Linux(CentOS 7)下vnc安裝步驟VNCLinuxCentOS
- Sublime Text安裝步驟
- aws安裝jenkins步驟Jenkins
- Iris 框架安裝步驟框架
- zookeeper安裝部署步驟
- windows安裝cnpm步驟WindowsNPM
- Maya 2023安裝步驟
- charles的安裝步驟
- Linux安裝Nginx步驟LinuxNginx
- 安裝jdk的步驟JDK
- Nagios+PNP安裝部署iOS
- vnc安裝步驟,4個在Linux下vnc的個安裝步驟VNCLinux
- ubuntu 下安裝nginx步驟UbuntuNginx
- linux下安裝docker步驟LinuxDocker
- CDH6.2.0安裝步驟
- Android studio的安裝步驟Android
- MHA安裝和部署步驟
- 【Nginx1.12.2安裝步驟】Nginx
- 國內Kubernetes安裝步驟
- Linux安裝JDK完整步驟LinuxJDK
- 如何安裝discuz論壇,discuz安裝步驟
- Mac安裝Redis,詳細redis安裝步驟MacRedis
- vnc安裝步驟,4個vnc安裝步驟實現vnc與Linux的連線VNCLinux
- 安裝sogou輸入法步驟:Go
- PostgreSQL簡介及安裝步驟SQL
- Laravel Homestead windos Mac 安裝步驟LaravelMac
- Linux 下安裝 LR Generator 步驟Linux
- dp安裝包升級步驟
- LNMP之PHP安裝操作步驟LNMPPHP
- Ubuntu 20.10的Docker安裝步驟UbuntuDocker
- docker安裝portainer詳細步驟DockerAI
- MySQL的安裝步驟(詳細)MySql