Munin

穆寧為什麼煩人?

  • November 24, 2015

我們有一個 Munin 伺服器,它最近出現了一些非常奇怪的行為。網站本身執行良好,我們正在獲取統計數據,我正在分頁,一切都很好,除了……每 5 分鐘我收到一封電子郵件,上面寫著:

/bin/sh: 1: munin: not found
This program will easily break if you run it as root as you are
trying now.  Please run it as user 'munin'.  The correct 'su' command
on many systems is 'su - munin --shell=/bin/bash'
Aborting.

所以,我認為 /etc/cron.d/munin-node 中的 crontab 的使用者名錯誤,對吧?不…

#
# cron-jobs for munin-node
#

MAILTO=root

# If the APT plugin is enabled, update packages databases approx. once
# an hour (12 invokations an hour, 1 in 12 chance that the update will
# happen), but ensure that there will never be more than two hour (7200
# seconds) interval between updates..
*/5 * * * *     munin if [ -x /etc/munin/plugins/apt_all ]; then munin-run apt_all update 7200 12 >/dev/null; elif [ -x /etc/munin/plugins/apt ]; then munin-run apt update 7200 12 >/dev/null; fi

我什至完全刪除了文件 /etc/cron.d/munin-node 並且它仍然繼續執行,就好像它在那裡一樣,並且它正在嘗試以 root 身份執行。

而且,當然,統計數據會按時顯示。這讓我發瘋了,因為我每 5 分鐘就會收到一封垃圾郵件。

你檢查過 root 的 crontab 嗎?以 root 身份使用crontab -l以獲取它的列表。未能在通常的地方看看

/etc/crontab
/etc/cron.d
/etc/cron.*

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