Ubuntu

無法將新的 munin 節點添加到現有的 munin 主節點

  • February 11, 2022

我正在嘗試將一個節點添加到現有的 munin 主節點(我沒有設置它,但它似乎工作正常,因為它顯示了 8 個現有節點的圖表)並且我遇到了一些麻煩。以下是我遵循的步驟:

掌握

將節點添加到**/etc/munin/munin.conf**

[server.example.org]
  address private.server.example.org

master的html目錄為(匹配apache配置):

htmldir /opt/munin

該目錄包含以下文件和文件夾:

ls -lh /opt/munin/
drwxr-xr-x 20 munin munin 4.0K 2011-11-07 16:15 example.org <= FOLDER NAMED AFTER OUR DOMAIN
-rw-r--r--  1 munin munin 2.5K 2010-08-03 14:11 definitions.html
-rw-r--r--  1 munin munin 3.0K 2010-08-03 14:11 favicon.ico
-rw-r--r--  1 munin munin  15K 2011-11-07 16:21 index.html  <= MAIN MUNIN PAGE
-rw-r--r--  1 munin munin 1.8K 2010-08-03 14:11 logo-h.png
-rw-r--r--  1 munin munin  473 2010-08-03 14:11 logo.png
-rw-r--r--  1 munin munin 5.6K 2010-11-03 14:07 style.css

index.html的頁腳表明這個文件是由 munin 動態生成的,所以我知道我不必碰這個文件。

This page was generated by <a href='http://munin-monitoring.org/'>Munin</a> version 1.4.4 at 2011-11-07 16:21:30+0000 (UTC)

域目錄包含所有節點的文件夾。我最終為新節點創建了一個,希望它會有所幫助,但沒有任何區別

mkdir /opt/munin/example.org/server.example.org
chown munin:munin -R /opt/munin/example.org/server.example.org

我殺死了 munin-cron 並重新啟動它,但也沒有什麼區別。

$ sudo su munin munin-cron start
$ sudo ps aux | grep munin-cron
munin    26566  0.0  0.2   4092   584 ?        Ss   16:35   0:00 /bin/sh -c if [ -x /usr/bin/munin-cron ]; then /usr/bin/munin-cron; fi
munin    26567  0.0  0.2   4092   576 ?        S    16:35   0:00 /bin/sh /usr/bin/munin-cron

穆寧節點

安裝 munin-node 包

apt-get install munin-node

修改*/etc/munin/munin-node.conf*文件以允許來自 munin master 的訪問

host *
allow ^A\.B\.C\.D$  # master IP address
port 4949

重啟的munin節點

service munin-node start

如果我在新節點上執行 tcpdump,我可以看到一些數據正在與主節點交換,所以我相信此時問題在於配置主節點。

關於我在做什麼或如何進一步解決這個問題的任何想法?

其他故障排除

按照建議,我檢查了日誌

$ grep server.example.org /var/log/munin/munin-update.log

2011/11/08 08:40:03 [WARNING] Config node server.example.org listed no services for server.example.org.  Please see http://munin-monitoring.org/wiki/FAQ_no_graphs for further information.
2011/11/08 09:10:02 [INFO] Reaping Munin::Master::UpdateWorker<example.org;server.example.org>.  Exit value/signal: 0/0

警告把我帶到了這個頁面http://munin-monitoring.org/wiki/FAQ_no_graphs。我按照建議的步驟進行操作。儘管符號連結似乎已正確創建,但我確實執行了munin-node-configure --shell | sh -x相信解決問題的命令。上述頁面還建議更改host_name我所做的設置(儘管我認為它沒有幫助,因為其他工作節點沒有配置它)。

當我到達時,telnet 故障排除已成功

$ telnet private.server.example.org 4949
Trying A.B.C.D...
Connected to private.server.example.org.
Escape character is '^]'.
# munin node at server.example.org

> nodes
server.example.org
.

> list server.example.org
cpu df df_inode entropy forks fw_conntrack fw_forwarded_local fw_packets if_err_eth0 if_err_eth1 if_eth0 if_eth1 interrupts iostat iostat_ios ip_A.B.C.D irqstats load memory open_files open_inodes postfix_mailqueue postfix_mailvolume proc_pri processes swap threads uptime users vmstat

> fetch df
_dev_sda1.value 23.1295909196156
_dev.value 1.2890625
_dev_shm.value 0
_var_run.value 0.00782368542525642
_var_lock.value 0
_lib_init_rw.value 0

我看不出您的設置有任何明顯錯誤。我會建議兩件事;

  • 閱讀 munin-master 上的日誌。 /var/log/munin/munin-update.log是開始的地方。如果您有確認更新成功的條目,並且您獲得了 rrd 文件/var/lib/munin/- 繼續munin-graph.logmunin-html.log
  • 驗證主節點是否能夠連接到 munin 節點的地址。請使用netcat或類似的測試:nc private.server.example.org 4949. 預期輸出應該是:# munin node at hostname. 可能的錯誤是數據包被防火牆丟棄(而 nc 將掛起connect(),如果使用 strace 則可見),或者無法解析名稱(而 netcat 輸出nc: getaddrinfo: Name or service not known)。

如果您在嘗試上述操作後找不到任何東西,請從 master 粘貼一個完整的 munin.conf,(如果必須,用數字匿名化數字 IP 地址,用一些虛假文本匿名化主機名)。

並不少見的錯誤;cron-job 可能在某些時候被 root 呼叫,其中某些文件具有 root 所有權並且不能由 munin 使用者更新,他通常需要對 /var/lib/munin 中的所有文件的寫訪問權和 html 目錄。

引用自:https://serverfault.com/questions/328551