CentOSx64 源碼安裝nagios與nagios-plugin
成都創(chuàng)新互聯(lián)公司從2013年開始,先為桐鄉(xiāng)等服務建站,桐鄉(xiāng)等地企業(yè),進行企業(yè)商務咨詢服務。為桐鄉(xiāng)企業(yè)網(wǎng)站制作PC+手機+微官網(wǎng)三網(wǎng)同步一站式服務解決您的所有建站問題。官方網(wǎng)址:http://www.nagios.org
一、安裝指導:
http://nagios.sourceforge.net/docs/3_0/quickstart-fedora.html
二、nagios的配置
1)修改/usr/local/nagios/etc/nagios.cnf 文件修改如下:
#cfg_file=/usr/local/nagios/etc/objects/windows.cfg
cfg_file=/usr/local/nagios/etc/objects/hosts.cfg
cfg_file=/usr/local/nagios/etc/objects/services.cfg
2)在/usr/local/nagios/etc/objects/目錄下建立主機文件hosts.cfg和服務文件services.cfg兩個文件
#touch hosts.cfg
#touch services.cfg
#chown -R nagios:nagcmd hosts.cfg
#chown -R nagios:nagcmd services.cfg
#chmod -R 755 hosts.cfg
#chmod -R 755 services.cfg
3)在hosts.cfg和services.cfg ,添加如下內(nèi)容:
#vi hosts.cfg
define hostgroup{
hostgroup_name windows-servers ; The name of the hostgroup
alias Windows Servers ; Long name of the group
}
define host {
host_name 118.X.35.226
alias SingTel_Main_Broadcast
address 118.X.35.226
check_command check-host-alive
check_period 24x7
notification_period 24x7
use windows-server
}
define host {
host_name 118.X.35.242
alias SingTel_Backup_Broadcast
address 118.X.35.242
check_command check-host-alive
check_period 24x7
notification_period 24x7
use windows-server
}
#define host {
# host_name 118.X.35.241
# alias Cisco router
# address 118.X.35.241
# check_command check-host-alive
# check_period 24x7
# notification_period 24x7
#}
#define host {
# host_name 118.X.35.225
# alias Juniper Firewall
# address 118.X.35.225
# check_command check-host-alive
# check_period 24x7
# notification_period 24x7
#
#}
~
#vi services.cfg
define service {
service_description PING
check_interval 5
retry_interval 1
check_command check_ping!3000.0,80%!5000.0,100%
host_name 118.X.35.226,118.X.35.242
hostgroup_name windows-servers
check_period 24x7
notification_period 24x7
max_check_attempts 5
# notification_interval 5
use local-service
contact_groups +admins
}
define service {
service_description C:\ Drive Space
check_command check_nt!USEDDISKSPACE!-l c -w 92 -c 95
host_name 118.X.35.226,118.X.35.242
hostgroup_name windows-servers
check_period 24x7
notification_period 24x7
max_check_attempts 1
check_interval 1
use generic-service
contact_groups +admins
}
define service {
service_description D:\ Drive Space
check_command check_nt!USEDDISKSPACE!-l d -w 92 -c 95
host_name 118.X.35.226,118.X.35.242
check_period 24x7
notification_period 24x7
max_check_attempts 1
check_interval 1
use generic-service
hostgroup_name windows-servers
contact_groups +admins
}
define service {
service_description Z:\ Drive Space
check_command check_nt!USEDDISKSPACE!-l z -w 96 -c 98
host_name 118.X.35.226,118.X.35.242
check_period 24x7
notification_period 24x7
max_check_attempts 1
check_interval 1
use generic-service
hostgroup_name windows-servers
contact_groups +admins
}
define service {
service_description Recv_XD
check_command check_nt!PROCSTATE!-d SHOWALL -l Recv_XD.exe
host_name 118.X.35.226
check_period 24x7
notification_period 24x7
max_check_attempts 1
check_interval 1
use generic-service
contact_groups +admins
}
define service {
service_description GoodSync_client
check_command check_nt!PROCSTATE!-d SHOWALL -l GoodSync.exe
host_name 118.X.35.242
check_period 24x7
notification_period 24x7
max_check_attempts 1
check_interval 1
use generic-service
contact_groups +admins
}
define service {
service_description TSPlay_Program
check_command check_nt!PROCSTATE!-d SHOWALL -l TSServer.exe
host_name 118.X.35.226,118.X.35.242
check_period 24x7
notification_period 24x7
max_check_attempts 1
check_interval 1
use generic-service
contact_groups +admins
}
define service {
service_description IIS Service
check_command check_nt!SERVICESTATE!-d SHOWALL -l W3SVC
host_name 118.X.35.226,118.X.35.242
check_period 24x7
notification_period 24x7
max_check_attempts 1
check_interval 1
use generic-service
contact_groups +admins
}
define service {
service_description MSSQLSERVER
check_command check_nt!SERVICESTATE!-d SHOWALL -l MSSQLSERVER
host_name 118.X.35.226,118.X.35.242
check_period 24x7
notification_period 24x7
max_check_attempts 1
check_interval 1
use generic-service
contact_groups +admins
}
define service {
service_description Apache Tomcat
check_command check_nt!SERVICESTATE!-d SHOWALL -l Tomcat6
host_name 118.X.35.226
check_period 24x7
notification_period 24x7
max_check_attempts 1
check_interval 1
use generic-service
contact_groups +admins
}
define service {
service_description http-8080
check_command check_tcp!8080 -t 5!
host_name 118.X.35.226
check_period 24x7
notification_period 24x7
max_check_attempts 1 最多檢查一次(默認3次)
check_interval 1 檢查間隔1分鐘,有問題發(fā)郵件
use generic-service
contact_groups +admins
}
#/etc/init.d/nagios start
日志文件: tail -f /var/log/messages
4)訪問網(wǎng)址:http://ip/nagios
另外有需要云服務器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務器、裸金屬服務器、高防服務器、香港服務器、美國服務器、虛擬主機、免備案服務器”等云主機租用服務以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應用場景需求。
分享標題:CentOS源碼安裝nagios與nagios-plugin-創(chuàng)新互聯(lián)
本文鏈接:http://muchs.cn/article20/cdgeco.html
成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供面包屑導航、域名注冊、自適應網(wǎng)站、網(wǎng)站營銷、網(wǎng)站改版、ChatGPT
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉載內(nèi)容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容