跳轉到內容

使用 Xymon 進行系統監控/開發者指南

來自華夏公益教科書,開放世界開放的書籍
(從 使用 Hobbit 進行系統監控/開發者指南 重定向)

在 SourceForge 上開始使用 Hobbit 進行開發

[編輯 | 編輯原始碼]

參考書籍

[編輯 | 編輯原始碼]

SVN 教程

[編輯 | 編輯原始碼]

參考資料

[編輯 | 編輯原始碼]

Xymon SVN 教程

[編輯 | 編輯原始碼]

以下是一些使用 svn 與 sourceforge.net 上的 hobbit 互動的示例。

  • 列出 xymon SVN 目錄的子目錄。
[tjyang@ibm hobbitmon]$ svn ls https://hobbitmon.svn.sourceforge.net/svnroot/hobbitmon
branches/
sandbox/
tags/
trunk/
[tjyang@ibm hobbitmon]$

  • 找出過去 7 天的變化。
[tjyang@ibm hobbitmon]$ svn log -v -r HEAD:\{`date +%Y-%m-%d -d'7 days ago'`\} \
 https://hobbitmon.svn.sourceforge.net/svnroot/hobbitmon

------------------------------------------------------------------------
r6033 | storner | 2009-01-08 07:43:23 -0600 (Thu, 08 Jan 2009) | 1 line
Changed paths:
   M /trunk/client/Makefile

Make sure client scripts are executable
------------------------------------------------------------------------
r6032 | storner | 2009-01-07 06:00:45 -0600 (Wed, 07 Jan 2009) | 1 line
Changed paths:
   M /branches/4.2.3/build/md5.dat
   A /branches/4.2.3/hobbitd/webfiles/hostlist_footer
   A /branches/4.2.3/hobbitd/webfiles/hostlist_form
   A /branches/4.2.3/hobbitd/webfiles/hostlist_header
   M /branches/4.2.3/lib/headfoot.c
   M /branches/4.2.3/lib/headfoot.h
   M /branches/4.2.3/web/Makefile
   A /branches/4.2.3/web/hobbit-hostlist.c
   A /branches/4.2.3/web/hobbit-hostlist.sh.DIST

Added hostlist CGI from trunk
------------------------------------------------------------------------
r6031 | storner | 2009-01-07 05:59:22 -0600 (Wed, 07 Jan 2009) | 2 lines
Changed paths:
   M /branches/4.2.3/build/generate-md5.sh

Adapted to work with Subversion and new source directories.

------------------------------------------------------------------------
r6030 | storner | 2008-12-17 05:39:49 -0600 (Wed, 17 Dec 2008) | 2 lines
Changed paths:
   A /branches/4.2.3 (from /branches/4.2.2:6029)

New branch off the 4.2.2 release for maintenance - will become 4.2.3 (if needed).

------------------------------------------------------------------------
[tjyang@ibm hobbitmon]$

  • 使用 svn 檢出 hobbit 原始碼樹。
[tjyang@fc6 ]$ svn co https://hobbitmon.svn.sourceforge.net/svnroot/hobbitmon hobbitmon 
<snip>
A    hobbitmon/tags/rel_4_0-20041201/web/bb-findhost.cgi.1
A    hobbitmon/tags/rel_4_0-20041201/web/bb-ack.c
A    hobbitmon/tags/rel_4_0-20041201/web/hobbitsvc-trends.c
A    hobbitmon/tags/rel_4_0-20041201/web/bb-snapshot.c
A    hobbitmon/tags/rel_4_0-20041201/web/hobbitsvc.c
A    hobbitmon/tags/rel_4_0-20041201/web/bb-eventlog.cgi.1
A    hobbitmon/tags/rel_4_0-20041201/web/bb-rep.cgi.1
A    hobbitmon/tags/rel_4_0-20041201/web/bb-replog.cgi.1
A    hobbitmon/tags/rel_4_0-20041201/web/bb-hist.c
A    hobbitmon/tags/rel_4_0-20041201/web/bb-csvinfo.c
A    hobbitmon/tags/rel_4_0-20041201/web/bb-webpage.c
Checked out revision 5644.

[tjyang@fc6 hobbitmon]$ ls -la
total 28
drwxrwxr-x  6 tjyang tjyang 4096 Aug  4 09:11 .
drwxr-xr-x 38 tjyang tjyang 4096 Aug  4 09:09 ..
drwxrwxr-x  3 tjyang tjyang 4096 Aug  4 09:11 branches
drwxrwxr-x  6 tjyang tjyang 4096 Aug  4 10:04 .svn
drwxrwxr-x 67 tjyang tjyang 4096 Aug  4 10:04 tags
drwxrwxr-x 16 tjyang tjyang 4096 Aug  4 09:11 trunk
[tjyang@fc6 hobbitmon]$

to revert all the changes you made to hobbit src tree.
 svn revert --recursive .
  • 作為 hobbit 開發者 之一,您可以建立分支。
  • 以下示例透過 tjyang 建立了 hobbit 的例項。
[tjyang@fc6 hobbitmon]$ svn mkdir branches/tjyang
A         branches/tjyang
[tjyang@fc6 hobbitmon]$ svn copy trunk  branches/tjyang
A         branches/tjyang/trunk
[tjyang@fc6 hobbitmon]$ svn commit -m "T.J. Yang's copy of hobbit"
Authentication realm: <https://hobbitmon.svn.sourceforge.net:443> SourceForge Subversion area
Password for 'tjyang':
Adding         branches/tjyang
Adding         branches/tjyang/trunk

Committed revision 5645.
[tjyang@fc6 hobbitmon]$

  • 建立子目錄。
[tjyang@fc6 trunk]$ svn status
A      pkg
M      README
[tjyang@fc6 trunk]$ mkdir pkg/tww
[tjyang@fc6 trunk]$ svn status
?      pkg/tww
A      pkg
M      README
[tjyang@fc6 trunk]$ svn add  pkg/tww
A         pkg/tww
[tjyang@fc6 trunk]$ pwd
/home/tjyang/hobbitmon/branches/tjyang/trunk
[tjyang@fc6 trunk]$ ls
bbdisplay  bbproxy  Changes  common     configure.client  COPYING  debian  hobbitd  lib  README         RELEASENOTES  web
bbnet      build    client   configure  configure.server  CREDITS  docs    include  pkg  README.CLIENT  rpm
[tjyang@fc6 trunk]$ pwd
/home/tjyang/hobbitmon/branches/tjyang/trunk
[tjyang@fc6 trunk]$ ls
bbdisplay  bbproxy  Changes  common     configure.client  COPYING  debian  hobbitd  lib  README         RELEASENOTES  web
bbnet      build    client   configure  configure.server  CREDITS  docs    include  pkg  README.CLIENT  rpm
[tjyang@fc6 trunk]$ ls
bbdisplay  bbproxy  Changes  common     configure.client  COPYING  debian  hobbitd  lib  README         RELEASENOTES  web
bbnet      build    client   configure  configure.server  CREDITS  docs    include  pkg  README.CLIENT  rpm
[tjyang@fc6 trunk]$ history |grep commit
 1159  svn commit -m "T.J. Yang's copy of hobbit"
 1217  history |grep commit
 1240  history |grep commit
[tjyang@fc6 trunk]$  svn commit -m "add pkg directory"
Sending        trunk/README
Adding         trunk/pkg
Adding         trunk/pkg/tww
Transmitting file data .
Committed revision 5646.
[tjyang@fc6 trunk]$

開發路線圖

[編輯 | 編輯原始碼]

Henrik,2009 年 2 月 9 日

[編輯 | 編輯原始碼]

2 月 9 日,Henrik 在列表中釋出了以下路線圖。最近我還沒怎麼聽到訊息,所以不知道它是否改變了。

版本 4.4

  • 支援 SNMP 用於資料收集
  • 基於 RRD 檔案中收集的資料更新狀態(這真的很棒 - 從本質上講,*任何*放入 RRD 檔案的值都可以觸發 Xymon 中的新狀態或修改後的狀態。因此,例如,您可以更改“http”測試的狀態為紅色,如果網頁的響應時間超過 5 秒)。
  • 狀態“抖動”處理,用於捕獲快速變化的狀態。

版本 4.5

  • 支援客戶端和 Xymon 之間的通訊以使用壓縮和/或加密。
  • 支援透過 SSL 證書進行客戶端身份驗證(因此您無法偽造客戶端訊息)。

版本 4.6

  • 修改後的 Web 介面 - 消除對基於 Web 伺服器的身份驗證的需求,併為各種 Xymon 元件提供更細粒度的授權。
  • 每個使用者自定義登入頁面,因此登入將始終顯示使用者負責/被允許訪問的那些系統。

在路上我會引入一個新的“ping”測試守護程式 - 我正在接近 ping 所有主機需要超過 5 分鐘的時間(我有很多主機)。因此需要做些什麼,我認為我知道怎麼做。

待辦事項

[編輯 | 編輯原始碼]
Tasks that most team member agree to implement.

設計文件

[編輯 | 編輯原始碼]

Hobbit 設計文件

願望清單

[編輯 | 編輯原始碼]
  • 軟體質量保證測試套件。
  • 將所有 bb 模組從 deadcat.net 遷移到 hobbit。
  • 內建 SLA 報告。
  • 更好的主題支援。
  • 提供 hobbit 伺服器和 hobbit 客戶端之間的加密通訊管道。
  • hobbit 訊息壓縮。
  • ipv6
  • 4.2.x 維護版本。
  • 重新編寫警報模組使其正常工作。;) 它目前存在缺陷。

Xymon 志願者角色和職責

[編輯 | 編輯原始碼]

這是一個人員列表,他們在以下 R&R 領域為 Xymon 社群貢獻時間和技能。

  1. 專案管理員
    1. 擁有 sourceforge 上專案管理員的許可權。
    2. 將票證分配給下面列出的不同人員。
    3. 授予 sourceforge 上新的開發者許可權.
    4. 讓人員在資源有限且無報酬的情況下作為團隊工作。
  2. 開發
    1. 瞭解 Xymon 原始碼樹。
    2. 進行原始碼文件化。
    3. 處理來自問題跟蹤器的票證。
    4. 應用來自 Xymon 社群的提交的補丁。
    5. 實現新的請求功能
  3. 文件
    1. 使用 Xymon 功能更新 troff 檔案。
      1. 維護 troff2html 流程。
    2. 使用 Latex 為 Xymon 創建出版級手冊和流程。
      1. 使用 latex2troff 工具生成 Xymon troff 手冊頁原始碼。
      2. 在“make”命令流程中自動化文件生成。
  4. 終端使用者支援
    1. 回答在 xymon 使用者電子郵件列表中提出的問題。
    2. 維護 Xymon 常見問題解答
    3. 測試新的 Xymon 功能或驗證錯誤。
  5. 模組開發
    1. 編寫新的 Xymon 客戶端外部模組。
    2. 編寫 Xymon 伺服器端外部模組。
    3. 維護孤兒 Xymon 模組。
    4. 維護 Xymon 模組開發指南。
姓名 專案管理員 開發 文件 終端使用者支援 模組開發
Henrik Størner
T.J. Yang
Jerald Sheets
Josh Luthman
Malcolm Hunter
Japheth J.C. Cleaver
Steve Holmes ?
Damien Martins(又名 doctor madness)
dubby
Flemming
Christoph Berg
Vadim Pushkin
Martin Ward
Buchan Milne
Rich Smrcina
Kenneth Langford
Padraig Lennon
David Baldwin
Ralph Mitchell
此處替換虛擬模板 管理員 Y/N 開發 Y/N 文件 Y/N 使用者支援 Y/N 模組開發 Y/N
Olivier AUDRY
Neil Franken
Peter Toft

打包人員誰是誰

[編輯 | 編輯原始碼]
  • blingme:Mandriva
  • Christoph Berg(Myon):debian

開發者誰是誰

[編輯 | 編輯原始碼]
  • Rich Smrcina
  • Buchan Milne
  • T.J. Yang
    • hobbit wiki 書籍專案。
    • 自動配置 hobbit.
    • hobbit 文件專案。
      • 將使用 latex 建立 hobbit 手冊。
    • hobbit 軟體構建、包構建和部署流程的數字化。
    • 用於 Hobbit 開發的 OpenSolaris VMWare 裝置。
    • 將 EXTJS 3.0 用於 hobbit 菜單系統。

開發者

[編輯 | 編輯原始碼]
  • Vernon Everett
    • hobbit wiki 和文件。
  • TWW Inc.
    • 使用 TWW 工具集打包 hobbit 客戶端和伺服器。

為這個 hobbit 專案做出貢獻的姓名列表

[編輯 | 編輯原始碼]
Manon Goo <manon@manon.de>
Alex Tang <altitude@cic.net>
Tim Hudson (tjh@cryptsoft.com)
Steve Reid <steve@edmweb.com>
Thomas Roessler <roessler@does-not-exist.org>
Wei Dai <weidai@eskimo.com>
Eric Young (eay@cryptsoft.com)
Charles Goyard <cg@fsck.Fr>
Marco Avvisano
Paul Backer
Olivier Beau
Adamets Bluejay
Brian Buchanan
Massimo Carnevali
Douwe Dijkstra
Francesco Duranti
Lars Ebeling
Tom Georgoulias
Laurent Grilli
Kevin Hanrahan
Asif Iqbal
Charles Jones
Thomas J Jones
Uwe Kirbach
Joshua Krause
Patrick Lin
Brian Lynch
Thomas Mattsson
Michael Fisher
Daniel J McDonald
Werner Michels
Christian Perrier
Jure Peternel
William Richardson
Torsten Richter
Chris Ricker
Tim Rotunda
Thomas Rucker
Mirko Saam
Thomas Schfer
Tom Schmidt
Eric Schwimmer
Bill Simaz
Gavin Stone-Tolcher
Jeff Stoner
David Stuffle
Christian Thibodeau
Rick Waegner
Rob Watson

自動配置 hobbit

[編輯 | 編輯原始碼]

本節描述將 hobbit 原始碼樹轉換為自動工具控制的過程。

為什麼自動配置?

[編輯 | 編輯原始碼]
  • 為了提高跨作業系統平臺的可移植性。
  • 規劃 I18n 和 L10n。
  • 成為真正的 GNU 軟體,需要使用 autotool。

學習 autotool

[編輯 | 編輯原始碼]

轉換 hobbit 原始碼樹

[編輯 | 編輯原始碼]
  • 確保您的 autotool 集具有以下版本。
GNU Autoconf 2.61 (November 2006)
GNU Automake 1.10 (October 2006)
GNU Libtool 1.5.24 (June 2007)
GNU Gettext 0.17 (November 2007)
  • 下載 最新的 hobbit 原始碼壓縮包.
  • 執行 autoscan 獲取 configure.scan,然後將其修改為 configure.ac。
  • 將 lib/Makefile demotool/Makefile ... 等轉換為 Makfile.am。
  • 微調 configure.ac 以接受配置選項作為配置選項。
  • 在 configure.ac 中支援 Linux 和 Solaris 作業系統設定。

參考資料

[編輯 | 編輯原始碼]

Xymon 文件

[編輯 | 編輯原始碼]
  1. 當前
    1. Henrik Stroner 使用 troff 生成手冊頁,以便我們擁有 RTFM 型別的文件。
    2. troff2html 也用於為 Web 瀏覽器檢視建立 html 頁面。
  2. 增強提案。
    1. 使用 latex+dia+make+wiki 創建出版級文件
    2. 使用目錄、索引、參考文獻和圖來說明與 Xymon 相關的主題。
    3. 生成 Xymon 使用者指南。
    4. 生成 Xymon 開發者指南
    5. 生成 Xymon 系統管理員指南。
    6. 生成 Xymon 幻燈片,用於演示目的。
    7. 使用 Wiki 文件內容孵化。
    8. 為不同目的生成 html、RTF 和 pdf。
  3. 要求開發團隊在原始碼文件中使用 doxygen 語法。


MediaWiki 到 DocBook

[編輯 | 編輯原始碼]
  • 使用 mvc 獲取 hobbit wiki 原始碼
  • 將 mediawiki 原始碼轉換為 latex。

手冊頁

[編輯 | 編輯原始碼]

重用現有 hobbit 文件源中的內容

[編輯 | 編輯原始碼]

Xymon 測試套件

[編輯 | 編輯原始碼]

執行測試用例以驗證程式碼更改是否正常。

效能測試指令碼

[編輯 | 編輯原始碼]

質量保證測試指令碼

[編輯 | 編輯原始碼]

shell 指令碼

[編輯 | 編輯原始碼]
  • hobbit-4.0.3 的構建目錄中的測試指令碼,確保依賴軟體在構建機器上。
    
build/perl.sh
build/fping.sh             
build/rrd.sh   
build/ssl.sh
build/ldap.sh          
build/pcre.sh

Perl 測試指令碼

[編輯 | 編輯原始碼]

Python 測試指令碼

[編輯 | 編輯原始碼]

DejaGNU 測試指令碼

[編輯 | 編輯原始碼]

hobbit 伺服器中的 Dtrace 探針

[編輯 | 編輯原始碼]

在應用程式中放置 dtrace 探針的示例.

適用於 OpenSolaris IPS 格式的 Hobbit 客戶端

[編輯 | 編輯原始碼]
  • 此 hobbit 客戶端的特性
    • 此 hobbit 客戶端將使用本地帳戶和組,以避免對 NIS 和 NFS 的依賴。
    • 它將使用 SMF 啟動/停止 hobbit 客戶端。
    • 它將使用 sudo 或 Solaris 10 的 ACL 從 OpenSolaris 中讀取受限資訊。
    • hobbit-client-serverconf 是 hobbit 客戶端的簡化版本,不進行本地訊息處理。
    • hobbit-client-local 將執行一些處理過濾,它需要更多依賴軟體。
    • 它使用 /opt/hobbitclient42 作為安裝路徑。
    • svcadm disable/enable network:/hobbit-client-serverconf

OpenSolaris 資訊

[編輯 | 編輯原始碼]
  • OpenSolaris 2008.05
-bash-3.2# uname -a
SunOS opensolaris 5.11 snv_86 i86pc i386 i86pc
-bash-3.2# cat /etc/release
                       Open Solaris 2008.05 snv_86_rc2a X86
           Copyright 2008 Sun Microsystems, Inc.  All Rights Reserved.
                        Use is subject to license terms.
                             Assembled 23 April 2008
-bash-3.2#

  • 安裝了 Sun 和 SUNW gcc-3.4.3 編譯器。
    • 如果未安裝,請執行 “pkg install sunstudioexpress” 和 “pkg install SUNWgcc”。
-bash-3.2# pkg info sunstudioexpress SUNWgcc
          Name: sunstudioexpress
       Summary: Sun Studio Express - C, C++, & Fortran compilers and Tools
         State: Installed
     Authority: opensolaris.org (preferred)
       Version: 0.2008.5
 Build Release: 5.11
        Branch: 0.86
Packaging Date: Wed Apr 30 21:10:32 2008
          Size: 566.2 MB
          FMRI: pkg:/sunstudioexpress@0.2008.5,5.11-0.86:20080430T211032Z

          Name: SUNWgcc
       Summary: gcc - The GNU C compiler
         State: Installed
     Authority: opensolaris.org (preferred)
       Version: 3.4.3
 Build Release: 5.11
        Branch: 0.86
Packaging Date: Sat Apr 26 18:22:21 2008
          Size: 60.4 MB
          FMRI: pkg:/SUNWgcc@3.4.3,5.11-0.86:20080426T182221Z
-bash-3.2#

使用 shell 指令碼來自動化包構建

[編輯 | 編輯原始碼]
[root] cat build/makerpm.sh
#!/bin/sh

REL=$1
if [ "$REL" = "" ]; then
        echo "Error - missing release number"
        exit 1
fi

cd ~/hobbit
rm -rf rpmbuild

# Setup a temp. rpm build directory.
mkdir -p rpmbuild/RPMS rpmbuild/RPMS/i386 rpmbuild/BUILD rpmbuild/SPECS rpmbuild/SRPMS rpmbuild/SOURCES
cat >rpmbuild/.rpmmacros <<EOF1
# Default macros for my enviroment.
%_topdir `pwd`/rpmbuild
%_tmppath /tmp
EOF1
cat >rpmbuild/.rpmrc <<EOF2
# rpmrc
buildarchtranslate: i386: i386
buildarchtranslate: i486: i386
buildarchtranslate: i586: i386
buildarchtranslate: i686: i386
EOF2

cat rpm/hobbit.spec | sed -e "s/@VER@/$REL/g" >rpmbuild/SPECS/hobbit.spec
cp rpm/hobbit-init.d rpmbuild/SOURCES/
cp rpm/hobbit.logrotate rpmbuild/SOURCES/

mkdir -p rpmbuild/hobbit-$REL
for f in bbdisplay bbnet bbpatches bbproxy build common docs hobbitd include lib scripts
do
        find $f/ | grep -v RCS | cpio -pdvmu ~/hobbit/rpmbuild/hobbit-$REL/
done
cp -p Changes configure COPYING CREDITS README ~/hobbit/rpmbuild/hobbit-$REL/
find ~/hobbit/rpmbuild/hobbit-$REL -type d|xargs chmod 755

cd rpmbuild
tar zcf SOURCES/hobbit-$REL.tar.gz hobbit-$REL
rm -rf hobbit-$REL
HOME=`pwd` rpmbuild -ba --clean SPECS/hobbit.spec
rpm --addsign RPMS/i?86/hobbit-$REL-*.i?86.rpm
mv RPMS/i?86/hobbit-$REL-*.i?86.rpm SRPMS/hobbit-$REL-*.src.rpm ../rpm/pkg/
[root]

使用 CPAM 工具來自動化軟體包構建

[編輯 | 編輯原始碼]

如何參與 hobbit 開發

[編輯 | 編輯原始碼]
  • 訂閱 hobbit 郵件列表
  • 在 en.wikibooks.org 上建立賬戶,參與 hobbit 文件的編寫。
  • https://wikibook.tw/wiki/CPAM_with_TWW 學習,參與 hobbit 自動化跨平臺軟體打包的工作。

設定你的開發環境

[編輯 | 編輯原始碼]

在 OpenSolaris x86 上

[編輯 | 編輯原始碼]
使用預構建的 OpenSolaris VMWare 映象
[編輯 | 編輯原始碼]
  • 從這裡下載 OpenSolaris VMWare 映象(待定)。
  • 從這裡安裝 VMWare player 3.0(待定)。
使用 VirtualBox OpenSolaris 映象
[編輯 | 編輯原始碼]

在 Solaris 10 Intel 上

[編輯 | 編輯原始碼]
  • 主機資訊
bash-3.00# which cvs
/opt/csw/bin/cvs
bash-3.00# uname -a
SunOS unknown 5.10 Generic i86pc i386 i86pc
bash-3.00# which gcc
/opt/csw/gcc3/bin/gcc
bash-3.00# which gmake
/opt/csw/bin/gmake
bash-3.00#

在 RedHat Linux 上

[編輯 | 編輯原始碼]

設定你的 TWW 開發環境

[編輯 | 編輯原始碼]
  • 將 TWW 工具下載到你的系統
  • 編譯 hobbit*.[sb|pb]。

從 sourceforge.net 上檢出原始碼

[編輯 | 編輯原始碼]

閱讀原始碼

[編輯 | 編輯原始碼]

向 Hobbit 提供反饋

[編輯 | 編輯原始碼]
  • 將你的修復、補丁、模組新增至 sourceforge.net。

Hobbit 功能圖

[編輯 | 編輯原始碼]

Hobbit 伺服器

[編輯 | 編輯原始碼]
So the core design looks like this:


   Network tests --\
                    \
            TCP:1984 \           IPC
   Clients ----------> hobbitd --------> hobbitd_channel ---> worker module
                     /         Sh. mem.                 stdin
                    /
   Custom tests ---/


     

Windows Hobbit 客戶端

[編輯 | 編輯原始碼]

BB Win

Hobbit 模組開發

[編輯 | 編輯原始碼]

使用現有的網際網路開發環境開發 Hobbit

[編輯 | 編輯原始碼]

Hobbit 的自定義監控指令碼

[編輯 | 編輯原始碼]

System Monitoring with Hobbit/HOWTO/Custom Monitoring Scripts for Hobbit http://www.hswn.dk/hobbit/help/hobbit-tips.html#scripts

使用 CPAM/TWW 開發環境開發 Hobbit

[編輯 | 編輯原始碼]

為什麼要使用 CPAM/TWW 工具呢?

[編輯 | 編輯原始碼]
  • 優點
    • Hobbit 伺服器和客戶端需要跨平臺,因此需要使用 CPAM/TWW。
    • 就像 Emacs 編輯器一樣,它可以在任何地方執行,不需要許可證。TWW 工具是 GPL 開源的,所以它可以移植到任何作業系統。
    • 一種結構化的、自動化的方式來處理軟體包的建立和管理。
  • 缺點
    • 需要學習新的知識。
    • 改變人們的開發習慣很難。

支援的作業系統

[編輯 | 編輯原始碼]
  • Solaris Sparc
  • RH AS 3.0
  • HP-UX 11.11

Hobbit 軟體包原始碼

[編輯 | 編輯原始碼]

MS windows 上的 Hobbit 客戶端概述

[編輯 | 編輯原始碼]
  1. bbwin (Xymon 客戶端) 使用 c++ 實現。它需要像 boost c++ 庫和 tinyXML 這樣的開源軟體。
  2. 它使用的打包工具是微軟的開源打包工具 - WiX,用於進行 Win32 打包。
  3. 詳細的構建說明在 bbwin 專案網站的 build.txt 中。
  4. 您可以透過兩種方式構建 BBWin.msi:
    1. 使用微軟的 make:nmake
    2. 在 VS2008 中使用“生成解決方案”。

以下是如何建立一個 Windows XP 開發環境,以便您可以建立自己的 BBWin.msi。

準備您的 Xymon win32 構建環境

[編輯 | 編輯原始碼]
  1. 安裝 hhc.exe,它用於將 html 文件編譯成 windows chm 幫助檔案。
    1. 將“C:\Program Files\HTML Help Workshop”新增到 PATH,以便可以訪問 hhc.exe。
  2. 安裝 Visual Studio 2008 Standard 或 Professional 版本。
  3. 確保您的 cmd.exe 添加了以下 PATH 名稱。在您的 DOS 提示符中輸入 echo %PATH% %INCLUDE% %LIB%。
    1. PATH
    2. "LIB=C:\Program Files\Microsoft Platform SDK\Lib\.;C:\Program Files\Microsoft Visual Studio 8\VC\LIB;"
    3. INCLUDE
 INCLUDE=C:\Program Files\Microsoft Platform SDK\Include\.;
 C:\Program Files\Microsoft Platform SDK\Include\atl;C:\Program Files\Microsoft Visual Studio 8\VC\include
 
  1. 為您的 Windows 機器安裝一個 svn 客戶端。
    1. tortoise svn
  2. Windows Server 2003 SP1 Platform SDK Web 安裝:它用於擁有完整的 sdk 來開發 Microsoft 作業系統上的程式。記住安裝所有選項(包括 64 位和 32 位),以避免“atlthunk.lib not found”問題。
    1. 安裝 visual service pack 1:
    2. 關於 VS2008 和 SDK 的 MSDN 部落格
  3. 來自微軟的 WiX 開源打包工具:它用於將編譯後的二進位制檔案轉換為 MS MSI 包格式。
  4. Boost C++ 庫:這些強大的 C++ 庫用於一些代理,將來肯定會在 BBWin 核心服務中使用。
    1. 下載 VS2008 的預編譯 1.35 版本並將其安裝在 C:\boost 目錄下。
  5. TinyXML:BBWin 使用優秀的 TinyXML 庫來載入配置 XML。您不需要下載和安裝它。TinyXML 原始碼包含在 BBWin 原始碼中。
  6. 準備您的原始碼編輯器
    1. notepade++:
    2. XEmacs for win32:
  1. 簽出 bbwin src。
    1. 使用命令“svn co https://bbwin.svn.sourceforge.net/svnroot/bbwin bbwin”
  2. 更改 Makefile 程式碼以指向 C:\boost 安裝。
    1. 修改 Makefile 以將 INCLUDE 指向 C:\boost,並將 LIB 指向包含 C:\boost\lib\*.lib 的位置。
    2. 修改 C/C++ iclude c:\boost,並將連結器指向包含 c:\boost\lib\* 的位置。
  3. 可選軟體安裝
    1. 安裝 cygwin 以在您的 Windows 機器上獲得強大的 Unix 環境。因此,您可以執行以下命令來清理 *.obj 檔案,而當前的 makefile 無法做到這一點。
    2. 透過刪除 Setup/*.msi 來清理 Release 目錄
$ rm Setup/*
$ rm Release/*

使用命令列方法構建 bbwin

[編輯 | 編輯原始碼]

BBWin.msi 建立過程在“C:\BBWin\trunk\Setup\Makefile”中自動執行。此 makefile 將從“C:\BBWin\trunk\Makefile”中呼叫。

  • 確保您的 nmake 命令可用。
C:\bbwin-src\trunk>nmake -help

Microsoft (R) Program Maintenance Utility Version 8.00.50727.762
Copyright (C) Microsoft Corporation.  All rights reserved.

Usage:  NMAKE @commandfile
        NMAKE [options] [/f makefile] [/x stderrfile] [macrodefs] [targets]

Options:

/A Build all evaluated targets
/B Build if time stamps are equal
/C Suppress output messages
/D Display build information
/E Override env-var macros
/ERRORREPORT:{NONE|PROMPT|QUEUE|SEND} Report errors to Microsoft
/G Display !include filenames
/HELP Display brief usage message
/I Ignore exit codes from commands
/K Build unrelated targets on error
/N Display commands but do not execute
/NOLOGO Suppress copyright message
/P Display NMAKE information
/Q Check time stamps but do not build
/R Ignore predefined rules/macros
/S Suppress executed-commands display
/T Change time stamps but do not build
/U Dump inline files
/Y Disable batch-mode
/? Display brief usage message

C:\bbwin-src\trunk>
  • cd 到 c:\bbwin 的頂層原始碼目錄。
  • 鍵入“nmake”以啟動構建。

編譯錯誤

[編輯 | 編輯原始碼]
atlbase.h 未找到
[編輯 | 編輯原始碼]
  • 錯誤資訊
C:\bbwin\trunk\Core\Agents\common>nmake

Microsoft (R) Program Maintenance Utility Version 9.00.30729.01
Copyright (C) Microsoft Corporation.  All rights reserved.

        cl -Zi -Od -DDEBUG -c -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -D_X
86_=1  -DWIN32 -D_WIN32 -W3 -D_WINNT -D_WIN32_WINNT=0x0500 -DNTDDI_VERSION=0x050
00000 -D_WIN32_IE=0x0500 -DWINVER=0x0500 /EHsc /I ../.. /I C:\boost\include\boos
t-1_33_1  -D_MT -MTd SystemCounters.cpp
SystemCounters.cpp
SystemCounters.cpp(20) : fatal error C1083: Cannot open include file: 'atlbase.h
': No such file or directory
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN
\cl.EXE"' : return code '0x2'
Stop.

C:\bbwin\trunk\Core\Agents\common>
  • 確保您有以下目錄和檔案,如果沒有,則需要使用 VS 非 Express 版本。
C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include\atlbase.h
以下問題的臨時修復
[編輯 | 編輯原始碼]
  • 目標是使用 cl MS 編譯器時擺脫“ -D_MT -MTd”。
  • 在程式碼庫的 cygwin shell 中執行此命令,“find . -type f -name Makefile -exec perl -pi -e 's!cvarsmt!conlibsdll!' {} \;”,以將 cvarsmt 替換為 conlibsdll。我不知道不使用多執行緒庫構建程式碼的確切影響。
[編輯 | 編輯原始碼]
*** C:\bbwin09\trunk\Core\Agents\procs *** "C:\Program Files\Microsoft Visual Studio 8\VC\BIN\nmake.exe" -nologo  /L                  
	link /DLL  procs.obj procs.res -out:procs.dll /LIBPATH:C:\boost\lib libboost_date_time-vc80-mt-s.lib
Microsoft (R) Incremental Linker Version 8.00.50727.762
Copyright (C) Microsoft Corporation.  All rights reserved.

LIBCMT.lib(invarg.obj) : error LNK2005: __initp_misc_invarg already defined in LIBCMTD.lib(invarg.obj)
LIBCMT.lib(invarg.obj) : error LNK2005: __invoke_watson already defined in LIBCMTD.lib(invarg.obj)
LIBCMT.lib(invarg.obj) : error LNK2005: __set_invalid_parameter_handler already defined in LIBCMTD.lib(invarg.obj)
LIBCMT.lib(invarg.obj) : error LNK2005: __get_invalid_parameter_handler already defined in LIBCMTD.lib(invarg.obj)
LIBCMT.lib(invarg.obj) : error LNK2005: "void __cdecl _invoke_watson(unsigned short const *,unsigned short const *,unsigned short const *,unsigned int,unsigned int)" (?_invoke_watson@@YAXPBG00II@Z) already defined in LIBCMTD.lib(invarg.obj)
LIBCMT.lib(invarg.obj) : error LNK2005: __invalid_parameter already defined in LIBCMTD.lib(invarg.obj)
LIBCMT.lib(invarg.obj) : error LNK2005: "void __cdecl _invalid_parameter(unsigned short const *,unsigned short const *,unsigned short const *,unsigned int,unsigned int)" (?_invalid_parameter@@YAXPBG00II@Z) already defined in LIBCMTD.lib(invarg.obj)
LIBCMT.lib(invarg.obj) : error LNK2005: ___pInvalidArgHandler already defined in LIBCMTD.lib(invarg.obj)
   Creating library procs.lib and object procs.exp
LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
procs.dll : fatal error LNK1169: one or more multiply defined symbols found
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 8\VC\BIN\link.EXE"' : return code '0x491'
Stop.
*** C:\bbwin09\trunk\Core\Agents\sample *** "C:\Program Files\Microsoft Visual Studio 8\VC\BIN\nmake.exe" -nologo  /L                  
*** C:\bbwin09\trunk\Core\Agents\bbwinupdate *** "C:\Program Files\Microsoft Visual Studio 8\VC\BIN\nmake.exe" -nologo  /L                  

C:\bbwin09\trunk\Core>
C:\bbwin09\trunk\Core\Agents\procs>nmake clean
nmake clean

Microsoft (R) Program Maintenance Utility Version 8.00.50727.762
Copyright (C) Microsoft Corporation.  All rights reserved.

	erase /Q /S procs.res procs.obj procs.dll procs.exp procs.lib procs.obj
Deleted file - C:\bbwin09\trunk\Core\Agents\procs\procs.res
Deleted file - C:\bbwin09\trunk\Core\Agents\procs\procs.obj
Deleted file - C:\bbwin09\trunk\Core\Agents\procs\procs.exp
Deleted file - C:\bbwin09\trunk\Core\Agents\procs\procs.lib

C:\bbwin09\trunk\Core\Agents\procs>nmake
nmake

Microsoft (R) Program Maintenance Utility Version 8.00.50727.762
Copyright (C) Microsoft Corporation.  All rights reserved.

	cl -Zi -Od -DDEBUG -c -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -D_X86_=1  -DWIN32 -D_WIN32 -W3 -D_WINNT -D_WIN32_WINNT=0x0500 -D_WIN32_IE=0x0500 -DWINVER=0x0500 /EHsc /I ../.. /I ../common /I C:\boost\include\boost-1_33_1  -D_MT -MTd procs.cpp
procs.cpp
C:\boost\include\boost-1_33_1\boost/date_time/c_time.hpp(68) : warning C4996: 'localtime': This function or variable may be unsafe. Consider using localtime_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 8\VC\include\time.inl(114) : see declaration of 'localtime'
C:\boost\include\boost-1_33_1\boost/date_time/c_time.hpp(75) : warning C4996: 'gmtime': This function or variable may be unsafe. Consider using gmtime_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        C:\Program Files\Microsoft Visual Studio 8\VC\include\time.inl(101) : see declaration of 'gmtime'
C:\boost\include\boost-1_33_1\boost/utility/enable_if.hpp : warning C4819: The file contains a character that cannot be represented in the current code page (950). Save the file in Unicode format to prevent data loss
C:\boost\include\boost-1_33_1\boost/lexical_cast.hpp : warning C4819: The file contains a character that cannot be represented in the current code page (950). Save the file in Unicode format to prevent data loss
C:\boost\include\boost-1_33_1\boost/utility/enable_if.hpp : warning C4819: The file contains a character that cannot be represented in the current code page (950). Save the file in Unicode format to prevent data loss
C:\boost\include\boost-1_33_1\boost/type_traits/is_base_and_derived.hpp : warning C4819: The file contains a character that cannot be represented in the current code page (950). Save the file in Unicode format to prevent data loss
C:\boost\include\boost-1_33_1\boost/lexical_cast.hpp : warning C4819: The file contains a character that cannot be represented in the current code page (950). Save the file in Unicode format to prevent data loss
C:\boost\include\boost-1_33_1\boost/tokenizer.hpp : warning C4819: The file contains a character that cannot be represented in the current code page (950). Save the file in Unicode format to prevent data loss
C:\boost\include\boost-1_33_1\boost/lexical_cast.hpp : warning C4819: The file contains a character that cannot be represented in the current code page (950). Save the file in Unicode format to prevent data loss
C:\boost\include\boost-1_33_1\boost/lexical_cast.hpp : warning C4819: The file contains a character that cannot be represented in the current code page (950). Save the file in Unicode format to prevent data loss
C:\boost\include\boost-1_33_1\boost/tokenizer.hpp : warning C4819: The file contains a character that cannot be represented in the current code page (950). Save the file in Unicode format to prevent data loss
C:\boost\include\boost-1_33_1\boost/lexical_cast.hpp : warning C4819: The file contains a character that cannot be represented in the current code page (950). Save the file in Unicode format to prevent data loss
C:\boost\include\boost-1_33_1\boost/format/internals.hpp : warning C4819: The file contains a character that cannot be represented in the current code page (950). Save the file in Unicode format to prevent data loss
C:\boost\include\boost-1_33_1\boost/format/alt_sstream_impl.hpp : warning C4819: The file contains a character that cannot be represented in the current code page (950). Save the file in Unicode format to prevent data loss
C:\boost\include\boost-1_33_1\boost/format/internals.hpp : warning C4819: The file contains a character that cannot be represented in the current code page (950). Save the file in Unicode format to prevent data loss
C:\boost\include\boost-1_33_1\boost/format/alt_sstream_impl.hpp(252) : warning C4996: 'std::char_traits<char>::copy': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators'
        C:\Program Files\Microsoft Visual Studio 8\VC\include\iosfwd(446) : see declaration of 'std::char_traits<char>::copy'
        C:\boost\include\boost-1_33_1\boost/format/alt_sstream_impl.hpp(223) : while compiling class template member function 'int boost::io::basic_altstringbuf<Ch,Tr,Alloc>::overflow(int)'
        with
        [
            Ch=char,
            Tr=std::char_traits<char>,
            Alloc=std::allocator<char>
        ]
        C:\boost\include\boost-1_33_1\boost/format/format_class.hpp(136) : see reference to class template instantiation 'boost::io::basic_altstringbuf<Ch,Tr,Alloc>' being compiled
        with
        [
            Ch=char,
            Tr=std::char_traits<char>,
            Alloc=std::allocator<char>
        ]
        procs.cpp(235) : see reference to class template instantiation 'boost::basic_format<Ch>' being compiled
        with
        [
            Ch=char
        ]
	Rc /r -DWIN32 -D_WIN32 -DWINVER=0x0500 -DDEBUG -D_DEBUG  /fo procs.res procs.rc
	link /NODEFAULTLIB:library  procs.obj procs.res -out:procs.dll /LIBPATH:C:\boost\lib libboost_date_time-vc80-mt-s.lib
Microsoft (R) Incremental Linker Version 8.00.50727.762
Copyright (C) Microsoft Corporation.  All rights reserved.

LIBCMT.lib(invarg.obj) : error LNK2005: __initp_misc_invarg already defined in LIBCMTD.lib(invarg.obj)
LIBCMT.lib(invarg.obj) : error LNK2005: __invoke_watson already defined in LIBCMTD.lib(invarg.obj)
LIBCMT.lib(invarg.obj) : error LNK2005: __set_invalid_parameter_handler already defined in LIBCMTD.lib(invarg.obj)
LIBCMT.lib(invarg.obj) : error LNK2005: __get_invalid_parameter_handler already defined in LIBCMTD.lib(invarg.obj)
LIBCMT.lib(invarg.obj) : error LNK2005: "void __cdecl _invoke_watson(unsigned short const *,unsigned short const *,unsigned short const *,unsigned int,unsigned int)" (?_invoke_watson@@YAXPBG00II@Z) already defined in LIBCMTD.lib(invarg.obj)
LIBCMT.lib(invarg.obj) : error LNK2005: __invalid_parameter already defined in LIBCMTD.lib(invarg.obj)
LIBCMT.lib(invarg.obj) : error LNK2005: "void __cdecl _invalid_parameter(unsigned short const *,unsigned short const *,unsigned short const *,unsigned int,unsigned int)" (?_invalid_parameter@@YAXPBG00II@Z) already defined in LIBCMTD.lib(invarg.obj)
LIBCMT.lib(invarg.obj) : error LNK2005: ___pInvalidArgHandler already defined in LIBCMTD.lib(invarg.obj)
   Creating library procs.lib and object procs.exp
LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
LIBCMTD.lib(crt0.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
procs.dll : fatal error LNK1120: 1 unresolved externals
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 8\VC\BIN\link.EXE"' : return code '0x460'
Stop.

C:\bbwin09\trunk\Core\Agents\procs>

使用 GUI 方法構建 bbwin

[編輯 | 編輯原始碼]
  • 簽出原始碼
  • 開啟 bbwin.sln
follow text will turn into wiki procedure above.
Build file for BBWin
    2 ==============================================================
    3 
    4 This file explains you how to build BBWin from the sources.
    5 
    6 
    7 Getting the last sources 
    8 ========================
    9 
   10 BBWin is developped in C++ (the Standard Template Library and the Standard C++ Library
   11 are used)
   12 The source of BBWin are available from the sourceforge subversion
   13 repository for the BBWin projects :
   14 http://svn.sourceforge.net/viewcvs.cgi/bbwin/
   15 
   16 
   17 Install the tools
   18 =================
   19 
   20 BBWin has been developped thanks to many tools. You should install them to 
   21 build BBWin easily without troubles.
   22 
   23 Windows Platform SDK 2003 : it is used for the development environment.
   24 It is use to have the complete sdk to develop programs on Microsoft OS.
   25 You can download it for free from microsoft website :
   26 http://www.microsoft.com/downloads/details.aspx?FamilyId=A55B6B43-E24F-4EA3-A93E-40C0EC4F68E5&displaylang=en
   27 You will need 1 gb of free space if you install every thing :)

   28 BBWin Makefiles are using the nmake tool and Makefile templates from the SDK.
   29 This SDK is very important for anyone who would like to start developing under Windows.
   30 
   31 Visual C++ Toolkit : it is the compiler used to build the bbwin release
   32 It is the original compiler from Visual Studio 2003 Professional (Code optimisation is included)
   33 You can download it for free from the Microsoft website :
   34 http://msdn.microsoft.com/visualc/vctoolkit2003/
   35 
   36 Wix Toolkit : this package is used to build the BBWin MSI installer
   37 You should install it and have the bin directory in your current path
   38 http://sourceforge.net/projects/wix/
   39 
   40 TinyXML : BBWin used the excellent TinyXML library for the configuration loading XML.
   41 You do not need to install it. TinyXML sources are included in BBWin sources.
   42 
   43 Boost Lib : These powerful C++ libraries are used for some agents and will be
   44 certainly used in the BBWin core service in the future.
   45 You should get the boost C++ from the website : 
   46 http://www.boost.org/
   47 Build it in the directory C:\boost so you won't have to change BBWin Makefiles.
   48 If you want to build BBWin with Visual C++ Express 2005, please read the following page :
   49 http://www.boost.org/tools/build/v1/vc-8_0-tools.html
   50 
   51 
   52 I recommand you the Notepad++ editor if you are looking for a nice free code editor.
   53 You can download it from : 
   54 http://notepad-plus.sourceforge.net
   55 
   56 
   57 
   58 Building the BBWin with Visual C++ Express 2005
   59 ===============================================
   60 
   61 Open the BBWin.sln file at the top directory of the project
   62 First, you should prepare your Visual C++ configuration by adding
   63 in the default bin, include and lib directories the different directories from :
   64 
   65 - the platform SDK
   66 - the boost libraries
   67 
   68 Then just build the solution.
   69 
   70 
   71 Building the BBWin with Visual C++ ToolKit 2003
   72 ===============================================
   73 
   74 Open a Platform SDK Build command line environment (installed with the Platform SDK)
   75 Go the top directory of the BBWin source tree
   76 Type nmake
   77 Go get a cup of coffee
   78 It's ready !
   79 
   80 If you get errors, it may be due to some errors in your include or lib path.
   81 Make sure the environment variables %Lib%; %Path% and %Include% are correctly 
   82 configured. You may need to add some directories.
   83 
   84 Building process order
   85 ======================
   86 
   87 1) BBWin core service
   88 2) Agents
   89 3) Externals (needing compilation)
   90 4) Setup MSI
   91 
  • 使用 nmake 建立 BBwin.msi 的示例
C:\tmp\test\trunk\Setup>nmake clean

Microsoft (R) Program Maintenance Utility Version 8.00.50727.42
Copyright (C) Microsoft Corporation.  All rights reserved.

        erase /q /s BBWin.dll BBWin.exp UpgradeConfiguration.obj BBWin.res BBWin
.wixobj BBWin.msi BBWin.lib
Deleted file - C:\tmp\test\trunk\Setup\BBWin.wixobj
Deleted file - C:\tmp\test\trunk\Setup\BBWin.msi

C:\tmp\test\trunk\Setup>nmake

Microsoft (R) Program Maintenance Utility Version 8.00.50727.42
Copyright (C) Microsoft Corporation.  All rights reserved.

        candle /nologo BBWin.wxs
BBWin.wxs
        light /nologo BBWin.wixobj

C:\tmp\test\trunk\Setup>

bbwin 0.9 包源

[編輯 | 編輯原始碼]

Hobbit 伺服器軟體構建源

[編輯 | 編輯原始碼]

如何使用 hobbit-4.0.3.sb 構建原始碼 ?

[編輯 | 編輯原始碼]
  • hobbit-4.0.3.sb 是一個 XML 檔案,包含構建 hobbit-4.03 的詳細步驟,用於不同作業系統的二進位制程式碼。它需要針對“sb”工具執行。
  • 待定。

原始碼 : hobbit-4.0.3.sb

[編輯 | 編輯原始碼]
[root] cat hobbit-4.0.3.sb
<?xml version="1.0"?>
<programs>
  <program name="hobbit" version="4.0.3" revision="1">
    <module name="default">
    <build-name>hobbit-4.0.3</build-name>
    <install-name>hobbit</install-name>
    <syntaxhighlights>
    <syntaxhighlight  path="src/hobbit-4.0.3.tar.gz" />
    </sources>
    <dependencies>
      <depend var="fping">fping24</depend>
      <depend var="APACHESS">apacheS2048</depend>
      <depend var="RRDTOOL">rrdtool10</depend>
      <depend var="PCRE">libpcre44</depend>
      <depend var="OPENSSL">libopenssl097</depend>
      <depend var="OPENLDAP">openldap2127</depend>
    </dependencies>
    <!--
    ######################################
    # Platform specific configuration
    ######################################
    -->
     <configure>
<![CDATA[
    case "${SB_SYSTYPE}" in
    *-hpux11.11)
      ;;
    *-hpux10.20)
      ;;
    *-linux*)
     ;;
    *-solaris2*)
    ;;
    esac
set -x
rm -f Makefile
TARGET=hobbit \
ENABLESSL=y \
ENABLELDAP=y \
ENABLELDAPSSL=y \
BBUSER=hobbit \
BBTOPDIR=/opt/TWWfsw/hobbit \
BBVAR=/var/opt/TWWfsw/hobbit/data \
BBHOSTURL=/hobbit \
CGIDIR=/etc/opt/TWWfsw/apacheS2048/cgi-bin \
BBCGIURL=/hobbit-cgi \
SECURECGIDIR=/etc/opt/TWWfsw/apacheS2048/cgi-secure \
SECUREBBCGIURL=/hobbit-seccgi \
HTTPDGID=il02w-web \
BBLOGDIR=/var/opt/TWWfsw/hobbit/log/hobbit \
BBHOSTNAME=localhost \
BBHOSTIP=127.0.0.1 \
MANROOT=/opt/TWWfsw/hobbit/man \
BARS=all \
USENEWHIST=y \
PIXELCOUNT=960 \
MAKE=/opt/TWWfsw/bin/gmake \
INSTALLBINDIR=/opt/TWWfsw/hobbit/server/bin \
INSTALLETCDIR=/opt/TWWfsw/hobbit/server/etc \
INSTALLWEBDIR=/opt/TWWfsw/hobbit/web \
INSTALLEXTDIR=/opt/TWWfsw/hobbit/server  \
INSTALLTMPDIR=/var/opt/TWWfsw/hobbit/tmp \
INSTALLWWWDIR=/opt/TWWfsw/hobbit/server/www ./configure \
--rrdinclude  /opt/TWWfsw/rrdtool10/include  \
--rrdlib      /opt/TWWfsw/rrdtool10/lib       \
--pcreinclude /opt/TWWfsw/libpcre44/include   \
--pcrelib     /opt/TWWfsw/libpcre44/lib       \
--sslinclude  /opt/TWWfsw/libopenssl097/include    \
--ssllib      /opt/TWWfsw/libopenssl097/lib      \
--ldapinclude /opt/TWWfsw/openldap2127/include     \
--ldaplib     /opt/TWWfsw/openldap2127/lib     \
--fping       /opt/TWWfsw/fping24/sbin/fping

]]>
      </configure>

<!--
######################################
# Now build (compile) the software
######################################
-->
<build>
<![CDATA[
case "${SB_SYSTYPE}" in
*-hpux11.11)
gmake
  ;;
*-hpux10.20)
  ;;
*-linux*)
gmake
 ;;
*-solaris2.[689])
gmake
 ;;
esac
]]>
      </build>
      <install>
<![CDATA[
########################################################
# building hobbit on different OS
########################################################
case "${SB_SYSTYPE}" in
*-hpux11.11)
gmake install
  ;;
*-hpux10.20)
  ;;
*-linux*)
gmake install
 ;;
*-solaris2.[689])
LD_LIBRARY_PATH=/opt/TWWfsw/libopenssl097/lib
export LD_LIBRARY_PATH
gmake install
 ;;
esac
## create man directory for TWW
#ln -s /opt/TWWfsw/hobbit/server/bin  /opt/TWWfsw/hobbit/bin
#mkdir -p /opt/TWWfsw/hobbit/man
#cp -rp /opt/TWWfsw/hobbit/server/www/help/manpages/*  /opt/TWWfsw/hobbit/man
#

]]>
      </install>

      <uninstall>
<![CDATA[
set -x
rm -rf /opt/TWWfsw/hobbit
rm -rf /etc/opt/TWWfsw/apacheS2048/cgi-secure
rm -rf /etc/opt/TWWfsw/apacheS2048/cgi-bin/bb-*
rm -rf /etc/opt/TWWfsw/apacheS2048/cgi-bin/hobbit*
rm -rf /var/opt/TWWfsw/hobbit
]]>
      </uninstall>
    </module>

    <notes>
      <note type="installation">
        <para>
         This sb file is to digitalize the hobbit software build process for different OS.
         Original: 05/26/2005 T.J.Yang tj_yang at hotmail do com 
        </para>
       </note>
    </notes>

    <changelog>
    </changelog>
  </program>
</programs>

[root]

Hobbit 伺服器包構建源

[編輯 | 編輯原始碼]

hobbit-4.0.3.pb

[編輯 | 編輯原始碼]
[root] cat hobbit-4.0.3.pb
<?xml version="1.0"?>
<packages>
  <package name="hobbit" version="4.0.3" revision="1">
    <package-manager name="depot">
      <title>hobbit</title>
      <vendor>GPL</vendor>
      <description >
      </description>
      <install-name>hobbit</install-name>
      <pkgname-base>TWWhobbit</pkgname-base>

      <version>4.0.3</version>
      <revision>1</revision>
      <subpkg type="runtime">
      </subpkg>
    </package-manager>

    <package-manager name="rpm4">
      <category>System Environment/Daemons</category>
      <title>Hobbit System Monitoring Tool</title>
      <vendor>GNU</vendor>
      <description>
Hobbit System Monitoring tool. An open-source version of Big Brother.
      </description>
      <install-name>hobbit</install-name>
      <pkgname-base>TWWhobbit</pkgname-base>
      <init name="/etc/init.d/TWWhobbit" path="pkg/hobbit-init-linux" />
      <init link-src="/etc/rc2.d/S661hobbit"
        link-dest="/etc/init.d/TWWhobbit"/>
      <init link-src="/etc/rc1.d/K269hobbit"
        link-dest="/etc/init.d/TWWhobbit"/>
      <config>/etc/init.d/TWWhobbit</config>
      <version>4.0.3</version>
      <revision>1</revision>
      <subpkg type="runtime">
      <depend pkgname-base="TWWperl561" title="perl 5.6.1" subpkg="runtime">v>=5.6.1 r>=1</depend>
      <depend pkgname-base="TWWrrdtool10" title="Round Robin Database" subpkg="runtime">v>=1.0.42</depend>
      <depend pkgname-base="TWWrrdtool10" title="Round Robin Database" subpkg="man">v>=1.0.42</depend>
      </subpkg>

      <subpkg type="conf">
        <depend pkgname-base="TWWhobbit"  title="Client: Big Brother System Monitoring Tool" subpkg="runtime">v>=4.0.3</depend>
         <postinstall path="pkg/postinstall-linux" />
         <preremove   path="pkg/preremove-linux" />
         <postremove  path="pkg/postremove-linux" />
       </subpkg>

    </package-manager>
  </package>
</packages>
[root]

Hobbit所需軟體包

[編輯 | 編輯原始碼]
  • fping
  • apache web伺服器
  • rrdtool
  • pcre
  • openssl
  • openldap
  • 以下是構建hobbit-4.0.3的精確版本列表
    <dependencies>
      <depend var="fping">fping24</depend>
      <depend var="APACHESS">apacheS2048</depend>
      <depend var="RRDTOOL">rrdtool10</depend>
      <depend var="PCRE">libpcre44</depend>
      <depend var="OPENSSL">libopenssl097</depend>
      <depend var="OPENLDAP">openldap2127</depend>
    </dependencies>
 

以下圖表使用GraphViz列出了所有hobbit依賴的軟體

[編輯 | 編輯原始碼]
TBA.

軟體包構建自動化

[編輯 | 編輯原始碼]

自動化整個過程的Makefile

[編輯 | 編輯原始碼]

為hobbit伺服器建立Firefox搜尋引擎外掛

[編輯 | 編輯原始碼]

在Xymon伺服器中使用關係型資料庫

[編輯 | 編輯原始碼]

Xymon的預設資料庫後端是RRD(Roun-Robin Database)。

資料庫

[編輯 | 編輯原始碼]
  • 幾乎與C的fopen函式程式碼一樣快。
  • 沒有伺服器程序,資料儲存在普通檔案中。
  • 就像另一個rrd檔案,可以同步到您的備用xymon伺服器。
  • 輕量級資料庫。

XML平面檔案

[編輯 | 編輯原始碼]

使用關係型資料庫的優勢

[編輯 | 編輯原始碼]

庫存監控

[編輯 | 編輯原始碼]
  • 儲存機器的資產資訊
    • 序列號
    • 作業系統型別
    • 電腦製造商
    • 租賃/自有
    • 租賃到期時觸發警報。
    • 顯示作業系統型別、製造商等的餅圖。

bb-hosts生成

[編輯 | 編輯原始碼]
  • bb-hosts檔案從主機資料庫表中生成。

MVC實現

[編輯 | 編輯原始碼]

Mysql + PHP + EXTJS

[編輯 | 編輯原始碼]

Catalyst/SQLite

[編輯 | 編輯原始碼]
物料清單
[編輯 | 編輯原始碼]
  • Catalyst書籍1
  • perl-5.10.0
  • Fedora 11
  • 書籍1中的地址簿示例。
  • SQLite3
  • Catalyst::Runtime,Catalyst::Plugins::*,Catalyst::Devel。
  • 建立資產模式的SQL檔案。
  • 使用catalyst.pl使用示例模板啟動您的MVC專案。
[tjyang@t-fedora11 test]$ catalyst.pl xymonasset
created "xymonasset"
created "xymonasset/script"
created "xymonasset/lib"
created "xymonasset/root"
created "xymonasset/root/static"
created "xymonasset/root/static/images"
created "xymonasset/t"
created "xymonasset/lib/xymonasset"
created "xymonasset/lib/xymonasset/Model"
created "xymonasset/lib/xymonasset/View"
created "xymonasset/lib/xymonasset/Controller"
created "xymonasset/xymonasset.conf"
created "xymonasset/lib/xymonasset.pm"
created "xymonasset/lib/xymonasset/Controller/Root.pm"
created "xymonasset/README"
created "xymonasset/Changes"
created "xymonasset/t/01app.t"
created "xymonasset/t/02pod.t"
created "xymonasset/t/03podcoverage.t"
created "xymonasset/root/static/images/catalyst_logo.png"
created "xymonasset/root/static/images/btn_120x50_built.png"
created "xymonasset/root/static/images/btn_120x50_built_shadow.png"
created "xymonasset/root/static/images/btn_120x50_powered.png"
created "xymonasset/root/static/images/btn_120x50_powered_shadow.png"
created "xymonasset/root/static/images/btn_88x31_built.png"
created "xymonasset/root/static/images/btn_88x31_built_shadow.png"
created "xymonasset/root/static/images/btn_88x31_powered.png"
created "xymonasset/root/static/images/btn_88x31_powered_shadow.png"
created "xymonasset/root/favicon.ico"
created "xymonasset/Makefile.PL"
created "xymonasset/script/xymonasset_cgi.pl"
created "xymonasset/script/xymonasset_fastcgi.pl"
created "xymonasset/script/xymonasset_server.pl"
created "xymonasset/script/xymonasset_test.pl"
created "xymonasset/script/xymonasset_create.pl"
[tjyang@t-fedora11 test]$ catalyst.pl 
  • perl Makefile.PL
[tjyang@t-fedora11 xymonasset]$ perl Makefile.PL
include /var/www/html/test/xymonasset/inc/Module/Install.pm
include inc/Module/Install/Metadata.pm
include inc/Module/Install/Base.pm
Cannot determine perl version info from lib/xymonasset.pm
include inc/Module/Install/Catalyst.pm
*** Module::Install::Catalyst
include inc/Module/Install/Makefile.pm
Please run "make catalyst_par" to create the PAR package!
*** Module::Install::Catalyst finished.
include inc/Module/Install/Scripts.pm
include inc/Module/Install/AutoInstall.pm
include inc/Module/Install/Include.pm
include inc/Module/AutoInstall.pm
*** Module::AutoInstall version 1.03
*** Checking for Perl dependencies...
[Core Features]
- Catalyst::Runtime                ...loaded. (5.71001 >= 5.71001)
- Catalyst::Plugin::ConfigLoader   ...loaded. (0.22)
- Catalyst::Plugin::Static::Simple ...loaded. (0.20)
- Catalyst::Action::RenderView     ...loaded. (0.09)
- parent                           ...loaded. (0.221)
- Config::General                  ...loaded. (2.42)
*** Module::AutoInstall configuration finished.
include inc/Module/Install/WriteAll.pm
include inc/Module/Install/Win32.pm
include inc/Module/Install/Can.pm
include inc/Module/Install/Fetch.pm
Writing Makefile for xymonasset
Writing META.yml
[tjyang@t-fedora11 xymonasset]$

升級Xymon Web GUI

[編輯 | 編輯原始碼]

當前的Xymon(Hobbit)是用C語言編寫的,並使用CGI和html程式碼來組成一個簡單的Web介面。最近,我們有幾個javascript框架選擇來升級xymon伺服器,使用RIA Web介面。

使用qwikioffice構建Xymon儀表盤

[編輯 | 編輯原始碼]

使用 Tomatocart 的管理工具進行 Xymon 管理

[編輯 | 編輯原始碼]

將 Xymon C/CGI 替換為 C/EXTJS

[編輯 | 編輯原始碼]

編譯錯誤和警告

[編輯 | 編輯原始碼]

可能的解決方案

[編輯 | 編輯原始碼]
  • 從 hobbit 原始碼樹中移除 "unsigned char" 的使用。
 find . -type f -name "*.[c|h]" -exec perl -pi -e 's!unsigned\schar!char!g' {} \;
  • 將需要使用 unsigned 的字元進行型別轉換。

GCC 編譯警告

[編輯 | 編輯原始碼]

4.3.0 C 原始碼示例列表中的編譯警告

[編輯 | 編輯原始碼]
[tjyang@f12 4.3.0]$ gmake
MAKE="gmake" CC="gcc" CFLAGS="-g -O2 -Wall -Wno-unused -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DLINUX -I. -I`pwd`/include -DCLIENTONLY=1" LDFLAGS="" `pwd`/build/genconfig.sh
Checking for socklen_t
Checking for snprintf
Checking for vsnprintf
Checking for rpc/rpcent.h
Checking for sys/select.h
Checking for u_int32_t typedef
Checking for PATH_MAX definition
Checking for SHUT_RD/WR/RDWR definitions
Checking for strtoll()
config.h created
<snip>
gcc -g -O2 -Wall -Wno-unused -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DLINUX -I. -I/home/tjyang/hobbitmon/branches/4.3.0/include -DCLIENTONLY=1 -I. -I../include    -c -o digest.o digest.c
digest.c: In function âmd5hashâ:
digest.c:40: warning: pointer targets in passing argument 2 of âmyMD5_Updateâ differ in signedness
/home/tjyang/hobbitmon/branches/4.3.0/include/../lib/md5.h:18: note: expected âunsigned char *â but argument is of type âchar *â
gcc -g -O2 -Wall -Wno-unused -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DLINUX -I. -I/home/tjyang/hobbitmon/branches/4.3.0/include -DCLIENTONLY=1 -I. -I../include    -c -o encoding.o encoding.c
encoding.c: In function âbase64encodeâ:
encoding.c:31: warning: pointer targets in passing argument 1 of âstrlenâ differ in signedness
/usr/include/string.h:397: note: expected âconst char *â but argument is of type âunsigned char *â
encoding.c:34: warning: pointer targets in passing argument 1 of âstrlenâ differ in signedness
/usr/include/string.h:397: note: expected âconst char *â but argument is of type âunsigned char *â
encoding.c:50: warning: pointer targets in passing argument 1 of âstrlenâ differ in signedness
/usr/include/string.h:397: note: expected âconst char *â but argument is of type âunsigned char *â
encoding.c:60: warning: pointer targets in passing argument 1 of âstrlenâ differ in signedness
/usr/include/string.h:397: note: expected âconst char *â but argument is of type âunsigned char *â
encoding.c:75: warning: pointer targets in return differ in signedness
encoding.c: In function âbase64decodeâ:
encoding.c:86: warning: pointer targets in passing argument 1 of âstrlenâ differ in signedness
/usr/include/string.h:397: note: expected âconst char *â but argument is of type âunsigned char *â
encoding.c:114: warning: pointer targets in return differ in signedness
encoding.c: In function âgetescapestringâ:
encoding.c:125: warning: pointer targets in assignment differ in signedness
encoding.c: In function ânlencodeâ:
encoding.c:181: warning: pointer targets in assignment differ in signedness
encoding.c:183: warning: pointer targets in passing argument 1 of âstrlenâ differ in signedness
/usr/include/string.h:397: note: expected âconst char *â but argument is of type âunsigned char *â
encoding.c:187: warning: pointer targets in assignment differ in signedness
encoding.c:191: warning: pointer targets in assignment differ in signedness
encoding.c:198: warning: pointer targets in passing argument 1 of â__builtin_strcspnâ differ in signedness
encoding.c:198: note: expected âconst char *â but argument is of type âunsigned char *â
encoding.c:198: warning: pointer targets in passing argument 1 of âstrlenâ differ in signedness
/usr/include/string.h:397: note: expected âconst char *â but argument is of type âunsigned char *â
encoding.c:198: warning: pointer targets in passing argument 1 of â__strcspn_c1â differ in signedness
/usr/include/bits/string2.h:971: note: expected âconst char *â but argument is of type âunsigned char *â
encoding.c:198: warning: pointer targets in passing argument 1 of â__strcspn_c2â differ in signedness
/usr/include/bits/string2.h:982: note: expected âconst char *â but argument is of type âunsigned char *â
encoding.c:198: warning: pointer targets in passing argument 1 of â__strcspn_c3â differ in signedness
/usr/include/bits/string2.h:994: note: expected âconst char *â but argument is of type âunsigned char *â
encoding.c:198: warning: pointer targets in passing argument 1 of â__builtin_strcspnâ differ in signedness
encoding.c:198: note: expected âconst char *â but argument is of type âunsigned char *â
encoding.c:198: warning: pointer targets in passing argument 1 of â__builtin_strcspnâ differ in signedness
encoding.c:198: note: expected âconst char *â but argument is of type âunsigned char *â
encoding.c: In function ânldecodeâ:
encoding.c:231: warning: pointer targets in passing argument 1 of â__builtin_strcspnâ differ in signedness
encoding.c:231: note: expected âconst char *â but argument is of type âunsigned char *â
encoding.c:231: warning: pointer targets in passing argument 1 of âstrlenâ differ in signedness
/usr/include/string.h:397: note: expected âconst char *â but argument is of type âunsigned char *â
encoding.c:231: warning: pointer targets in passing argument 1 of â__strcspn_c1â differ in signedness
/usr/include/bits/string2.h:971: note: expected âconst char *â but argument is of type âunsigned char *â
encoding.c:231: warning: pointer targets in passing argument 1 of â__strcspn_c2â differ in signedness
/usr/include/bits/string2.h:982: note: expected âconst char *â but argument is of type âunsigned char *â
encoding.c:231: warning: pointer targets in passing argument 1 of â__strcspn_c3â differ in signedness
/usr/include/bits/string2.h:994: note: expected âconst char *â but argument is of type âunsigned char *â
encoding.c:231: warning: pointer targets in passing argument 1 of â__builtin_strcspnâ differ in signedness
encoding.c:231: note: expected âconst char *â but argument is of type âunsigned char *â
encoding.c:231: warning: pointer targets in passing argument 1 of â__builtin_strcspnâ differ in signedness
encoding.c:231: note: expected âconst char *â but argument is of type âunsigned char *â
<snip>
loadhosts.c: In function âbbh_find_itemâ:
loadhosts.c:228: warning: return discards qualifiers from pointer target type
loadhosts.c: In function âbbh_itemâ:
loadhosts.c:540: warning: pointer targets in passing argument 1 of ânlencodeâ differ in signedness
/home/tjyang/hobbitmon/branches/4.3.0/include/../lib/encoding.h:17: note: expected âunsigned char *â but argument is of type âchar *â
loadhosts.c:540: warning: pointer targets in passing argument 2 of âaddtobufferâ differ in signedness
/home/tjyang/hobbitmon/branches/4.3.0/include/../lib/strfunc.h:16: note: expected âchar *â but argument is of type âunsigned char *â
loadhosts.c: In function âbbh_item_idâ:
loadhosts.c:619: warning: return discards qualifiers from pointer target type
<snip>
msort.c: In function âmsortâ:
msort.c:119: warning: passing argument 4 of âqsortâ from incompatible pointer type
/usr/include/stdlib.h:756: note: expected â__compar_fn_tâ but argument is of type âint (*)(void **, void **)â
<snip>
sha2.c: In function âmySHA224_Finalâ:
sha2.c:972: warning: pointer targets in passing argument 2 of âsha224_finalâ differ in signedness
sha2.c:812: note: expected âunsigned char *â but argument is of type âchar *â
sha2.c: In function âmySHA256_Finalâ:
sha2.c:977: warning: pointer targets in passing argument 2 of âsha256_finalâ differ in signedness
sha2.c:417: note: expected âunsigned char *â but argument is of type âchar *â
gcc -g -O2 -Wall -Wno-unused -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DLINUX -I. -I/home/tjyang/hobbitmon/branches/4.3.0/include -DCLIENTONLY=1 -I. -I../include    -c -o sig.o sig.c
<snip>
gcc -g -O2 -Wall -Wno-unused -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DLINUX -I. -I/home/tjyang/hobbitmon/branches/4.3.0/include -DCLIENTONLY=1 -I. -I../include  -DCLIENTONLY -c -o timefunc-client.o timefunc.c
ar cr hobbitclient.a osdefs.o cgiurls.o color-client.o digest.o encoding.o environ-client.o errormsg.o holidays.o ipaccess.o loadhosts.o md5.o memory.o misc.o msort.o rbtr.o rmd160c.o sendmsg.o sha1.o sha2.o sig.o stackio.o strfunc.o suid.o timefunc-client.o
ranlib hobbitclient.a || echo ""
gmake[1]: Leaving directory `/home/tjyang/hobbitmon/branches/4.3.0/lib'
CC="gcc" CFLAGS="-g -O2 -Wall -Wno-unused -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DLINUX -I. -I`pwd`/include -DCLIENTONLY=1" LDFLAGS="" RPATHOPT="-Wl,--rpath," SSLFLAGS="" SSLINCDIR="" SSLLIBS="" NETLIBS="" LIBRTDEF="-lrt" BBHOME="/home/xymon/client" gmake -C common client
gmake[1]: Entering directory `/home/tjyang/hobbitmon/branches/4.3.0/common'
<snip>
gcc -g -O2 -Wall -Wno-unused -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DLINUX -I. -I/home/tjyang/hobbitmon/branches/4.3.0/include -DCLIENTONLY=1 -c -o bbdigest.o bbdigest.c
bbdigest.c: In function âmainâ:
bbdigest.c:48: warning: pointer targets in passing argument 2 of âdigest_dataâ differ in signedness
/home/tjyang/hobbitmon/branches/4.3.0/include/../lib/digest.h:26: note: expected âunsigned char *â but argument is of type âchar *â
gcc -g -O2 -Wall -Wno-unused -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DLINUX -I. -I/home/tjyang/hobbitmon/branches/4.3.0/include -DCLIENTONLY=1 -o ../client/bbdigest bbdigest.o ../lib/hobbitclient.a  -lrt
gmake[1]: Leaving directory `/home/tjyang/hobbitmon/branches/4.3.0/common'
CC="gcc" CFLAGS="-g -O2 -Wall -Wno-unused -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DLINUX -I. -I`pwd`/include -DCLIENTONLY=1" LDFLAGS="" RPATHOPT="-Wl,--rpath," SSLLIBS="" NETLIBS="" LIBRTDEF="-lrt" BBHOME="/home/xymon/client" gmake -C build all
gmake[1]: Entering directory `/home/tjyang/hobbitmon/branches/4.3.0/build'
gcc -o merge-lines -g -O2 -Wall -Wno-unused -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DLINUX -I. -I/home/tjyang/hobbitmon/branches/4.3.0/include -DCLIENTONLY=1 merge-lines.c
gcc -o merge-sects -g -O2 -Wall -Wno-unused -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DLINUX -I. -I/home/tjyang/hobbitmon/branches/4.3.0/include -DCLIENTONLY=1 merge-sects.c
gcc -o setup-newfiles -g -O2 -Wall -Wno-unused -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DLINUX -I. -I/home/tjyang/hobbitmon/branches/4.3.0/include -DCLIENTONLY=1 -Wl,--rpath, setup-newfiles.c ../lib/hobbitclient.a   -lrt
setup-newfiles.c: In function âmainâ:
setup-newfiles.c:27: warning: pointer targets in assignment differ in signedness
setup-newfiles.c:79: warning: pointer targets in passing argument 1 of âstrstrâ differ in signedness
/usr/include/string.h:340: note: expected âconst char *â but argument is of type âunsigned char *â
gmake[1]: Leaving directory `/home/tjyang/hobbitmon/branches/4.3.0/build'
CC="gcc" CFLAGS="-g -O2 -Wall -Wno-unused -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DLINUX -I. -I`pwd`/include -DCLIENTONLY=1" BBHOME="/home/xymon/client" BBHOSTIP="127.0.0.1" LOCALCLIENT="no" NETLIBS="" LIBRTDEF="-lrt" gmake -C client all
gmake[1]: Entering directory `/home/tjyang/hobbitmon/branches/4.3.0/client'
<snip>
msgcache.c: In function âmainâ:
msgcache.c:537: warning: pointer targets in passing argument 3 of âacceptâ differ in signedness
/usr/include/sys/socket.h:214: note: expected âsocklen_t * __restrict__â but argument is of type âint *â
cat hobbitclient.cfg.DIST | sed -e 's!@BBHOSTIP@!127.0.0.1!g' >hobbitclient.cfg
../build/bb-commands.sh >>hobbitclient.cfg
cat clientlaunch.cfg.DIST | sed -e 's!@CLIENTFLAGS@!!g' >clientlaunch.cfg
gmake[1]: Leaving directory `/home/tjyang/hobbitmon/branches/4.3.0/client'

Build complete. Now run 'gmake install' as root

[tjyang@f12 4.3.0]$

Xymon GUI 想法

[編輯 | 編輯原始碼]

GUI 需求

[編輯 | 編輯原始碼]
  1. 為了相容性,保留 cgi+html+tigramenu。
  2. 包含現代的 Javascript GUI 框架,如 extjs 或 jQuery。
  3. 使用 AJAX 從客戶端提供即時的網頁 GUI 更新。
    1. 等待 1 分鐘以上才能看到網頁上的變化,勉強可以接受,但希望避免。

來自 Neil Franken

[編輯 | 編輯原始碼]
  1. 使用 CSS 方便地更改主題和解析度。
    1. 解析度
    2. 主題
  2. 在不同檢視中,允許對列進行細粒度的控制。

來自 T.J. Yang

[編輯 | 編輯原始碼]

我發現將以下現有的開源軟體組合在一起可以構成 Xymon 的新 GUI。終端使用者仍然可以看到舊的 cgi+html GUI。

  1. 使用 extjs 作為新的 GUI,使用 miframe.js 在框架中包含舊的 tigra 選單 GUI。
  2. 參見 Xymon 桌面原型.

[失效連結]

使用命令列工具更新本維基百科書籍

[編輯 | 編輯原始碼]

在 perl 中安裝 mediawiki 客戶端

[編輯 | 編輯原始碼]
華夏公益教科書