icinga 添加http service

來源:互聯網
上載者:User

緊接上文,現在監控了10.112.18.131 host,但是沒有任何public service被監控。該機上已經安裝了nginx,監聽80連接埠,提供了靜態檔案伺服器。

第一步:確保nginx提供了根目錄的訪問

               location / {                        root   /opt;                        index  index.html;               }

手動通過瀏覽器測試一下:http://10.112.18.131

可以看到index.html的內容就行了。

第二步:在/usr/local/icinga/etc/object/linux.cfg檔案中添加一個service

File Edit Options Buffers Tools Minibuf Help                                                                                                                                     define host{        use             linux-server            ; Inherit default values from a template        host_name       StaticFileServer              ; The name we're giving to this host                                                                                               alias           static filer server for 3D and jenksins server for CloudEngine        ; A longer name associated with the host                                                   address         10.112.18.131            ; IP address of the host                                                                                                                contact_groups  admins                ; Host groups this host is associated with                                                                                                 }                                                                                                                                                                                                                                                                                                                                                         # check that web services are running                                                                                                                                            define service {                                                                                                                                                                         host_name                  StaticFileServer                                                                                                                                      service_description             HTTP                                                                                                                                             check_command                   check_http                                                                                                                                       use                             generic-service                                                                                                                                  action_url                      http://10.112.18.131/ArcGIS/rest/services/SanFrancisco/3DFeatureServer                                                                           notification_interval           0 ; set > 0 if you want to be renotified                                                                                                 }                                                                                                                                                                                

好。測試一下:

/usr/local/icinga/bin/icinga -v /usr/local/icinga/etc/icinga.cfg

然後重新載入:

service icinga reload

現在重新整理網頁:

一切OK. 點擊HTTP右邊的齒輪按鈕,可以開啟action_url的連結地址。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.