Your SlideShare is downloading. ×
0
use Nagios on openSUSE 11.4
use Nagios on openSUSE 11.4
use Nagios on openSUSE 11.4
use Nagios on openSUSE 11.4
use Nagios on openSUSE 11.4
use Nagios on openSUSE 11.4
use Nagios on openSUSE 11.4
use Nagios on openSUSE 11.4
use Nagios on openSUSE 11.4
use Nagios on openSUSE 11.4
use Nagios on openSUSE 11.4
use Nagios on openSUSE 11.4
use Nagios on openSUSE 11.4
use Nagios on openSUSE 11.4
use Nagios on openSUSE 11.4
use Nagios on openSUSE 11.4
use Nagios on openSUSE 11.4
use Nagios on openSUSE 11.4
use Nagios on openSUSE 11.4
use Nagios on openSUSE 11.4
use Nagios on openSUSE 11.4
use Nagios on openSUSE 11.4
use Nagios on openSUSE 11.4
use Nagios on openSUSE 11.4
use Nagios on openSUSE 11.4
use Nagios on openSUSE 11.4
use Nagios on openSUSE 11.4
use Nagios on openSUSE 11.4
use Nagios on openSUSE 11.4
use Nagios on openSUSE 11.4
use Nagios on openSUSE 11.4
use Nagios on openSUSE 11.4
use Nagios on openSUSE 11.4
use Nagios on openSUSE 11.4
use Nagios on openSUSE 11.4
use Nagios on openSUSE 11.4
use Nagios on openSUSE 11.4
use Nagios on openSUSE 11.4
use Nagios on openSUSE 11.4
use Nagios on openSUSE 11.4
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

use Nagios on openSUSE 11.4

1,397

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,397
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Nagios曾威龍(LiSu)
  • 2. 前言身為系統管理員,被使用者告知某某服務不能使用,那是一種失職啊...萬一,這個不幸的消息還是高層遇到的...(切腹謝罪!!)
  • 3. 那叫...A死
  • 4. 那叫...A死==Nagios
  • 5. 提供以網頁方式呈現 o 主機(host)狀態 o 服務(service)狀態 o 設備(device)資訊除了目前狀態,也會保存記錄
  • 6. 不是只有"看",設定警示值後,可透過email或是其他plugin通知管理員至少要比老闆早一步發現,被問到時,已經可以回報"處理中"...
  • 7. 不是只有"看",設定警示值後,可透過email或是其他plugin通知管理員至少要比老闆早一步發現,被問到時,已經可以回報"處理中"...(書上說還可以用來監控股價!)
  • 8. 架構從監控主機發出要求,透過被監控主機上的nrpe agent取得資訊並回傳;使用者從Web上檢視報告
  • 9. 主機定義define host{ use linux-server host_name mail01 alias mail server 01 address 172.18.55.202 notifications_enabled 1 process_perf_data 1 check_command check-host-alive notification_interval 120 notification_period 24x7 notification_options d,u,r}
  • 10. 主機狀態• Down• Unreachable• Up• Pending
  • 11. 服務定義define service{ name ping check_command check_ping!100.0,20%!500.0,60% contact_groups nagios-admins check_period 24x7 max_check_attempts 3 normal_check_interval 5 notification_interval 120 notification_period 24x7 notification_options c,r}
  • 12. 服務狀態• Critical• Warning• Unknow• Ok• Pending
  • 13. cgi.cfg:設定驗證方式或是連線內容htpasswd.users:檢視nagios的網頁驗證nagios.cfg:nagios 主要設定nrpe.cfg:nrpe的設定resource.cfg:定義變數、巨集objects:所有物件設定資料
  • 14. command.cfg:執行命令檔contacts.cfg:指定示警對象localhost.cfg:本機主機設定檔printer.cfg:印表機設定檔switch.cfg:交換器設定檔templates.cfg:範本設定檔timperiods.cfg:設定工作排程
  • 15. Nagios監控主機先安裝 apache2#zypper install apache2 apache2-example-pages yast2-http-server 會附帶安裝基本模組
  • 16. 設定 apache2#yast http-server在第二步驟,勾選使用 php模組在第五步驟,將 apache2設定為開機後自動啟動開啟瀏覽器,在網址列輸入 <http://127.0.0.1>測試是否能夠連上 apache,看到"It works!"
  • 17. 安裝 nagios主要套件#zypper install nagios nagios-plugins-extra 若要收集其他主機資訊,可一併安裝nagios-nrpe安裝後會協助建置nagios所需帳號<nagios>、群組<nagios>與<nagcmd>#grep nagiso /etc/passwd#grep nag /etc/group而 nagios的相關設定檔案在 /etc/nagios之下
  • 18. 設定 nagios的帳號與密碼管理帳號#htpasswd2 -c /etc/nagios/htpasswd.users nagiosadmin 檔案與帳號是預設值,若需變動 在 /etc/nagios/cgi.cfg 修改管理帳號 在 /etc/apache2/conf.d/nagios.conf 修改驗證檔案一般帳號,僅提供檢視報告用#htpasswd2 /etc/nagios/htpasswd.users nagios 注意,並不需要使用 "-c"囉確認所需帳號已建立完成#cat /etc/nagios/htpasswd.users
  • 19. 設定 nagios為開機後逕自啟動#chkconfig nagios on#chkconfig nagios --list啟動 nagios,準備來個初相見吧!#rcnagios start利用瀏覽器連到 nagios主機的頁面 < http://127.0.0.1/nagios >輸入先前建立的 nagios帳號與密碼
  • 20. 示警設定觀察 Service->SSH#rcsshd stop觀察 Service->SSH 的警示圖示修改示警動作#vi /etc/nagios/objects/localhost.cfg 找到 check_ssh 修改 notifications_enabled的值為 1
  • 21. 示警設定測試並重新載入設定檔#nagios -v /etc/nagios/nagios.cfg#rcnagios reload利用瀏覽器連到 nagios主機的頁面 < http://127.0.0.1/nagios >觀察 Service->SSH 的警示圖示並檢查 /var/spool/mail/nagios的內容
  • 22. 示警設定修改示警通知對象#vi /etc/nagios/objects/contacts.cfg 找到 email 修改為欲通知的使用者電子郵件測試並重新載入設定檔#nagios -v /etc/nagios/nagios.cfg#rcnagios reload等待...再去查看信件
  • 23. 收集其他主機資訊
  • 24. 收集其他主機資訊在被監控主機上(Linux平台),安裝 nagios-nrpe套件#zypper install nagios-nrpe nagios-plugins-nrpe設定允許連線主機#vi /etc/nagios/nrpe.cfg 找到 allowed_hosts=127.0.0.1 在後面加上監控主機的位址 allowed_hosts=127.0.0.1,172.18.55.201啟動 nrpe#rcnrpe start
  • 25. 測試連線在監控主機上(已安裝 nagios-nrpe nagios-plugins-nrpe)#/usr/lib/nagios/plugins/check_nrpe -H 172.18.55.209 172.18.55.209是被監控主機的IP在被監控主機上#/usr/lib/nagios/plugins/check_nrpe -H localhost確認出現NRPE v2.12的字樣,即為連線成功
  • 26. 列入監控主機的監控在監控主機上#vi /etc/nagios/objects/localhost.cfg 在HOST DEFINITION 加入一段define host{ use linux-server host_name client1 alias client1 address 172.18.55.209 }
  • 27. 列入監控主機的監控在監控主機上#vi /etc/nagios/objects/localhost.cfg 從SERVICE DEFINITIONS裡 在想要監看的服務項目中 找到host_name,並在讓行最後加上",client1"測試並重新載入設定檔#nagios -v /etc/nagios/nagios.cfg#rcnagios reload從nagios的頁面上觀察 Hosts 與 Services
  • 28. 收集其他主機資訊在被監授主機上(Windows平台),安裝 NSClient++軟體 http://www.nsclient.org/nscp/
  • 29. 此處要輸入監控主機的位址 此處要輸入監控主機的位址 這邊是要載入的模組
  • 30. 測試連線在監控主機上#/usr/lib/nagios/plugins/check_nrpe -H 172.18.55.200 172.18.55.209是被監控主機(Windows)的IP將會出現表示連線正常可能是受監控平台的 NSClient 服務未啟動
  • 31. 列入監控主機的監控範圍在監控主機上#vi /etc/nagios/objects/windows.cfg在HOST DEFINITION 加入一段define host{ use windows-server host_name winserver alias My Windows Server address 172.18.55.200 }
  • 32. 接著在SERVICE DEFINITIONS裡在想要監看的服務項目中找到host_name,並在讓行最後加上",winserver"修改 nagios設定檔以讀入 windows.cfg#vi /etc/nagios/nagios.cfg 找到 windows.cfg,將該行註解取消測試並重新載入設定檔#nagios -v /etc/nagios/nagios.cfg#rcnagios reload從nagios的頁面上觀察 Hosts 與 Services

×