nagios安裝
###############緒論#############################################################################
nagios是一款開源監控軟體,執行在LINUX/UNIX平臺,其配置檔案複雜關聯性,網上給了一個美名”難夠死”。
早期2.X版本,無須安裝PHP,目前新版是3.X,需要PHP的支援。
本文安裝過程是參考的田逸的《網際網路運營智慧》一書,更詳細的可以去檢視。
http://baike.baidu.com/view/5017732.htm
#################################################################################################
##############前提條件########################################################################
nagios是基於LAMP環境(linux+apache+mysql+php)搭建的,所以首先要先把這個環境跑起來,
然後再編譯安裝nagios。
監控端只需把mysql軟體包傳上去即可,無須安裝,目的是在編譯naigos-plugin時,生成check_mysql命令。
監控端需要安裝 nagios-3.2.1.tar.gz
nagios-plugins-1.4.14.tar.gz
nrpe-2.12.tar.gz
被監控端需要安裝 nagios-plugins-1.4.14.tar.gz
nrpe-2.12.tar.gz
##############################################################################################
###############涉及的nagios配置檔案################################
nagios.cfg ——主配置檔案,用來修改物件配置檔案
cgi.cfg —— 允許訪問nagios網頁平臺使用者配置檔案
htpasswd.users —— 登陸nagios網頁平臺使用者名稱和密碼存放的加密檔案
resource.cfg —— 用來存放nagios命令外掛配置檔案
nrpe.cfg —— 被監控端監控資源配置檔案
commands.cfg —— 監控命令配置檔案
templates.cfg —— 監控模板檔案
timeperiods.cfg —— 時間模板檔案
contacts.cfg —— 故障時通知的聯絡人配置檔案
contactgroups.cfg —— 故障時通知的聯絡人組配置檔案
hosts —— 監控主機配置檔案
hostgroups —— 監控主機組配置檔案
services —— 監控主機服務配置檔案
####################################################################
##############
###安裝步驟###
##############
##########首先安裝gcc包,用於編譯安裝軟體用################
yum –disablerepo=* –enablerepo=c5-media install *gcc*
###########################################################
#############Apache########################################
./configure –prefix=/usr/local/apache –enable-so
make
make install
# vi /usr/local/apache/conf/httpd.conf
AddType application/x-httpd-php .php
Include conf/nagios.conf
###########################################################
######PHP-plugin#########################################
./configure –prefix=/usr/local/libiconv
make
make install
yum –disablerepo=* –enablerepo=c5-media install *freetype* *jpeg* *png* *gd* *libxml*
#########################################################
#############mysql####################
vi /etc/ld.so.conf
/usr/local/mysql/lib
ldconfig -v
vi /root/.bash_profile
PATH=$PATH:$HOME/bin:/usr/local/mysql/bin
GRANT ALL PRIVILEGES ON *.* TO `admin`@`%` IDENTIFIED BY `123456`;
flush privileges;
######################################
######PHP############################
./configure –prefix=/usr/local/php –with-apxs2=/usr/local/apache/bin/apxs –with-mysql=/usr/local/mysql –with-libxml-dir –with-iconv=/usr/local/libiconv –with-config-file-path=/usr/local/php/etc –with-gd –with-freetype-dir –with-jpeg-dir –with-png-dir –with-zlib –with-ldap –with-ldap-sasl –with-gettext –enable-mbstring –enable-sockets
make ZEND_EXTRA_LIBS=`-liconv`
make install
cp php.ini-dist /usr/local/php/etc/php.ini
######################################
############naigos####################
useradd nagios
./configure –prefix=/usr/local/nagios –with-command-group=nagios
make all
make install
make install-init
make install-config
make install-commandmode
make install-webconf
([root@vm01 nagios-3.2.1]# make install-webconf
/usr/bin/install -c -m 644 sample-config/httpd.conf /etc/httpd/conf.d/nagios.conf
/usr/bin/install: 無法建立一般檔案“/etc/httpd/conf.d/nagios.conf”: 沒有那個檔案或目錄
make: *** [install-webconf] 錯誤 1)
mkdir -p /etc/httpd/conf.d/
[root@vm01 nagios-3.2.1]# make install-webconf
/usr/bin/install -c -m 644 sample-config/httpd.conf /etc/httpd/conf.d/nagios.conf
*** Nagios/Apache conf file installed ***
/usr/local/apache/bin/htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
chkconfig –add nagios
chkconfig nagios on
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
######################################
###########naigos-plugin##############
./configure –prefix=/usr/local/nagios –with-nagios-user=nagios –with-nagios-group=nagios –with-mysql
make && make install
######################################
############nrpe#####################
./configure –enable-command-args
make all
make install-plugin
make install-daemon
make install-daemon-config
vi nrpe.cfg
dont_blame_nrpe=1
/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
/usr/local/nagios/libexec/check_nrpe -H localhost
#######################################
nagios是一款開源監控軟體,執行在LINUX/UNIX平臺,其配置檔案複雜關聯性,網上給了一個美名”難夠死”。
早期2.X版本,無須安裝PHP,目前新版是3.X,需要PHP的支援。
本文安裝過程是參考的田逸的《網際網路運營智慧》一書,更詳細的可以去檢視。
http://baike.baidu.com/view/5017732.htm
#################################################################################################
##############前提條件########################################################################
nagios是基於LAMP環境(linux+apache+mysql+php)搭建的,所以首先要先把這個環境跑起來,
然後再編譯安裝nagios。
監控端只需把mysql軟體包傳上去即可,無須安裝,目的是在編譯naigos-plugin時,生成check_mysql命令。
監控端需要安裝 nagios-3.2.1.tar.gz
nagios-plugins-1.4.14.tar.gz
nrpe-2.12.tar.gz
被監控端需要安裝 nagios-plugins-1.4.14.tar.gz
nrpe-2.12.tar.gz
##############################################################################################
###############涉及的nagios配置檔案################################
nagios.cfg ——主配置檔案,用來修改物件配置檔案
cgi.cfg —— 允許訪問nagios網頁平臺使用者配置檔案
htpasswd.users —— 登陸nagios網頁平臺使用者名稱和密碼存放的加密檔案
resource.cfg —— 用來存放nagios命令外掛配置檔案
nrpe.cfg —— 被監控端監控資源配置檔案
commands.cfg —— 監控命令配置檔案
templates.cfg —— 監控模板檔案
timeperiods.cfg —— 時間模板檔案
contacts.cfg —— 故障時通知的聯絡人配置檔案
contactgroups.cfg —— 故障時通知的聯絡人組配置檔案
hosts —— 監控主機配置檔案
hostgroups —— 監控主機組配置檔案
services —— 監控主機服務配置檔案
####################################################################
##############
###安裝步驟###
##############
##########首先安裝gcc包,用於編譯安裝軟體用################
yum –disablerepo=* –enablerepo=c5-media install *gcc*
###########################################################
#############Apache########################################
./configure –prefix=/usr/local/apache –enable-so
make
make install
# vi /usr/local/apache/conf/httpd.conf
AddType application/x-httpd-php .php
Include conf/nagios.conf
###########################################################
######PHP-plugin#########################################
./configure –prefix=/usr/local/libiconv
make
make install
yum –disablerepo=* –enablerepo=c5-media install *freetype* *jpeg* *png* *gd* *libxml*
#########################################################
#############mysql####################
vi /etc/ld.so.conf
/usr/local/mysql/lib
ldconfig -v
vi /root/.bash_profile
PATH=$PATH:$HOME/bin:/usr/local/mysql/bin
GRANT ALL PRIVILEGES ON *.* TO `admin`@`%` IDENTIFIED BY `123456`;
flush privileges;
######################################
######PHP############################
./configure –prefix=/usr/local/php –with-apxs2=/usr/local/apache/bin/apxs –with-mysql=/usr/local/mysql –with-libxml-dir –with-iconv=/usr/local/libiconv –with-config-file-path=/usr/local/php/etc –with-gd –with-freetype-dir –with-jpeg-dir –with-png-dir –with-zlib –with-ldap –with-ldap-sasl –with-gettext –enable-mbstring –enable-sockets
make ZEND_EXTRA_LIBS=`-liconv`
make install
cp php.ini-dist /usr/local/php/etc/php.ini
######################################
############naigos####################
useradd nagios
./configure –prefix=/usr/local/nagios –with-command-group=nagios
make all
make install
make install-init
make install-config
make install-commandmode
make install-webconf
([root@vm01 nagios-3.2.1]# make install-webconf
/usr/bin/install -c -m 644 sample-config/httpd.conf /etc/httpd/conf.d/nagios.conf
/usr/bin/install: 無法建立一般檔案“/etc/httpd/conf.d/nagios.conf”: 沒有那個檔案或目錄
make: *** [install-webconf] 錯誤 1)
mkdir -p /etc/httpd/conf.d/
[root@vm01 nagios-3.2.1]# make install-webconf
/usr/bin/install -c -m 644 sample-config/httpd.conf /etc/httpd/conf.d/nagios.conf
*** Nagios/Apache conf file installed ***
/usr/local/apache/bin/htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
chkconfig –add nagios
chkconfig nagios on
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
######################################
###########naigos-plugin##############
./configure –prefix=/usr/local/nagios –with-nagios-user=nagios –with-nagios-group=nagios –with-mysql
make && make install
######################################
############nrpe#####################
./configure –enable-command-args
make all
make install-plugin
make install-daemon
make install-daemon-config
vi nrpe.cfg
dont_blame_nrpe=1
/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
/usr/local/nagios/libexec/check_nrpe -H localhost
#######################################
mount -t iso9660 -o loop /home/rhel-server-5.5-x86_64-dvd.iso /var/ftp/pub/
本文轉自 liang3391 51CTO部落格,原文連結:http://blog.51cto.com/liang3391/723513
相關文章
- Nagios安裝步驟iOS
- Nagios+PNP安裝部署iOS
- CentOS原始碼安裝、配置Nagios(core)+PluginsCentOS原始碼iOSPlugin
- 如何在 CentOS 8/RHEL 8 上安裝和配置 Nagios CoreCentOSiOS
- nagios mail告警通知iOSAI
- Nagios+Centreon監控系統簡介iOS
- Cacti+Nagios監控平臺完美整合iOS
- 安裝npm 解除安裝npm 安裝apidocNPMAPI
- BiocManager安裝,devtools安裝dev
- nagios 呼叫webhook 給微信發告警資訊iOSWebHook
- Linux安裝解除安裝MySQLLinuxMySql
- linux 安裝yum 安裝phpLinuxPHP
- Ubuntu解除安裝和安裝Ubuntu
- 02 安裝git、安裝TortoiseGitGit
- cocoapods安裝/解除安裝/使用
- JDK安裝和解除安裝JDK
- ffmpeg安裝之mac安裝Mac
- docker安裝及解除安裝Docker
- [ 安裝 ] Zeppelin安裝步驟!
- win10安裝版怎麼安裝_安裝版win10安裝教程Win10
- 監控系統:深度對比Zabbix、Nagios、Pandora FMSiOS
- ElasticSearch的安裝和使用,Postman的安裝,Kibana的安裝,EShead外掛的安裝ElasticsearchPostman
- Mac Redis安裝與解除安裝MacRedis
- 安裝了IDLE後安裝tensorflow
- kratos安裝及依賴安裝
- Linux 解除安裝openjdk 安裝oraclejdkLinuxJDKOracle
- debian安裝和解除安裝vmware
- JDK的安裝與解除安裝JDK
- linux 解除安裝jdk和安裝LinuxJDK
- 【推薦 - glibc安裝】MySQL - 安裝MySql
- linux下安裝snap安裝工具Linux
- [雲原生]Docker - 安裝&解除安裝Docker
- Ubuntu安裝和解除安裝mongodbUbuntuMongoDB
- window下安裝並使用nvm(含解除安裝node、解除安裝nvm、全域性安裝npm)NPM
- 安裝
- air安裝win10怎麼解除安裝_air安裝win10如何解除安裝AIWin10
- 使用Nagios打造專業的業務狀態監控iOS
- Centos Docker安裝、升級、解除安裝CentOSDocker
- Webpack學習 – Webpack安裝及安裝Web