跳轉到內容

使用 Xymon 進行系統監控 / 其他文件 / 常見問題解答

來自華夏公益教科書,開放世界開放書籍

介紹性常見問題解答

[編輯 | 編輯原始碼]

問:什麼是 hobbit?

[編輯 | 編輯原始碼]

答:Hobbit 是 Xymon 系統監控工具的舊名稱。 http://www.hswn.dk/hobbit/help/about.html

問:什麼是 Xymon?

[編輯 | 編輯原始碼]

問:為什麼我應該使用 Xymon 而不是 BB?

[編輯 | 編輯原始碼]

使用者常見問題解答

[編輯 | 編輯原始碼]

下一個版本什麼時候釋出?

[編輯 | 編輯原始碼]

答:Hobbit 是一個由 FOSS 專案,由 hobbit 開發者 在閒暇時間貢獻。它處於積極開發中,但尚未宣佈下一個版本的釋出日期。如果需要,可以從 sourceforge 下載當前的開發快照。如果您正在追查某個特定錯誤修復或當前生產版本中不可用的功能,請搜尋存檔和/或向一般討論郵件列表釋出查詢,以檢視是否有可用的解決方案。您可以透過傳送電子郵件至 hobbit-subscribe@hswn.dk 訂閱該列表。該列表的可搜尋存檔可在 http://www.hswn.dk/hobbiton/ 找到。

請訂閱 hobbit 公告列表,以便在釋出新版本時收到通知。您可以透過傳送電子郵件至 hobbit-announce-subscribe@hswn.dk 訂閱該列表。

該問題的另一個答案可在 http://www.hswn.dk/hobbiton/2008/02/msg00227.html 找到。

在哪裡可以找到更多測試?

[編輯 | 編輯原始碼]

答:Deadcat http://www.deadcat.net Deadcat 主要是 Big Brother 指令碼,但它們中的大多數在 Hobbit 上無需過多調整即可執行。

The Shire Project (Xymonton) https://wiki.xymonton.org/doku.php Shire Project 專用於 Xymon(比 Deadcat 更好)

如何在 bb-hosts 檔案中新增重複主機?

[編輯 | 編輯原始碼]

答:主機的第一次出現與往常一樣。所有後續出現的應該

  
0.0.0.0 hostname # noconn 

如果第一個 ping 沒有響應,連線測試如何工作?

[編輯 | 編輯原始碼]

答:bbtest-net 呼叫 hobbitping 或 fping(在 hobbitserver.cfg 中可配置為 FPING=)

同時傳送多少個 ping?

[編輯 | 編輯原始碼]

答:正在使用的並行連線數量完全取決於您的作業系統 -

   the default is FD_SETSIZE/4, which amounts to 256 on many Unix systems
   You can choose the number of concurrent connections with the "--concurrency=N" option to bbtest-net.

每次傳送多少個數據包?

[編輯 | 編輯原始碼]

答:hobbitping 通常在收到單個響應後停止 ping 主機,並使用它來確定往返時間。

ping 超時時間是多少?

[編輯 | 編輯原始碼]

答:預設超時時間為 5 秒。

可以配置它嗎?

[編輯 | 編輯原始碼]

答:是的。hobbitping 的—timeout=N 引數允許您將超時時間設定為 N 秒。

連線測試(ping)的顏色代表什麼?

[編輯 | 編輯原始碼]

答:綠色表示正常響應,黃色表示有資料包丟失(不是延遲,只是丟失的資料包),紅色表示沒有響應。

如何讓 hobbit 客戶端從伺服器下載 etc/hobbitclient.cfg(或 etc 或 ext 中的其他檔案),然後重新啟動?

[編輯 | 編輯原始碼]

答:為什麼?如果客戶端設定為使用伺服器端配置,它們甚至不需要本地 /etc/*.cfg 檔案...

在 Hobbit 中是否有方法使用來自多個 RRD 檔案的資料建立圖表?

[編輯 | 編輯原始碼]

答:如果您想使用多個 rrd 建立圖表,我建議您使用名為 drraw 的第三方工具 http://web.taranis.org/drraw/

如何停用 REPEAT 提醒?

[編輯 | 編輯原始碼]

答:不設定 REPEAT= 會預設每 30 分鐘重複提醒一次。設定 REPEAT=0 會預設每分鐘重複一次。

  To disable repeat alerts, set REPEAT=365d 
  If your problem lasts that long, you have bigger problems than too many alerts.

從我的客戶端傳送的資料被截斷了。

[編輯 | 編輯原始碼]

A. 最大訊息大小可以在 hobbitserver.cfg 中設定。

  MAXMSG_CLIENT= 
  MAXMSG_DATA= 
  MAXMSG_STATUS= 
  Change the above parameters to suit your needs.

編輯配置檔案後,是否需要重新啟動 Hobbit 伺服器 ?

[編輯 | 編輯原始碼]

A. 不需要。所有檔案每 5 分鐘重新讀取一次。

  The only exception to this is hobbitserver.cfg Changes to this file require a restart.

在進行更改後,是否需要重新啟動我的 Hobbit 客戶端 ?

[編輯 | 編輯原始碼]

A. 不需要。所有客戶端配置檔案會定期重新讀取。

如何監控網頁 ?

[編輯 | 編輯原始碼]

A. 在 bb-hosts 檔案中新增以下行

  ip.ad.dr.ress www.example.com # http://www.example.com/ 

或者對於 https

  ip.ad.dr.ress www.example.com # https://user:passwd@www.example.com/ 

請注意,還有內容檢查以及釋出和瀏覽器選項可用。有關詳細資訊,請參閱 bb-hosts(5) 手冊的“HTTP 測試”部分。

我的測試每小時僅執行一次。如何讓它在 30 分鐘後不變成紫色 ?

[編輯 | 編輯原始碼]

A. 有時您可能希望每小時(遠端網際網路站點)僅監控/測試一次,每天(備份作業或 DNS 更新)一次,甚至更少。或者也許更頻繁(每分鐘或更短時間測試一次關鍵連線)。

在客戶端上使用 bb 報告狀態時,有一個 LIFETIME 選項。它定義了狀態訊息被認為有效的持續時間(即新鮮且尚未陳舊)。在 bb 手冊頁 上搜索“LIFETIME”以獲取更多資訊。語法如下。

$BB $BBDISP "status+4h $MACHINE.$COLUMN $COLOR `date`

預設情況下,測試間隔為 5 分鐘,狀態生命週期為 30 分鐘,因此預設情況下接受 5 次遺漏。應根據可接受的遺漏次數調整生命週期,否則可能會出現誤報。例如,如果主機完全離線 2 小時,或者兩次巧合地重疊每個小時的報告週期,那麼每小時測試可能不需要立即除錯。或者,對於每分鐘測試一次的內容,30 分鐘的生命週期可能需要向下調整。

幾個示例場景

  • 如果指令碼僅在備份完成時報告備份狀態,並且主機或顯示在那個確切時間不可用,那麼該主機在該 NOC 中的備份狀態可能需要或可能不需要變成紫色。
  • 如果指令碼檢查父目錄中每個子目錄的大小,並且狀態更多地用於繪圖而不是綠色/黃色/紅色報告,那麼許多遺漏可能是可以接受的。

警告:手冊頁建議“略大於測試之間的間隔”。但如果實際上遵循了這一點,那麼預設超時將為 6 分鐘。它不是 6,並且它不是為從 30 輕鬆更改而設計的:它不是配置檔案中的選項,而是在 hobbitd/hobbitd.c 檔案中的 handle_status 函式中硬編碼的

int validity = 30;

Hobbit 是否對它的傳輸進行加密 ?

[編輯 | 編輯原始碼]

A. 原生不支援。一些人報告使用外部加密成功。

  Later versions might support data encryption.

如何監控檔案?我已經將 FILE /path/to/my/file 新增到 hobbitclient.cfg 中,但仍然沒有反應。

[編輯 | 編輯原始碼]

A.

您還需要將要監控的檔案新增到 client-local.cfg 中(這會告訴客戶端將檔案元資料傳送到伺服器)然後伺服器使用元資料和 hobbitclient.cfg 中的配置來確定測試結果。還要確保 hobbit 具有對檔案的讀取許可權。

如何監控除預設日誌檔案之外的日誌檔案?

[編輯 | 編輯原始碼]

答案 1

"Kauffman, Tom" <KauffmanT@nibco.com> 
 
> On your hobbit server -
> 
> 1) set up etc/client-local.cfg to reference the logs you want AND any exclusions. For AIX, I have:
> [aix]
> log:/var/log/syslog:10240
>         ignore 3004-004
>         ignore 3004-035
>         ignore 3004
> log:/var/log/console.log:10240
> log:/var/log/dsmsched.log:10240
> 
> 2) set up etc/hobbit-clients.cfg to create your alerting criteria. For AIX, I've got these set:
> HOST=%.*
>         LOG /var/log/syslog %.*crit.su.*to.root red
>         LOG /var/log/syslog %.*crit.su   yellow
>         LOG %/var/(adm|log)/console.log %.*not.responding.still.trying yellow
> 
> 
> Change client-local.cfg first. Allow 15 to 20 minutes for this to propagate to the client;
> look for a file called logfetch.<hostname>.cfg in client/tmp. This should match your entries in
> client-local.cfg.
> 
> Once the logs started to coming in, play with the client-local.cfg and a test system, to track
> what you're interested in.
> 
> Tom

答案 2. 我已經將 LOG /path/to/my/logfile WARNING COLOR=yellow 新增到 hobbitclient.cfg 中,但仍然沒有反應。

您還需要將要監控的日誌檔案新增到 client-local.cfg 中。這會告訴客戶端將日誌檔案傳送到伺服器,因為 Hobbit 訊息協議是雙向的,而不僅僅是 hobbit 客戶端向伺服器傳送訊息。hobbit 伺服器實際上可以指示 hobbit 客戶端傳送非預設日誌檔案。

  The server then uses the sent data and the config in hobbitclient.cfg to determine test results. 
  Also make sure hobbit has read access to the log.

一個 client-local.cfg 檔案示例。

# following are by OS type to ask hobbit clients send in messages file.
[sunos]
log:/var/adm/messages:10240

[osf1]
log:/var/adm/messages:10240

[aix]
log:/var/adm/syslog/syslog.log:10240

[hp-ux]
log:/var/adm/syslog/syslog.log:10240

[win32]

[freebsd]
log:/var/log/messages:10240

[netbsd]
log:/var/log/messages:10240

[openbsd]
log:/var/log/messages:10240

[linux]
log:/var/log/messages:10240
dir:/tmp
ignore MARK

[linux22]
log:/var/log/messages:10240
ignore MARK

[redhat]
log:/var/log/messages:10240
ignore MARK

[debian]
log:/var/log/messages:10240
ignore MARK

[suse]
log:/var/log/messages:10240
ignore MARK

[mandrake]
log:/var/log/messages:10240
ignore MARK

[redhatAS]
log:/var/log/messages:10240
ignore MARK

[redhatES]
log:/var/log/messages:10240
ignore MARK

[rhel3]
log:/var/log/messages:10240
ignore MARK

[irix]
log:/var/adm/SYSLOG:10240

[darwin]
log:/var/log/system.log:10240

[sco_sv]
log:/var/adm/syslog:10240

# following are by machine names to ask hobbit clients send in messages file.
[caoffice2435.mainoffice.test.com]
log:/var/adm/messages:10240

[caoffice2436.mainoffice.test.com]
log:/var/adm/messages:10240

[caoffice2437.mainoffice.test.com]
log:/var/adm/messages:10240

[caoffice2444.mainoffice.test.com]
log:/var/adm/messages:10240

[caoffice2445.mainoffice.test.com]
log:/var/adm/messages:10240

[caoffice2141.comm.test.com]
# Solaris 10 OS log
#   "log:FILENAME:MAXDATA"
log:/var/adm/messages:10240
ignore MARK
# hobbit server logs
log:/var/opt/hobbitserver42/log/acknowledge.log:10240
log:/var/opt/hobbitserver42/log/bb-display.log:10240
log:/var/opt/hobbitserver42/log/bb-network.log:10240
log:/var/opt/hobbitserver42/log/bb-retest.log:10240
log:/var/opt/hobbitserver42/log/bbcombotest.log:10240
log:/var/opt/hobbitserver42/log/cgierror.log:10240
log:/var/opt/hobbitserver42/log/clientdata.log:10240
log:/var/opt/hobbitserver42/log/history.log:10240
log:/var/opt/hobbitserver42/log/hobbitd.log:10240
log:/var/opt/hobbitserver42/log/hobbitlaunch.log:10240
log:/var/opt/hobbitserver42/log/hostdata.log:10240
log:/var/opt/hobbitserver42/log/il02bbhostsallinone.ksh.log:10240
log:/var/opt/hobbitserver42/log/notifications.log:10240
log:/var/opt/hobbitserver42/log/page.log:10240
log:/var/opt/hobbitserver42/log/rrd-data.log:10240
log:/var/opt/hobbitserver42/log/rrd-status.log:10240
log:/var/opt/hobbitserver42/log/runwebalizer.log:10240

# httpd server logs
log:/var/opt/httpd222/log/access_log:102400
log:/var/opt/httpd222/log/error_log:102400

# httpd server logs
log:/var/log/maillog:102400

hobbit 警報電子郵件主題中的跟蹤警報郵件號的含義是什麼 ?

[編輯 | 編輯原始碼]

A. 該數字是用於確認警報的確認程式碼。

  They are random numbers generated for each alert.

如何將對 Hobbit 頁面的訪問許可權限制為特定人員或組 ?

[編輯 | 編輯原始碼]

A. Apache 有自己的身份驗證。使用它。

  To give one group access to some info, and another group access to other info, use the PAGE
  statement in bb-hosts. This will create a new directory for each page, which can be controlled
  by Apache's authentication system.

我在使用 devmon 時遇到了問題……

[編輯 | 編輯原始碼]

A. 請將與 devmon 相關的問題釋出到 devmon 支援郵件列表。

如何建立自定義指令碼和圖表 ?

[編輯 | 編輯原始碼]

A. http://xymonton.org/tutorials:customgraph

[編輯 | 編輯原始碼]

A. 對於表格來說,這是很常見的。必須將列名附加到 --multigraphs 設定中。

  1. 檢視原始檔 web/hobbitsvc.c
    • 找到 multigraphs 賦值並記下它的值。
  2. 編輯配置檔案 server/etc/hobbitcgi.cfg
    1. 找到 CGI_SVC_OPTS 賦值。
    2. --multigraphs= 值新增到分配的字串中,包括傾向於包含表格資料的列。例如
      CGI_SVC_OPTS="--env=/home/hobbit/server/etc/hobbitserver.cfg --no-svcid --history=top --multigraphs=disk,if_load,if_dsc"
      (請注意,儘管 hobbitsvc.c 中的設定以逗號開頭和結尾,但 hobbitcgi.cfg 中的設定沒有。)
  3. 然後嘗試更改(重新整理網頁)。

有關 --multigraphs 的更多詳細資訊,請參閱 hobbitsvc.cgi 文件。(man hobbitsvc.cgi

我不想在我的顯示中顯示 foo 列。我該怎麼做 ?

[編輯 | 編輯原始碼]

A. 新增條目 NOCOLUMNS:foo,bar 來隱藏列 foo 和 bar。

如何檢查以確保某些東西沒有執行?

[編輯 | 編輯原始碼]

A. 在 bb-hosts 中

1.2.3.4 my.host.com # !ftp 

這將導致測試在 FTP 執行時變紅

我想監控 Windows 伺服器。我該怎麼做?

[編輯 | 編輯原始碼]

如果必須,請使用 BBWin 作為您的客戶端。 http://bbwin.sourceforge.net/

BBWin 的 XML 和中央模式之間的轉換是什麼?

[編輯 | 編輯原始碼]

(注意: 未測試,但希望準確)

BBWin 近似值 hobbit-clients.cfg
<uptime>
  <setting name="delay" value="(bootlimit)" alarmcolor="yellow" />
  <setting name="maxdelay" value="(toolonglimit)" alarmcolor="yellow" />
</uptime>
UP bootlimit toolonglimit
<cpu>
  <setting name="default" warnlevel="(warnlevel)" paniclevel="(paniclevel)" />
</cpu>
LOAD warnlevel paniclevel
N/A CLOCK maximum-offset
<disk>
  <setting name="(drive)" warnlevel="(warn)" paniclevel="(panic)" />
  <setting name="(drive)" ignore="true" />
</disk>
DISK drive warn panic

DISK drive IGNORE

<memory>
  <setting name="physical" warnlevel="(warn)" paniclevel="(panic)" />
  <setting name="virtual" warnlevel="(warn)" paniclevel="(panic)" />
  <setting name="page" warnlevel="(warn)" paniclevel="(panic)" />
</memory>
MEMPHYS warn panic

MEMACT warn panic
MEMSWAP warn panic

<procs>
  <setting name="(processname)" rule="-=3" alarmcolor="(color)" comment="(text)" 
  <setting name="(processname)" rule="+=4" alarmcolor="(color)" comment="(text)" 
</procs>
PROC processname 0 3 color TEXT=text

PROC processname 4 -1 color TEXT=text

N/A FILE filename color
(參見 fsmon.cfg) DIR directory color SIZE<maxsize SIZE>minsize
<stats>
</stats>
PORT
<svcs>
  <setting name="(svcname)" value="(status") autoreset="(startup)" alarmcolor="(color)">
</svcs>
SVC svcname startup status color
<who>
</who>
N/A

(注意: 不完全準確,但好的起點)

BBWin client-local.cfg
<msgs>
  <match logfile="System">
  <ignore logfile="System" value="(text string)">
</msgs>
eventlog:System

ignore text string

我在 Windows 上遇到 bbwin 的問題......

[編輯 | 編輯原始碼]

A. 請將 bbwin 問題釋出到 bbwin 論壇

BBWIN 客戶端執行良好。我已經重新使用了一個在 Big Brother 之前執行的指令碼。結果保留在 C:\BBWin\logs 中。

所有其他內容都報告給伺服器,但不是外部。

<?xml version="1.0" encoding="utf-8"?> <configuration>

 <bbwin>
   <setting name="bbdisplay" value="192.168.1.132" />
   <setting name="mode" value="local" />
   <setting name="configclass" value="win32" />
   <setting name="autoreload" value="true" />
   <setting name="timer" value="5m" />
   <load name="cpu" value="cpu.dll" />
   <load name="disk" value="disk.dll" />
   <load name="externals" value="externals.dll" />
   <load name="filesystem" value="filesystem.dll" />
   <load name="memory" value="memory.dll" />
   <load name="msgs" value="msgs.dll" />
   <load name="procs" value="procs.dll" />
   <load name="stats" value="stats.dll" />
   <load name="svcs" value="svcs.dll" />
   <load name="uptime" value="uptime.dll" />
   <load name="who" value="who.dll" />
   <setting name="loglevel" value="3" />
   <setting name="logpath" value="C:\BBWin\logs\BBWin.log" />
   <setting name="logreportfailure" value="false" />
   <setting name="hostname" value="vs3k-gap" />
 </bbwin>
 <cpu>
   <setting name="alwaysgreen" value="false" />
   <setting name="default" warnlevel="90" paniclevel="95" delay="3" />
 </cpu>
 <disk>
   <setting name="alwaysgreen" value="false" />
   <setting name="default" warnlevel="85%" paniclevel="95%" />
   <setting name="remote" value="false" />
   <setting name="cdrom" value="false" />
 </disk>
 <externals>
   <setting name="timer" value="1m" />
   <setting name="logstimer" value="60s" />
   <load value="C:\BBWin\ext\sqlv.cmd" timer="1m" />
 </externals>
 <memory>
   <setting name="alwaysgreen" value="false" />
   <setting name="physical" warnlevel="78" paniclevel="98" />
   <setting name="page" warnlevel="70" paniclevel="90" />
   <setting name="virtual" warnlevel="78" paniclevel="90" />
 </memory>
 <msgs>
   <setting name="alwaysgreen" value="false" />
   <setting name="delay" value="1h" />
   <match logfile="System" type="error" alarmcolor="red" />
   <match logfile="System" type="warning" alarmcolor="yellow" />
   <match logfile="Application" type="error" alarmcolor="red" />
   <match logfile="Application" type="warning" alarmcolor="yellow" />
   <match logfile="Security" type="fail" />
 </msgs>
 <procs>
 </procs>
 <svcs>
   <setting name="alwaysgreen" value="false" />
   <setting name="autoreset" value="false" />
   <setting name="alarmcolor" value="yellow" />
   <setting name="Windows Time" value="started" autoreset="true" alarmcolor="red" />
 </svcs>
 <uptime>
   <setting name="delay" value="30m" />
   <setting name="maxdelay" value="365d" />
 </uptime>

</configuration>

檔案指令碼生成輸出

OK

echo green ***Error en Chequeo SQLV, Servidor:%computername% >> C:\BBWin\logs\sqlv echo ^&green ***Error en Chequeo SQLV, Servidor:%computername% >> C:\BBWin\logs\sqlv

BAD

echo red ***OK en Chequeo SQLV, Servidor:%computername% >> C:\BBWin\logs\sqlv echo ^&red ***OK en Chequeo SQLV, Servidor:%computername% >> C:\BBWin\logs\sqlv

我設定了我的客戶端,但狀態頁面上沒有顯示任何內容?

[編輯 | 編輯原始碼]

A. 檢查幽靈客戶端報告或 hobbitd 狀態頁面。它可能配置錯誤。

我們正在更改主機名稱,並希望繼續監控它,並保留歷史記錄。有辦法嗎?

[編輯 | 編輯原始碼]

A. 檢查幫助選單 ~/server/bin/bb 127.0.0.1 "rename OLDHOSTNAME NEWHOSTNAME" 中的 Hobbit 提示和技巧頁面

我不想使用 rrdtool 來建立資料平均值和迴圈資料,我想永遠保留所有資料。我能做到嗎?

[編輯 | 編輯原始碼]

A. 當前快照中有一種方法可以做到這一點,包括一個新的 hobbitd_rrd 手冊頁,其中描述瞭如何執行它。

  and what the input to your custom script looks like. 
  The option is—processor=COMMAND 
  It will feed the raw data via stdio into COMMAND 
  COMMAND can then process the data into another storage system.

我的 AIX 系統上沒有編譯器。在哪裡可以獲取預編譯的 Hobbit 客戶端?

[編輯 | 編輯原始碼]

A. http://www.docum.org/twiki/bin/view/Hobbit/HobbitClients

如何取消訂閱 Hobbit 郵件列表?

[編輯 | 編輯原始碼]

A. 如果您必須離開,請傳送電子郵件至 hobbit-unsubscribe@hswn.dk

如何將 hobbit 搜尋引擎外掛新增到 Internet Explorer 7 中?

[編輯 | 編輯原始碼]

'A. 等待貢獻。

如何將 hobbit 搜尋引擎外掛新增到 FireFox 2 中?

[編輯 | 編輯原始碼]

A. 複製以下檔案並將其儲存為“c:\Program Files\Mozilla Firefox\searchplugins\hobbit.xml”(這是 OpenSearch 描述格式,與 FireFox 2 和 Internet Explorer 7 都相容)。相應地調整您網站的 url 地址。

hobbit.xml

然後重新啟動 Firefox。您應該會看到一個 hobbit 藍色微笑圖示顯示在搜尋欄中。參考

是否可以透過電子郵件停用和確認警報,如何?

[編輯 | 編輯原始碼]

包括一個IGNORE exception with hosts or alert that you wish to ignore

  HOST=* SERVICE=*
     IGNORE HOST=%[a-z]{3}[0-9]{4} 
     MAIL admin@foo.com

或者更具體一些

  HOST=* COLOR=red
     IGNORE HOST=marketing.foo.com SERVICE=cpu TIME=4:1500:1800
     MAIL admin@foo.com

並檢查配置

  $ cd ~/server
  $ ./bin/bbcmd hobbitd_alert—test tic0102 comm
  00026606 2012-03-01 10:52:51 *** Match with 'IGNORE HOST=%[a-z]{3}[0-9]{4}' ***
  00026606 2012-03-01 10:52:51 IGNORE rule found

我是否可以為確認警報設定最大時間限制?

[編輯 | 編輯原始碼]

A.

我是否可以限制在啟用/停用頁面上可以停用的主機?

[編輯 | 編輯原始碼]

A.

我是否可以僅在一臺顯示伺服器上啟用/停用,並在兩臺伺服器上顯示它?

[編輯 | 編輯原始碼]

典型的雙顯示伺服器安裝會將它們配置為獨立執行。每個 Xymon 顯示伺服器在XYMSERVERS設定中僅列出自身xymonserver.cfg,因此通常情況下,啟用/停用頁面只適用於提供表單的伺服器。

然而,XYMSERVERS值可以為每個 CGI 指令碼覆蓋,啟用/停用表單會向XYMSERVERS中定義的所有 Xymon 伺服器傳送更新。要覆蓋啟用/停用,請執行以下操作。

建立檔案xymonserver-enadis.cfg包含

 include /etc/xymon/xymonserver.cfg
 XYMSERVERS="display1 display2"  # replace with IP addresses of Xymon servers

然後編輯cgioptions.cfg並新增以下行

 XYMONENV_ENADIS=/usr/lib/xymon/server/etc/xymonserver-enadis.cfg

並修改CGI_ENADIS_OPTS以引用新變數

 CGI_ENADIS_OPTS="--env=$XYMONENV_ENADIS"

簡訊警報格式是否可以重新配置以顯示更多或更少的資訊?

[編輯 | 編輯原始碼]

A. 不能直接配置,但已編寫了一個警報指令碼(smsplus)以提供比預設簡訊輸出更多的資訊。可以使用以下環境變數(來自 hobbit 文件)輕鬆修改指令碼。

名稱 描述
BBCOLORLEVEL 狀態的當前顏色
BBALPHAMSG 觸發警報的狀態日誌的完整文字
ACKCODE 可用於確認警報的“cookie”
RCPT 收件人,來自 SCRIPT 條目
BBHOSTNAME 警報所涉及的主機名稱
MACHIP 出現問題的機器的 IP 地址
BBSVCNAME 警報所涉及的服務名稱
BBSVCNUM 服務的數字程式碼。來自 SVCCODES 定義。
BBHOSTSVC 警報所涉及的 HOSTNAME.SERVICE。
BBHOSTSVCCOMMAS 與 BBHOSTSVC 相同,但主機名中的點被替換為逗號
BBNUMERIC 由 BBSVCNUM、MACHIP 和 ACKCODE 構成的 22 位數字。
RECOVERED 如果服務已恢復,則為“1”。
DOWNSECS 服務已停止執行的秒數。
DOWNSECSMSG 恢復時,儲存文字“事件持續時間:N”,其中 N 是 DOWNSECS 值。

Q. 如何使用 Hobbit Server 啟用 SNMP 監控?

[編輯 | 編輯原始碼]

A 1. http://cerebro.victoriacollege.edu/hobbit-trap.html

A 2. http://devmon.sourceforge.net

Q. 如何配置多個黃色到紅色的警報?

[編輯 | 編輯原始碼]
On Wed, Apr 18, 2007 at 04:11:13PM -0400, Galen Johnson wrote:

> I'll admit I haven't put a lot of legwork into this but...is it 
> possible to configure hobbit to go red on a test after a certain 
> number of cycles at yellow?  I have some tests that I don't mind 
> if they are yellow for small period but if they are there too long 
> I need to know.

A. 在 bb-hosts 中使用“badTEST”設定(請參閱手冊頁)。這會延遲黃色或紅色狀態出現,直到它保持黃色(或紅色)幾個測試周期。因此,您可以使用它來抑制黃色狀態,直到它保持黃色一段時間,這樣當它確實變為黃色時,您就知道需要處理它。

或者,如果您的自定義測試報告了“紅色”狀態,您可以讓它在前 5 個測試周期內保持黃色,之後變為紅色。

Henrik

注意:目前,它只適用於 ping 測試。

Q. 如何將 hobbit 客戶端與 BB 伺服器一起使用?

[編輯 | 編輯原始碼]

A.

On Wed, Sep 06, 2006 at 01:48:02PM -0500, Rich Smrcina wrote:
> Is the new Hobbit client compatible with the old BigBrother server?
> BigBrother is run by a different part of the organization and I may not 
> be able to get them to change to Hobbit, but for my Linux guests and my 
> z/VM systems, I would be interested in converting to the new Hobbit code.

In the default mode, you cannot use the Hobbit client to report to a Big
Brother system. No data would ever show up, because a Big Brother server
doesn't know how to feed the client data through the hobbitd_client
module, which takes care of converting the client data into status
columns.

However, you *can* run the Hobbit client in the local-configuration
mode. When the configure script asks
   Server side client configuration, or client side [server] ?
answer "client", and the launch the client with the "--local" option.

In this mode, the client sends normal "status" messages to the Hobbit/BB
server. I'm not sure if alerts will work, though, since the Hobbit
client doesn't generate the "page" messages that the BB server expects
to trigger sending out alerts. (Hobbit ignores these messages
completely, so it did seem like a waste of time to generate them).

Note that this isn't really described very well anywhere. It means you
will have to maintain the client configuration on the client, not on the
Hobbit server.

Regards,
Henrik

Q. 如何在 Solaris 10 中以非 root 使用者身份啟用 fping?

[編輯 | 編輯原始碼]
The problem
bash-3.00$ more bb-network.log
2006-08-29 17:31:02 Execution of 'hobbitping -Ae' failed - program not suid root?
2006-08-29 17:31:02 2006-08-29 17:31:02 Cannot get RAW socket: Permission denied
bash-3.00$
the fix
There are 3 files that need to be updated so that fping can be executed as root (uid=0)
on Solaris by a named user, in this case the hobbit user.

The three files in question are,
/etc/user_attr
/etc/security/exec_attr
/etc/security/prof_attr

These have been updated with the following lines

In /etc/user_attr:
hobbit::::profiles=Hobbit Commands

In /etc/security/exec_attr:
Hobbit Commands:solaris:cmd:::/usr/local/hobbit/server/bin/hobbitping:uid=0

In /etc/security/prof_attr:
Hobbit Commands:::Hobbit Commands:

Regards,

Mike Rowell, edited by T.J. Yang
References: http://docs.sun.com/app/docs/doc/816-4557/6maosrjfc?a=view

Q. 您是否可以使用 hobbit 伺服器,但保留您的 bb 客戶端?

[編輯 | 編輯原始碼]

A. 可以。Hobbit 100% 相容 BB 客戶端。但要注意,bb 1.9c 之後,許可證變得更加嚴格,您需要為每個座位付費。

Q. Big Sister 是什麼?

[編輯 | 編輯原始碼]

Q. 是否有關於系統監控工具的簡要概述?

[編輯 | 編輯原始碼]

Q. 監控系統應該具備哪些功能?

[編輯 | 編輯原始碼]

Q. 從 BB 遷移到 Hobbit 安全嗎?

[編輯 | 編輯原始碼]
-----Original Message-----
From: Henrik Stoerner [mailto:henrik@hswn.dk] 
Sent: Tuesday, August 01, 2006 5:13 PM
To: hobbit@hswn.dk
Subject: Re: [hobbit] Hobbit newbie from BB: differences and what may I
lose from migrating?

Hi Jordan,

I'll try to answer your questions. Since I also develop Hobbit I am
probably slightly biased when it comes to the "is-this-more-difficult-
to-do-than-with-BB" type of questions, but I am sure others will
voice their opinions on that.

On Tue, Aug 01, 2006 at 12:36:29PM -0700, Jordan Mendler wrote:
> 
> First, after reading through whatever I could find on the website I am
> still a little bit confused about configuration and setup. With BB,
> you install and configure each client and server on the local machine,
> except for the universal bb-hosts. Is this the same on Hobbit, or does
> Hobbit use a central configuration file that is modified only on the
> server to configure clients? I am trying to figure out the difference
> between installing, maintaining and configuring BB and Hobbit setups.

First, let me stress that Hobbit is fully compatible with your existing
BB clients. You can keep your current client setup and just switch to
Hobbit on the server side, and all of your clients will continue to 
work as they do with BB as the server. So you can migrate the server
side first, and then migrate clients when you find that it is convenient
to do so - or you want to take advantage of some of the new stuff that
is in Hobbit.

The Hobbit client configuration is maintained on the Hobbit server. 
Clients in Hobbit are designed to be *really* dumb; they just collect
data, and all of the configuration of what to monitor, what thresholds
to use for e.g. disk utilization and so on is configured only on the
Hobbit server.

This is a major difference between Hobbit and BB. With BB you have
delegated the client administration to whoever manages each server.
Hobbit centralizes the monitoring configuration, so you will probably
have a group of people who take more control of the monitoring setup.

> Hobbit looks a lot more complex to setup, but once I get my feet wet is
> it any harder than BB?

I think it is easier, once you get used to the Hobbit way of doing
things. But as I said, I am biased.

> Second is performance. I know this list may be biased toward Hobbit,
> but is it actually faster? We have about 50-100 clients on BB and I did
> not notice any performance issues.

With that number of systems monitored, you probably will not see a huge
difference. BB works quite well for a small number of systems, but when
you move beyond a couple of hundred boxes the overhead of generating 
webpages through shell scripts becomes very noticeable. On my setup,
the servers were simply choking on the disk I/O caused by BB saving
every status in a separate file, and from the huge number of small
cut-grep-awk-sed etc. commands that ran to generate webpages.

> Hobbit looks like it is very complex, so does this mean it uses a lot 
> of resources on the client and server? What speed/ram server is
> usually the minimum recommended for a dedicated Hobbit server? Would
> something like a dual Pentium II 266mhz have any performance issues 
> as a server, if it does nothing else? What about for clients? We have
> still have some testing, stating and production servers left that are
> singe chip Pentium III 700-850 mhz, and even a couple Pentium II's. 
> Just need to make sure all the resources used for things like graphs
> are taken from the server and not each client.

The Hobbit server uses fewer resources than the BB server. The main
resource usage is memory; Hobbit keeps everything in memory except 
the history logs and the RRD files used for graphs. That doesn't mean
a whole lot, though: Here's a ps listing of the Hobbit processes running

on my main monitoring system - it handles about 2500 hosts:

$ ps vax|cut -c1-100|egrep "PID|hobbit"
  PID TTY      STAT   TIME  MAJFL   TRS   DRS  RSS %MEM COMMAND
  732 ?        Ss     1:24      0   101  1802  696  0.0 hobbitlaunch
  735 ?        S    2434:37     1   162 31357 29784  2.8 hobbitd
 1470 ?        S     14:50      0    99  2332 1088  0.1 hobbitd_channel --channel=stachg
 1471 ?        S     25:18      0   108  2515 1048  0.1 hobbitd_history
 1472 ?        S    964:26      0    99  2332 1264  0.1 hobbitd_channel --channel=page
 1473 ?        S    1227:34     0   154  5661 3912  0.3 hobbitd_alert
 1474 ?        S    4090:05     0    99  2332 1264  0.1 hobbitd_channel --channel=status
 1475 ?        D    2962:15     0   178  7381 4392  0.4 hobbitd_rrd
 1476 ?        S    259:55      0    99  2332 1208  0.1 hobbitd_channel --channel=data
 1477 ?        S    494:13      0   178  5141 2128  0.2 hobbitd_rrd
 1478 ?        S    126:20      0    99  2844 1832  0.1 hobbitd_channel --channel=client
 1480 ?        S    291:20      0   146  4485 2792  0.2 hobbitd_client
 5552 ?        S      0:00      0   669  2002 1352  0.1 sh -c vmstat 300 2 1>/usr/lib/hobbit/client/

As you can see, the biggest chunk of memory goes to the "hobbitd"
process which is the one that keeps all state information. It's
currently using some 31 MB of memory. (This box has 1 GB RAM).

A rough estimate of how much memory Hobbit needs would be the size of
your bbvar/logs/ directory, plus 30 MB.

As for CPU usage, your PII/266 should be adequate for 50-100 servers.
The box I'm running on is an old (7-8 years) Solaris server with a 
900 MHz UltraSparc II processor. That's roughly comparable to a PII
running at 1.2 GHz. And it handles 25 times as many hosts as you are
aiming for.

> Third is plugins. Are BB plugins compatible with Hobbit?

Yes.

> Also how hard are plugins to write for Hobbit?

Plugins that run on the monitored client systems are as easy to write
as for BB, since it is basically the same thing.

Hobbit also allows you to write plugins for the Hobbit server, which
receive events from the Hobbit server daemon. This is used by the 
core Hobbit tools - e.g. the hobbitd_rrd processes you see in the
ps-listing above are a plugin that handle updating of the RRD files
from the status- and data-messages that are sent to Hobbit. There
aren't any third-party plugins that use this yet (at least, I 
don't know of any), but writing them is fairly simple since it 
basically involves reading data from a pipe and processing it in
whatever way you want.

> I don't know if these even exist for bb, but I ultimately would 
> like to integrate plugins that 1) monitor legato tape backup,

Don't know about this.

> 2) run nmap to see what ports are open/can be seen from an external 
> machine,

The Hobbit client in version 4.2 (about to be released soon) reports
details about the network services running on a host. So you can check
for which ports are open/listening for connections, and trigger alerts
if any unwanted ports show up.

> 3) run 'lshw -html' to show a list of all the hardware on the system,

This would typically be a client-side test.

> 4) monitor uptime,

This is standard.

> 5) monitor OS and kernel versions (uname -a and head -n 1 /etc/issue),

This data is collected by the Hobbit client.

> 6) maybe some more router/network monitoring stuff and

Hobbit comes with built-in network service monitoring. There is also
an SNMP add-on which can be used for monitoring devices such as routers.

> Fourth is relay. By this I mean monitoring systems on a private
> subnetwork that are only accessible to the Hobbit server by going
> through an intermediate server. Is this possible with Hobbit and is it
> any more difficult to do than on BB?

Two ways of doing that. First, there is a proxy utility which is used
to forward Hobbit messages from one network to another. This is used if
your client systems on the private subnet are allowed to make outgoing
connections to the proxy, and the proxy can connect to the real Hobbit
server.

Second, Hobbit 4.2 includes a set of tools where it's the server that
contacts clients to pick up the data they have collected (i.e. the
traffic is initiated by the server, where the normal BB setup is for 
the client to initiate the connection). Useful for DMZ style setups
where clients are not allowed to generate outbound connections.

> Fifth is portability. BB is very portable, I can make a 'model' client
> for say Red Hat and tar it and distribute it very easily to every
> server I have using only a few commands. Is Hobbit the same, or are there
> client dependencies or other things that may make this more difficult.

The Hobbit client uses only the system libraries and standard utilities 
found on your client systems. You will need at least one system where
you can compile the client binaries (that's similar to the BB
requirements), since a few of the client-side tools are written in C.

Once you have a client compiled for an OS, it is as portable as any
binary that is dynamically linked on your platform. I.e. you can 
just copy it over as long as the same run-time libraries are available.

So far, we haven't managed to find any unix-like system that couldn't
run the Hobbit client. Including some rather odd ones. The current list
of client-side data collectors are

hobbitclient-aix.sh    hobbitclient-darwin.sh  hobbitclient-freebsd.sh
hobbitclient-hp-ux.sh  hobbitclient-irix.sh    hobbitclient-linux.sh
hobbitclient-netbsd.sh hobbitclient-openbsd.sh hobbitclient-osf1.sh
hobbitclient-sunos.sh

> Sixth is development. How active is the development of Hobbit, how big
> is the community, etc? How many people can attest to having fully
> functional hobbit setups, how long has it been around and how often
> are new releases usually made?

Hobbit started back in late 2002 when it was called the "bbgen toolkit".
It was renamed to Hobbit in March 2005 when it had developed into a 
complete replacement for BB. More details in the hobbit(7) man-page
available online at http://www.hswn.dk/hobbit/help/manpages/

It is actively being developed by me, but people on this list have
made contributions of code. Some have picked up special projects
like the Windows client and run that completely on their own.
I'd say Hobbit currently has a very active user community, and
the development community is slowly growing beyond just myself.

There are currently 433 subscribers to the Hobbit mailing list.
According to the Sourceforge download statistics, it is downloaded
about 1000 times per month.
http://sourceforge.net/project/stats/?group_id=128058&ugn=hobbitmon&type
=&mode=year

There was a thread on the mailing list back in May about who uses
Hobbit. The results were summarized here:
https://wikibook.tw/wiki/System_Monitoring_with_Hobbit/User_Guide#Wh
o_use_Hobbit_.3F

New releases have usually happened frequently - 2-4 times a year.
The current interval between the 4.1.2 release and version 4.2 is 
unusually long - a whole year. I don't expect that to happen again.

> Also I saw something this morning about a Windows client -- how 
> stable is that?

From what I hear it should be usable. But you can stick with the
current BBNT client until it reaches version 1.0.

> How stable is the Solaris version?

Rock-solid.

> Is there a client for Mac OSX?

Yes. It will run the Hobbit server also, if you want to.

> Is Hobbit like BB in the sense that you can change paths to system 
> binaries like grep and sed to allow easy use on other UNIXes like OSX?

Adding a client for a new OS will require implementing both a
client-side script to collect whatever data is interesting for this
system, and implementing the data parsing on the Hobbit server-side.
So it is somewhat more challenging. But since Hobbit already supports
all of the common Unix systems, I doubt that you will need to worry 
about that. If you do have a system which is not on the list, I will
help you with adding support for it.

> When will 4.2 be officially released as a production version?

Probably by the end of this week.

> Since we have a working BB setup for now, I need to
> decide if I should try to start migrating now or if I should wait some
> time for Hobbit to develop more before I migrate from BB.

I don't think you have to wait. But it's for You to decide.

Regards,
Henrik

Q. NOCOLUMNS 是否必須引用客戶端行,還是可以引用 bb-hosts 中的頁面/子頁面?

[編輯 | 編輯原始碼]

A. 等待貢獻。

Solaris 開發人員常見問題解答

[編輯 | 編輯原始碼]

Q. 64 位 hobbit 伺服器與 32 位伺服器相比有什麼優勢?

[編輯 | 編輯原始碼]

Q. 如何啟用 64 位編譯?

[編輯 | 編輯原始碼]
  CC=cc CFLAGS="-mr -Qn -xstrconst -xO2 -xtarget=ultra2 -xarch=v8plusa" 
  CC_LD_RT="-R"

Meaning of each option:
-mr:
-Qn:
-xstrconst: 
-xO2
-xtarget=ultra2
-xarch=v8plusa
  CC=cc CFLAGS="-mr -Qn -xstrconst -xO2 -xtarget=general -xarch=v9" 
  CC_LD_RT="-R" 

問:32 位 hobbit 伺服器的示例

[編輯 | 編輯原始碼]
bash-3.00# file hobbitd
hobbitd:        ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required, 
                UltraSPARC1 Extensions Required, dynamically linked, not stripped
bash-3.00#

來自 Sun 編譯器的警告資訊

[編輯 | 編輯原始碼]

以下是使用 Sun 編譯器產生的警告資訊。

問: "指向無符號字元的指標" = "指向字元的指標"

[編輯 | 編輯原始碼]
  • 錯誤資訊。
bash-3.00# gmake
cc -mr -Qn -xstrconst -xO2 -xtarget=ultra2 -xarch=v8plusa -D_REENTRANT  -DSunOS -o safequery\
 safequery.c
"safequery.c", line 12: warning: assignment type mismatch:
        pointer to unsigned char "=" pointer to char
bash-3.00#

  • 原始碼
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

char *safechars="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_+?~=";

int main(int argc, char *argv[])
{
    unsigned char *querystring;
    unsigned char *p;

    querystring = getenv("QUERY_STRING");
    if (!querystring) {
       return 0;
    };

    for (p=querystring; (*p); p++) {
      if (!strchr(safechars, *p)) {
         return 1;
      }
    }
  • 注意:getenv() 的文件說明其返回char *,而不是unsigned char *.


"loadhosts.c", line 463: warning: statement not reached
         prototype: pointer to char : "/opt/build/hobbit-4.2.0/include/../lib/strfunc.h", line 16
         argument : pointer to unsigned char
"loadhosts.c", line 463: warning: statement not reached
"loadhosts.c", line 521: warning: return value type mismatch
"hobbitd_alert.c", line 543: warning: assignment type mismatch:
        pointer to char "=" pointer to unsigned char
"hobbitd_alert.c", line 665: warning: assignment type mismatch:
        pointer to unsigned char "=" pointer to char
"hobbitd_alert.c", line 692: warning: argument #1 is incompatible with prototype:
         prototype: pointer to unsigned char : "/opt/build/hobbit-4.2.0/include/../lib/encoding.h",
         line 17
         argument : pointer to char
"hobbitd_alert.c", line 701: warning: assignment type mismatch:
         pointer to unsigned char "=" pointer to char
"hobbitd_alert.c", line 719: warning: assignment type mismatch:
         pointer to unsigned char "=" pointer to char
"do_alert.c", line 182: warning: argument #2 is incompatible with prototype:
       prototype: pointer to char : "/opt/build/hobbit-4.2.0/include/../lib/strfunc.h", line 16
       argument : pointer to unsigned char
"do_alert.c", line 190: warning: argument #1 is incompatible with prototype:
       prototype: pointer to char : "/opt/build/hobbit-4.2.0/include/../lib/misc.h", line 25
       argument : pointer to unsigned char
"do_alert.c", line 253: warning: argument #1 is incompatible with prototype:
       prototype: pointer to char : "/opt/build/hobbit-4.2.0/include/../lib/misc.h", line 25
       argument : pointer to unsigned char
"do_alert.c", line 272: warning: argument #1 is incompatible with prototype:
       prototype: pointer to char : "/opt/build/hobbit-4.2.0/include/../lib/misc.h", line 25
       argument : pointer to unsigned char

管理常見問題解答

[編輯 | 編輯原始碼]

如何監控 HP-UX 網路日誌?

[編輯 | 編輯原始碼]
On Mon, Jan 28, 2008 at 12:06:22PM -0500, Robert Herron wrote:
> HP-UX stores its network log in a binary file (/var/adm/nettl.LOG000) that
> you view with the netfmt command.  Before I start working on my own, does
> anyone have an EXT script to monitor it?  If so, could I have a copy?

Alternatively, you could modify the HP-UX client script to generate a
normal Hobbit "msgs" section with the text-output from the netfmt
command; then Hobbit can process it as if it were an ordinary text-based
logfile.

E.g. at the bottom of the hobbitclient-hp-ux.sh script running on your
clients, just before the "exit" command add this:

   echo "[msgs:/var/adm/nettl.LOG000]"
   netfmt ...whatever needs to go here to get the text-output ...

Then you can use a normal log-file entry on the Hobbit server to process
the log data.

Regards,
Henrik

問:如何在 hobbit 伺服器上啟用 RSS?

[編輯 | 編輯原始碼]

A.

  • 在 hobbitserver.cfg 檔案中,將 BBGENOPTS 變數從以下
BBGENOPTS="--recentgifs --subpagecolumns=2"     # Standard options for bbgen.
  • 更改為以下
# enable RSS by " --rss --rsslimit=yellow"
BBGENOPTS="--recentgifs --subpagecolumns=2  --rss --rsslimit=yellow"     # Standard options for bbgen.
  • www 目錄中新建立的 RSS 檔案應該類似於以下
bash-3.00$ ls -lrt /opt/moto/hobbitserver42/www/*.rss
-rw-r--r--   1 hobbits  hobbits      714 Jan 22 07:50 /opt/moto/hobbitserver42/www/bb.rss
-rw-r--r--   1 hobbits  hobbits     6184 Jan 22 07:50 /opt/moto/hobbitserver42/www/bb2.rss
-rw-r--r--   1 hobbits  hobbits      337 Jan 22 07:50 /opt/moto/hobbitserver42/www/bbnk.rss
bash-3.00$

問:如何在 Solaris 10 上為 hobbit 配置 SMF?

[編輯 | 編輯原始碼]

答:來自:Everett, Vernon [1] 對於那些熟悉 Solaris 10 的人來說,你應該瞭解服務,但對於某些人來說,新增新服務有點棘手。為了讓 Hobbit 作為服務執行,我們需要執行以下操作。

建立一個名為 /var/svc/manifest/application/hobbit.xml 的檔案,內容如下

<?xml version="1.0"?>

<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">

<!--
Copyright 2007 Vernon Everett - vernon(a)everett.co.za
Free for use and distibution for non-commercial purposes.
No warranty exists either implicit or implied.
Standard disclaimer applies.
Commercial use is subject to license terms.
-->

<service_bundle type='manifest'name='Hobbit-monitor:hobbit'>

<service name='application/hobbit' type='service' version='1'>
<dependency name='filesystem' grouping='require_all' restart_on='none' type='service'>

<service_fmri value='svc:/system/filesystem/local'/>
</dependency>
<dependency name='multi-user-server' grouping='optional_all' type='service' restart_on='none'>
<service_fmri value='svc:/milestone/multi-user-server' />
</dependency>
        <exec_method type='method' name='start'exec='/usr/lib/hobbit/client/runclient.sh start'
         timeout_seconds='10'>
<method_context>
<method_credential user='hobbit'/>
</method_context>
</exec_method>
        <exec_method type='method' name='stop' exec='/usr/lib/hobbit/client/runclient.sh stop'
         timeout_seconds='10'>
<method_context>
<method_credential user='hobbit' />
</method_context>
</exec_method>
<exec_method type='method' name='restart' exec='/usr/lib/hobbit/client/runclient.sh restart'
 timeout_seconds='10'  >
<method_context>
<method_credential user='hobbit' />
</method_context>
</exec_method>
        <instance name='default' enabled='true' />
        <stability value='Unstable' />
        <template>
<common_name>
<loctext xml:lang='C'> Hobbit Monitor Client </loctext>

</common_name>

</template>

</service>

</service_bundle>

注意第 37、47 和 57 行,這些行以 "exec=" 開頭。你可能需要編輯 Hobbit 啟動指令碼的路徑。

為了避免混淆或可能出現的問題,此時請使用 runclient 指令碼關閉 hobbit 客戶端。

現在,以 root 身份執行以下命令

#svccfg import /var/svc/manifest/application/hobbit.xml

我們現在應該有一個名為 hobbit 的服務。

#svcs | grep hobbit
online 9:23:05 svc:/application/hobbit:default

(它可能此時已上線)

你現在可以像對待普通服務一樣對待它。如果它還沒有上線,請像往常一樣啟動它。

#svcadm enable hobbit

可能需要先停用它,然後再啟用它,但這樣應該可以啟動它。

並且因為我們已將預設設定設為啟用,所以服務應該在你重啟時自動啟動。

透過執行以下操作來確認一切正常

# ps -efa | grep hobbit

所有通常的指令碼都應該在執行。

如果你不再希望它作為服務執行,以 root 身份執行以下命令

#svccfg delete hobbit.

這將刪除服務,並允許你繼續從 runclient 指令碼執行它。

問:如何使用 SMF 為 Solaris 10 配置 Hobbit 客戶端?

[編輯 | 編輯原始碼]

答:複製自 http://xymonton.org/addons:hobbitsmf

 These are service manifest files for Solaris 10. These will allow you to import the hobbit start
 and stop scripts for the server/client into the new Solaris Service Management Facility (Solaris 10
 replacement of /etc/rcN.d).

Installation

   1. mkdir -p /var/svc/manifest/application/monitoring/hobbit
   2. copy the client and server xml files to /var/svc/manifest/application/monitoring/hobbit
   3. import the service(s)

      svccfg import /var/svc/manifest/application/monitoring/hobbit/server.xml
      svccfg import /var/svc/manifest/application/monitoring/hobbit/client.xml

   4. enable the service(s)

      svcadm enable svc:/application/monitoring/hobbit/client:default
      svcadm enable svc:/application/monitoring/hobbit/server:default

Source
Hobbit Client

<?xml version='1.0'?>
<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
<!--
    client.xml : Hobbit Client manifest, Galen Johnson
    2007-04-13
    based on bigbrother.xml : BigBrother manifest, Kyle Reynolds
    2006-07-02
-->
 
<!--
    Solaris 10 SMF manifest file for Hobbit client. Just place in
    /var/svc/manifest/application/monitoring/hobbit
    and run:
    'svccfg import /var/svc/manifest/application/monitoring/hobbit/client.xml'
    'svcadm enable svc:/application/monitoring/hobbit/client:default'
-->
 
<!--
    Be sure to change the path to runclient.sh to match your setup...
    Be sure to change the user and group hobbit runs as for your setup...
    If you need to provide the hobbit service additional group privs, add 
    them to the supp_groups in the method context.
-->
 
<service_bundle type="manifest" name="hobbit:client">
 
<service
    name="application/monitoring/hobbit/client"
    type="service"
    version="1">
 
    <create_default_instance enabled='false' />
 
    <single_instance />
    
    <dependency
        name="filesystem"
        grouping="require_all"
        restart_on="none"
        type="service">
        <service_fmri value="svc:/system/filesystem/local"/>
    </dependency>
 
    <dependency
        name="network"
        grouping="require_all"
        restart_on="none"
        type="service">
        <service_fmri value="svc:/network/initial"/>
    </dependency>
 
    <dependency
        name="multi-user-server"
        grouping="require_any"
        restart_on="error"
        type="service">
       <service_fmri value="svc:/milestone/multi-user-server:default"/>
    </dependency>
 
    <exec_method
        type="method"
        name="start"
        exec="/usr/local/hobbit/client/runclient.sh start"
        timeout_seconds="30">
        <method_context>
            <method_credential user="hobbit" group="bb"
                   supp_groups="" />
        </method_context>
    </exec_method>
 
    <exec_method
        type="method"
        name="stop"
        exec="/usr/local/hobbit/client/runclient.sh stop"
        timeout_seconds="30">
        <method_context>
            <method_credential user="hobbit" group="bb"
                  supp_groups="" />
        </method_context>
    </exec_method>
 
     <property_group name='startd' type='framework'>
        <!-- sub-process core dumps shouldn't restart session -->
        <propval name='ignore_error' type='astring' value='core,signal' />
    </property_group>
 
   <stability value="Unstable"/>
 
    <template>
        <common_name>
            <loctext xml:lang="C">
                Hobbit Client
            </loctext>
        </common_name>
        <documentation>
             <doc_link name='hobbit_monitor_site'
                uri='http://hobbitmon.sourceforge.net/' />
        </documentation>
    </template>
 
</service>
 
</service_bundle>

問:如何使用 SMF 為 Solaris 10 配置 Hobbit 伺服器?

[編輯 | 編輯原始碼]

答:複製自 http://xymonton.org/addons:hobbitsmf

<?xml version='1.0'?>
<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
<!--
    client.xml : Hobbit Server manifest, Galen Johnson
    2007-04-13
    based on bigbrother.xml : BigBrother manifest, Kyle Reynolds
    2006-07-02
-->
 
<!--
    Solaris 10 SMF manifest file for Hobbit server. Just place in
    /var/svc/manifest/application/monitoring/hobbit
    and run:
    'svccfg import /var/svc/manifest/application/monitoring/hobbit/server.xml'
    'svcadm enable svc:/application/monitoring/hobbit/server:default'
-->
 
<!--
    Be sure to change the path to hobbit.sh to match your setup...
    Be sure to change the user and group hobbit runs as for your setup...
-->
 
<service_bundle type="manifest" name="hobbit:server">
 
<service
    name="application/monitoring/hobbit/server"
    type="service"
    version="1">
 
    <create_default_instance enabled='false' />
 
    <single_instance />
 
    <dependency
        name="filesystem"
        grouping="require_all"
        restart_on="none"
        type="service">
        <service_fmri value="svc:/system/filesystem/local"/>
    </dependency>
 
    <dependency
        name="network"
        grouping="require_all"
        restart_on="none"
        type="service">
        <service_fmri value="svc:/network/initial"/>
    </dependency>
 
    <dependency
        name="multi-user-server"
        grouping="require_any"
        restart_on="error"
        type="service">
       <service_fmri value="svc:/milestone/multi-user-server:default"/>
    </dependency>
 
    <exec_method
        type="method"
        name="start"
        exec="/usr/local/hobbit/server/hobbit.sh start"
        timeout_seconds="30">
        <method_context>
            <method_credential user="hobbit" group="bb"/>
        </method_context>
    </exec_method>
 
    <exec_method
        type="method"
        name="stop"
        exec="/usr/local/hobbit/server/hobbit.sh stop"
        timeout_seconds="30">
        <method_context>
            <method_credential user="hobbit" group="bb"/>
        </method_context>
    </exec_method>
 
    <property_group name='startd' type='framework'>
        <!-- sub-process core dumps shouldn't restart session -->
        <propval name='ignore_error' type='astring' value='core,signal' />
    </property_group>
 
   <stability value="Unstable"/>
 
    <template>
        <common_name>
            <loctext xml:lang="C">
                Hobbit Server
            </loctext>
        </common_name>
        <documentation>
             <doc_link name='hobbit_monitor_site'
                uri='http://hobbitmon.sourceforge.net/' />
            <manpage title="hobbit" section="1" manpath="/usr/local/man"/>
        </documentation>
    </template>
 
</service>
 
</service_bundle>

問:如何在 hobbit 伺服器上啟用 devmon?

[編輯 | 編輯原始碼]

答:http://www.techagent.com/devmon_snmp_hobbit_setup.htm 提供了一些在 hobbit 上啟用 devmon 的步驟。

問:如何刪除測試?

[編輯 | 編輯原始碼]

A.

On Tue, Sep 05, 2006 at 08:07:34AM +0200, Ulric Eriksson wrote:
> I have figured out how to remove a single test from one host, or 
> all tests from a single host.

The command,   bb 127.0.0.1 "hobbitdboard"
is your friend, combined with a bit of scripting. E.g:

> Is it possible to remove a single test from *all* hosts?

bb 127.0.0.1 "hobbitdboard test=MYTEST fields=hostname" |
   while read H; do bb 127.0.0.1 "drop $H MYTEST"; done

> Or all tests from all hosts?

bb 127.0.0.1 "hobbitdboard test=info fields=hostname" |
   while read H; do bb 127.0.0.1 "drop $H"; done

> Or all tests that are purple?

bb 127.0.0.1 "hobbitdboard color=purple fields=hostname,testname" |
while read L; do 
      HOST=`echo $L | cut -d'|' -f1`
      TEST=`echo $L | cut -d'|' -f2`
      bb 127.0.0.1 "drop $HOST $TEST"
done

問:如何請求 hobbit 伺服器要求 hobbit 客戶端根據警報在本地執行命令?

[編輯 | 編輯原始碼]

A.

Run this as a client extension:

  #!/bin/sh

  # Get the current status of the "msgs" column
  MSGSSTATUS=`$BB $BBDISP "query $MACHINE.msgs" | awk '{ print $1 }`

  # Get the command we must run from the client config
  CMD=`grep "^msgsrecovercmd:" $BBTMP/logfetch.$MACHINEDOTS.cfg | sed -e 's!^msgsrecovercmd:!!'`

  # If "msgs" is red and there is a command, run it
  if test "$MSGSSTATUS" = "red" -a "$CMD" != ""
  then
     $CMD
  fi

  exit 0

Before doing this, consider the security implications of having your
servers run commands that they fetch from a remote host without
authentication.

Regards,
Henrik

問:如何配置 "GROUP" 警報?

[編輯 | 編輯原始碼]

答:"GROUP" 關鍵字用於 hobbit 中將許多程序名稱或磁碟分割槽名稱分類到不同的組中。此功能在大型 IT 環境中是必需的,通常不同的團隊負責 IT 基礎設施的不同區域。例如,一個 IT 組織通常包括網路、資料/儲存、備份、資料庫、應用程式和 Unix 團隊。

  • hobbit-client.cfg:我們需要指定哪個程序將向哪個 GROUP 傳送警報。
  • hobbit-alerts.cfg:在此檔案中,我們隨後指定哪個電子郵件地址接收 GROUP 警報。

這是用於學習目的的簡單設定。假設當 / 使用率超過 93% 時,我們希望 Unix 團隊收到通知。當 /boot 使用率超過 15% 時,應用程式團隊需要收到通知。此外,當 cron 程序停止時,Unix 團隊應該收到通知。當 Xvnc 超過 120 個程序時,應用程式團隊也需要收到通知。

hobbit-client.cfg

[編輯 | 編輯原始碼]
HOST=t-rh9.mywork.com
        DISK / 93 98            GROUP=UNIX_TEAM_PARTITION
        DISK /boot 15 20        GROUP=APPS_TEAM_PARTITION
        PROC cron 1 -1 yellow   GROUP=UNIX_TEAM_PROCESS
        PROC Xvnc 1 120 yellow  GROUP=APPS_TEAM_PROCESS
        PROC defunct  0 0  red
        LOG /var/log/messages  WARNING COLOR=yellow
        LOG /var/log/maillog   WARNING COLOR=yellow
        LOG /var/opt/hobbitclient42/log/clientlaunch.log WARNING COLOR=yellow
        LOG /var/opt/hobbitclient42/log/hobbitclient.log  WARNING
        FILE /etc/passwd  SIZE>0  OWNERID=root  COLOR=yellow

hobbit-alerts.cfg

[編輯 | 編輯原始碼]

GROUP 後面的名稱必須與 hobbit-client.cfg 中使用的名稱完全相同。

GROUP=UNIX_TEAM_PROCESS
     MAIL site02unix-admin-email@site02ad2141.mywork.com FORMAT=TEXT

GROUP=UNIX_TEAM_PARTITION
     MAIL site02unix-admin-email@site02ad2141.mywork.com FORMAT=TEXT

GROUP=APPS_TEAM_PROCESS
     MAIL site02unix-admin-email@site02ad2141.mywork.com FORMAT=TEXT

GROUP=APPS_TEAM_PARTITION
     MAIL site02unix-admin-email@site02ad2141.mywork.com FORMAT=TEXT

Hobbit 提供了一個非常強大的除錯工具來跟蹤警報規則。從以下示例中,我們可以檢查主機是否符合 hobbit-alert.cfg 中的所有規則。

  • 如何除錯 "Oversize data/client msg" 錯誤資訊?
    • 以下是一個示例錯誤資訊
Oversize data/client msg from 10.5.64.212 truncated (n=2068326, limit 1961984)
First line: linux2.test.com|linux|linux
    • 檢查從 hobbit 客戶端傳送的 msg 檔案的大小。
# ls -l msg.linux2.test.com.txt
-rw-r--r--  1 hobbitc hobbitc 2068297 Jan 29 07:54 msg.linux2.test.com.txt
#
    • 找出為什麼 msg.linux2.test.com.text 如此之大。
  • 透過執行 bbcmd 設定除錯環境。它將設定所有 hobbit 環境變數。
bash-3.00$ bin/bbcmd
2007-07-23 14:28:21 Using default environment file /etc/opt/hobbitserver42/hobbitserver.cfg
bash-3.00$
  • 同時檢視 hobbitd_alert 的命令語法。
$ bin/hobbitd_alert --debug --test
Usage: hobbitd_alert --test HOST SERVICE [options]
Possible options:
        [--duration=SECONDS]
        [--color=COLOR]
        [--group=GROUPNAME]
        [--time=TIMESPEC]
$ bash
bash-3.00$
  • 使用 hobbitd_alert 除錯命令:成功匹配,/boot 磁碟使用率必須真正超過 16%。
bash-3.00$ bin/hobbitd_alert --debug --test t-rh9.mywork.com disk --group=APPS_TEAM_PARTITION
2007-07-23 14:38:57 Opening file /etc/opt/hobbitserver42/bb-hosts
2007-07-23 14:38:57 Opening file /etc/opt/hobbitserver42/hobbit-alerts.cfg
2007-07-23 14:38:57 Compiling regex (t-rh9).mywork.com
2007-07-23 14:38:57 Compiling regex (t-rh9).mywork.com
2007-07-23 14:38:57 send_alert t-rh9.mywork.com:DISK state 0
00018286 2007-07-23 14:38:57 send_alert t-rh9.mywork.com:DISK state Paging
00018286 2007-07-23 14:38:57 Matching host:service:page 't-rh9.mywork.com:DISK:'
 against rule line 122
00018286 2007-07-23 14:38:57 Failed 'HOST=$site02test SERVICE=cpu,disk,memory,files,telnet'
 (service not in include list)
00018286 2007-07-23 14:38:57 Matching host:service:page 't-rh9.mywork.com:DISK:'
 against rule line 125
00018286 2007-07-23 14:38:57 Failed 'HOST=$site02test SERVICE=conn' (service not in include list)
00018286 2007-07-23 14:38:57 Matching host:service:page 't-rh9.mywork.com:DISK:'
 against rule line 129
00018286 2007-07-23 14:38:57 Failed 'GROUP=UNIX_TEAM_PROCESS' (group not in include list)
00018286 2007-07-23 14:38:57 Matching host:service:page 't-rh9.mywork.com:DISK:'
 against rule line 132
00018286 2007-07-23 14:38:57 Failed 'GROUP=UNIX_TEAM_PARTITION' (group not in include list)
00018286 2007-07-23 14:38:57 Matching host:service:page 't-rh9.mywork.com:DISK:'
 against rule line 135
00018286 2007-07-23 14:38:57 Failed 'GROUP=APPS_TEAM_PROCESS' (group not in include list)
00018286 2007-07-23 14:38:57 Matching host:service:page 't-rh9.mywork.com:DISK:'
 against rule line 138
00018286 2007-07-23 14:38:57 *** Match with 'GROUP=APPS_TEAM_PARTITION' ***
2007-07-23 14:38:57 Found a first matching rule
00018286 2007-07-23 14:38:57 Matching host:service:page 't-rh9.mywork.com:DISK:'
 against rule line 138
00018286 2007-07-23 14:38:57 *** Match with 'GROUP=APPS_TEAM_PARTITION' ***
2007-07-23 14:38:57   repeat t-rh9.mywork.com|DISK|mail|site02unix-admin-
 email@site02ad2141.mywork.com at 0
2007-07-23 14:38:57   Alert for t-rh9.mywork.com:DISK to site02unix-admin-
 email@site02ad2141.mywork.com
00018286 2007-07-23 14:38:57 Mail alert with command 'mailx -s "Hobbit [12345] t-rh9.mywork.com:DISK
 CRITICAL (RED)" site02unix-admin-email@site02ad2141.mywork.com'
2007-07-23 14:38:57 No more secondary matching rule
bash-3.00$
  • 從“匹配項”關鍵字查詢匹配的精確規則。
  • 另一個檢查,Xvnc 程序限制必須真正觸發。
bash-3.00$ bin/hobbitd_alert --debug --test t-rh9.mywork.com PROC  --group=APPS_TEAM_PARTITION
2007-07-23 14:55:38 Opening file /etc/opt/hobbitserver42/bb-hosts
2007-07-23 14:55:38 Opening file /etc/opt/hobbitserver42/hobbit-alerts.cfg
2007-07-23 14:55:38 Compiling regex (t-rh9).mywork.com
2007-07-23 14:55:38 Compiling regex (t-rh9).mywork.com
2007-07-23 14:55:38 send_alert t-rh9.mywork.com:PROC state 0
00018526 2007-07-23 14:55:38 send_alert t-rh9.mywork.com:PROC state Paging
00018526 2007-07-23 14:55:38 Matching host:service:page 't-rh9.mywork.com:PROC:'
 against rule line 122
00018526 2007-07-23 14:55:38 Failed 'HOST=$site02test SERVICE=cpu,disk,memory,files,telnet'
 (service not in include list)
00018526 2007-07-23 14:55:38 Matching host:service:page 't-rh9.mywork.com:PROC:'
 against rule line 125
00018526 2007-07-23 14:55:38 Failed 'HOST=$site02test SERVICE=conn' (service not in include list)
00018526 2007-07-23 14:55:38 Matching host:service:page 't-rh9.mywork.com:PROC:'
 against rule line 129
00018526 2007-07-23 14:55:38 Failed 'GROUP=UNIX_TEAM_PROCESS' (group not in include list)
00018526 2007-07-23 14:55:38 Matching host:service:page 't-rh9.mywork.com:PROC:'
 against rule line 132
00018526 2007-07-23 14:55:38 Failed 'GROUP=UNIX_TEAM_PARTITION' (group not in include list)
00018526 2007-07-23 14:55:38 Matching host:service:page 't-rh9.mywork.com:PROC:'
 against rule line 135
00018526 2007-07-23 14:55:38 Failed 'GROUP=APPS_TEAM_PROCESS' (group not in include list)
00018526 2007-07-23 14:55:38 Matching host:service:page 't-rh9.mywork.com:PROC:'
 against rule line 138
00018526 2007-07-23 14:55:38 *** Match with 'GROUP=APPS_TEAM_PARTITION' ***
2007-07-23 14:55:38 Found a first matching rule
00018526 2007-07-23 14:55:38 Matching host:service:page 't-rh9.mywork.com:PROC:'
 against rule line 138
00018526 2007-07-23 14:55:38 *** Match with 'GROUP=APPS_TEAM_PARTITION' ***
2007-07-23 14:55:38   repeat t-rh9.mywork.com|PROC|mail|
 site02unix-admin-email@site02ad2141.mywork.com at 0
2007-07-23 14:55:38   Alert for t-rh9.mywork.com:PROC to
 site02unix-admin-email@site02ad2141.mywork.com
00018526 2007-07-23 14:55:38 Mail alert with command 'mailx -s "Hobbit [12345] t-rh9.mywork.com:PROC
 CRITICAL (RED)" site02unix-admin-email@site02ad2141.mywork.com'
2007-07-23 14:55:38 No more secondary matching rule
bash-3.00$

問:如何在 Solaris 上使 trimhistory 對 hobbit 伺服器生效?

[編輯 | 編輯原始碼]

答:hobbit 手冊頁 中的預設示例適用於 Linux 上的 hobbit 伺服器。

問:如何從 NK 概覽頁面中排除“資訊”和“趨勢”列?

[編輯 | 編輯原始碼]

答:從 Hobbitd 4.12 開始,目前硬編碼為“資訊”和“趨勢”列顯示在所有頁面上,包括 NK 和 BB2 頁面。如果要刪除這些列,則需要編輯 Hobbit 原始碼。更改非常簡單。在 hobbit-4.1.2/bbdisplay/pagegen.c 檔案中,第 121-123 行看起來像這樣

/* TRENDS and INFO columns are always included on non-BB pages */
if (strcmp(column->name, xgetenv("INFOCOLUMN")) == 0) return 1;
if (strcmp(column->name, xgetenv("TRENDSCOLUMN")) == 0) return 1;

將兩行上的“return 1”更改為“return 0”,儲存檔案,執行“make”,然後執行“make install”或將 bbdisplay/bbgen 程式複製到 ~hobbit/server/bin/ 。下次 NK 頁面更新時,這些列將消失。

問:如何使用 Hobbit 的內部 HTTP 測試功能來測試 Squid 代理伺服器?

[編輯 | 編輯原始碼]

答:如果要檢查服務是否真正正常執行,請在 bb-hosts 檔案中使用類似以下內容

0.0.0.0   squid.domain.com   # http://squid.domain.com:8080/http://www.google.com/

問:如何使用 Hobbit 的內部 HTTP 測試功能來測試對 Windows 域進行身份驗證的代理伺服器?

[編輯 | 編輯原始碼]

答:如果要檢查服務是否真正正常執行,請在 bb-hosts 檔案中使用類似以下內容

0.0.0.0   servername.domain.com   # \
    http://domain\username:password@servername.domain.com:8080/http://www.google.com/

問:如何在一個頁面上比較來自不同主機的圖表?

[編輯 | 編輯原始碼]

答:從 Hobbitd 4.12 開始,目前沒有前端來構建圖表所需的 URL,但您可以手動為所有具有 _multi 定義的圖表(例如平均負載、交換)執行此操作。

  1. 找到您要使用的基本圖表,例如其中一個主機的 CPU“平均負載”圖表。
  2. 在瀏覽器中,右鍵單擊圖表並選擇“檢視影像”或“開啟影像”。現在您只能看到負載圖表。
  3. 在位址列欄位中,您將看到此影像的 URL。例如
http://hobbit.domain.com/hobbit-cgi/hobbitgraph.sh?host=host1.domain.com&service=la\
&graph_width=576&graph_height=120&disp=host1%2edomain%2ecom&nostale&graph=hourly&action=view

現在,您可以在 URL 的“host=...”部分之後新增更多主機 - 只需將所有主機用逗號隔開即可。就像

http://hobbit.domain.com/hobbit-cgi/hobbitgraph.sh?host=host1.domain.com,host2.domain.com,\
host3.domain.com&service=la&graph_width=576&graph_height=120&disp=host1%2edomain%2ecom&nostale&\
graph=hourly&action=view

問:我剛剛從 BigBrother 客戶端升級到 Hobbit 客戶端,但我沒有收到任何關於 CPU 或磁碟的狀態,但收到了其他測試的狀態。

[編輯 | 編輯原始碼]

答:最常見的原因是客戶端使用的主機名與 bb-hosts 檔案中的主機名不同。在客戶端上,"uname -n" 命令報告的主機名是什麼?如果這與 bb-hosts 檔案中的主機名不同,請使用“--hostname=THE.REAL.HOSTNAME”選項啟動客戶端。

問:如何修復“來自 192.168.1.31 的超大狀態訊息,用於 test.my.com:埠被截斷(n=508634,limit=262144)”?

[編輯 | 編輯原始碼]

A.

嘗試增加 ~server/etc/hobbitserver.cfg 中 MAXMSG_STATUS 的值。

MAXMSG_STATUS
   The maximum size of a "status" message in kB, default: 256. Status
   messages are the ones that end up as columns on the web display. The
   default size should be adequate in most cases, but some extension
   scripts can generate very large status messages - close to 1024 kB.
   You should only change this if you see messages in the hobbitd log
   file about status messages being truncated.

limit=262144 為 256kB。您可以將 n 值除以 1024(508634/1024 = 496),然後可以將 MAXMSG_STATUS 設定為“500”並重新啟動 hobbit 伺服器。

B.

On Wed, May 03, 2006 at 03:43:19PM +0200, Dominique Frise wrote:
> Hi,
> 
> ----hobbitd.log----
> 2006-05-03 12:34:27 Oversize data/client msg from 130.223.5.20 truncated 
> (n=815825, limit 524288)
> First line: godzilla|sunos

"godzilla" - a Solaris host - sent a too-large "client" message of
815825 bytes. There's a limit set in Hobbit for the size of client
message at 512 KB, so the message was truncated.

> [bb (at) iris hobbit]$ cat clientdata.log
> 2006-05-03 12:34:28 Worker process died with exit code 0, terminating

This is interesting. If the truncated message caused hobbitd_client to
crash, I would have expected a different exit-code. I'll have to check 
how it handles truncated messages.

> How can this happend?

Dont know, but apparently some input from your host caused it.

> Has this been fixed in latest snapshot?

Probably not. Which version are you running?

> Which worker process died? (hobbitd_client is still running)

It's restarted automatically by hobbitlaunch.

Henrik
  • 我們需要調查為什麼 hb 客戶端訊息超大。就像以下內容一樣,我們發現我們有 msg.*.txt 檔案,其大小超過 512k。對於系統的 bb 訊息取樣來說,這是不正常的。
bash-3.00# wc msg.k206.test.com.txt
    7943   55662  611936 msg.k206.test.com.txt
bash-3.00# ls -l  msg.k206.test.com.txt
-rw-r--r--   1 hobbitc  hobbitc   611936 May  2 18:35 msg.v04k206.test.com.txt
bash-3.00#

  • 進一步調查發現,msg.*.txt 的 [ports] 部分包含來自兩個“netstat -na”命令的太多輸出。
bash-3.00# grep netstat /opt/hobbitclient42/bin/hobbitclient-sunos.sh
netstat -rn
echo "[netstat]"
netstat -s
netstat -na -f inet -P tcp | tail +3
netstat -na -f inet6 -P tcp | tail +5
bash-3.00#

[編輯 | 編輯原始碼]

答:它不可配置,但在 hobbit-4.2.0/web/hobbitgraph.c 檔案的頂部附近,您會找到以下幾行

 #define HOUR_GRAPH  "e-48h"
 #define DAY_GRAPH   "e-12d"
 #define WEEK_GRAPH  "e-48d"
 #define MONTH_GRAPH "e-576d"

更改它們以適合您。然後在同一個檔案中搜索更下方的 HOUR_GRAPH 等;您會在一個地方找到每個地方,如下所示

 period = HOUR_GRAPH;
 persecs = 48*60*60;

您還需要為所有 4 種圖表型別更改“persecs”計算。

更改圖例

 //persecs = 12*24*60*60;
 persecs = 7*24*60*60;
 //glegend = "Last 12 Days";
 glegend = "Last 7 Days";

然後執行“make”(從 hobbit-4.2.0 目錄)和“make install”(或僅將“web/hobbitgraph.cgi”檔案複製到您的 ~hobbit/server/bin/ 目錄)。

圖表常見問題解答

[編輯 | 編輯原始碼]

問:為什麼我的 Hobbit 伺服器具有以下 http 響應圖表?

[編輯 | 編輯原始碼]

為什麼 http 服務的響應時間差異如此之大。這是 http 伺服器配置錯誤嗎?
A trending of http response time.

答:數百種原因會導致 http 伺服器延遲。我們看到圖表僅在 2 到 10 毫秒範圍內有所不同。這是很正常的。由於自動縮放,圖表差異看起來比實際更重要或更劇烈。

[編輯 | 編輯原始碼]

A trending of bge0 network traffic.

答:傳入流量遠大於傳出流量,這是正常的。Hobbit 伺服器從客戶端接收大量 bb/hb 訊息。

問:這些 wrsmd* 介面是什麼?

[編輯 | 編輯原始碼]

答:wrsmd(7D)(WCI 遠端共享記憶體 (WRSM) DLPI 驅動程式)狀態由 Solaris 10 命令 "/usr/bin/kstat -p -s '[or]bytes64'" 報告,該命令用於 hobbitclient-sunos.sh 中的 [ifstat]。我說“曾經”,因為在我們所有打了補丁的 Solaris 10 伺服器上,我們已經很久沒有看到這種情況了。

您可以透過使用 "/usr/bin/kstat -p -s '[or]bytes64' | grep -v wrsmd | sort" 來避免此輸出,用於 [ifstat]。您還需要刪除所有 ifstat.wrsmd*.rrd 檔案。

Dominique UNIL - 洛桑大學

問:更正後的圖表

[編輯 | 編輯原始碼]

wrsmd 介面現在已從圖表中消失。

A trending of bge0 network traffic without wrsmd* intefaces.

問:如何使用 Hobbit/BBWin 客戶端在網路介面上收集 Bit/s?

[編輯 | 編輯原始碼]

答:我對這個問題很感興趣,但還沒有找到答案。

錯誤 FAQ

[編輯 | 編輯原始碼]

semop 失敗,無效引數?

[編輯 | 編輯原始碼]

答:當 hobbit 非正常退出時經常出現。停止 Hobbit,然後執行,

         # ipcs |grep hobbit
         0x0100ba76 162758665  hobbit    600        262144     2
         0x0200ba76 162791434  hobbit    600        262144     2
         And remove any remaining shared memory segments.
         # ipcrm -M 0x0200ba76
bash-3.00# tail hobbitd.log
2008-02-18 12:28:00 semop failed, Invalid argument
2008-02-18 12:28:00 How did this happen? clients=-1, s.sem_op=0
2008-02-18 12:28:00 semop failed, Invalid argument
2008-02-18 12:28:00 How did this happen? clients=-1, s.sem_op=0
2008-02-18 12:28:00 semop failed, Invalid argument
2008-02-18 12:28:00 How did this happen? clients=-1, s.sem_op=0
2008-02-18 12:28:00 semop failed, Invalid argument
2008-02-18 12:28:00 How did this happen? clients=-1, s.sem_op=0
2008-02-18 12:28:00 semop failed, Invalid argument
2008-02-18 12:28:00 How did this happen? clients=-1, s.sem_op=0
bash-3.00#
bash-3.00#

華夏公益教科書