Nagios 監控Windows 主機

Nagios 要監控windows 主機,需要在windows 主機安裝 NSClient++ Agent

下載網址: http://www.nsclient.org/nscp/downloads

達成目標:

監控本站blog 主機,硬碟空間,CPU Load ,記憶體使用量

被監控端設定

1. 在windows 2008 主機 安裝 NSClient++  (我安裝的是 NSClient++-0.3.9-x64.msi)

   執行NSClient++-0.3.9-x64.msi

   [下一步]

  nasgiowin-1

[下一步]

 nasgiowin-2

[下一步]

nasgiowin-2

輸入 nagios server IP  , Modules 選項 基本上全部勾選即可

password 可以不用設定

nasgiowin-4

安裝完畢

nasgiowin-5

在服務部分 設定 [允許服務與桌面互動] 打勾

nasgiowin-6

 

Nagios 主機設定

1.新增在 /etc/nagios/blog.cfg

2.修改 /etc/nagios/nagios.cfg  新增 

cfg_file=/etc/nagios/blog.cfg  (blog.cfg內容如下)

——————————————————————-

define host{
        host_name         MIS-Blog
        alias             blog
        address           x.x.x.x
         max_check_attempts      5
        notification_interval   30
        notification_period     24×7
        notification_options    d,u,r
        check_command           check-host-alive
        }
define service{
        host_name         MIS-Blog
        max_check_attempts      5
        notification_interval   30
        notification_period     24×7
        service_description     CPU Load
        check_command           check_nt!CPULOAD!-l 5,80,90
        }
define service{
        host_name         MIS-Blog
        max_check_attempts      5
        notification_interval   30
        notification_period     24×7
        service_description     C: Drive Space
        check_command           check_nt!USEDDISKSPACE!-l c -w 80 -c 90
        }
define service{
        host_name         MIS-Blog
        max_check_attempts      5
        notification_interval   30
        notification_period     24×7
        service_description     D: Drive Space
        check_command           check_nt!USEDDISKSPACE!-l d -w 80 -c 90
        }

define service{
        host_name         MIS-Blog
        max_check_attempts      5
        notification_interval   30
        notification_period     24×7
        service_description     Memory Usage

——————————————————————-

3.確定 設定檔是否正確無誤 指令如下

/usr/bin/nagios -v /etc/nagios/nagios.cfg

4. 重新啟動 nagios   就可以在網頁看到監控的結果 (如下圖)

nasgiowin-7

 

參考文件 :

http://nagios.sourceforge.net/docs/3_0/monitoring-windows.html

http://blog.xuite.net/misgarlic/weblogic/46170477-NSClient%2B%2B+-+nagios+addon

http://blog.yam.com/keynes0918/article/31248498



本篇瀏覽人數: 8386
分類: Nagios篇。這篇內容的永久連結

在〈Nagios 監控Windows 主機〉中有 9 則留言

  1. MIS的背影好沉重啊……

  2. maggie表示:

    設計起來難不難 ?? 一定要寫程式才可以嗎 ??

  3. hungming表示:

    若只想監控實體記憶體不含虛擬呢?指令是?

  4. markhong表示:

    請問您,有遇過CPU 或 RAM 被NSCP.exe 吃資源導致系統緩慢的情形嗎

發佈回覆給「榮哥」的留言 取消回覆

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *