nagios二次開發(二)---nagios和nagiosql合并與取捨

來源:互聯網
上載者:User

標籤:des   style   blog   http   io   ar   color   os   使用   

NAGIOS做前台

上一篇本人分析了nagios和nagiosql的優缺點,根據之前的使用經驗及探索。決定將nagios做為監控資料的展示層,暫稱做“前台”。將nagiosql做為監控體的配置層,暫稱為“後台”。簡而言之,後台做為伺服器端的配置,前台用來查看結果。

這裡取nagios頁面中的左側功能表列,使其與nagiosql的左側功能表列進行合并,當前你可以根據你的業務需要進行取捨。

nagios頁面中的左側功能表列見圖1.3

 

 

需要即時瞭解nagios的朋友可以訪問nagios官網的demo:http://nagioscore.demos.nagios.com/

 

NAGIOSQL做後台

通過對nagios和nagiosql的調研,我的建議是將nagios的相關頁面合并到nagiosql的主體架構中。兩者都是用PHP開發的,但本人卻對PHP是0基礎,那就邊學邊賣。對nagios的源碼分析,從index.php(此頁面為首頁)源碼如下,

[php] view plaincopyprint?
  1. <frameset cols="180,*" style="border: 0px; framespacing: 0px">  
  2. <frame src="side.php" name="side" frameborder="0" style="">  
  3. <frame src="<?php echo $corewindow;?>" name="main" frameborder="0" style="">  

第45行及46行瞭解到,左側菜單及右側頁面是通過iframe顯示出來的。

由此又對side.php源碼進行分析,源碼如下:

[php] view plaincopyprint?
  1. <?php  
  2. include_once(dirname(__FILE__).‘/includes/utils.inc.php‘);  
  3.   
  4. $link_target="main";  
  5. ?>  
  6.   
  7. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">  
  8.   
  9. <html>  
  10.   
  11. <head>  
  12. <meta name="ROBOTS" content="NOINDEX, NOFOLLOW">  
  13. <meta http-equiv=‘content-type‘ content=‘text/html;charset=UTF-8‘>  
  14.   
  15. <TITLE>Nagios</TITLE>  
  16. <link href="stylesheets/common.css" type="text/css" rel="stylesheet">  
  17. </head>  
  18.   
  19. <body class=‘navbar‘>  
  20.   
  21.   
  22.   
  23. <!--<div class="navbarlogo">-->  
  24. <!--<a href="http://www.nagios.org" target="_blank"><img src="images/sblogo.png" border="0" alt="Nagios"></a>-->  
  25. <!--</div>-->  
  26.   
  27. <!--<div class="navsection">-->  
  28. <!--<div class="navsectiontitle">常用</div>-->  
  29. <!--<div class="navsectionlinks">-->  
  30. <!--<ul class="navsectionlinks">-->  
  31. <!--<li><a href="main.php" target="<?php echo $link_target;?>">首頁</a></li>-->  

第4、31行,明確了點擊菜單時,右側區target控制顯示的資訊。

而對nagiosql的源碼進行分析時,完全是一頭霧水。因為nagiosql引入了模板(後面文章分析)。這也就成為了要將nagios合并到nagiosql的主要原因。

當初因為考慮到CGI的問題(後面文章分析),我們曾試圖將nagiosql進行分拆合并其到nagios頁面中,但經過嘗試以失敗告終,因為我們對IT.php模板(後面文章分析)確實不懂啊。


請朋友們轉載時註明出處,因為我是為了更好的方便大家來和我討論。謝謝了。

意見及建議:[email protected]

nagios二次開發(二)---nagios和nagiosql合并與取捨

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.