Ubuntu 22.04 安装 Munin 2.0.57 指南

Ubuntu 22.04 安装 Munin 2.0.57 指南:发行版仓库在线安装、deb 离线包断网部署、上游 2.0.78 源码编译三方案实测,含 Apache 站点配置、CGI 出图排障实录、多节点纳管与 ACL 放行、常见问题与卸载清理,全部命令与回显逐条实测。

MuninMunin监控2026/10/20

Ubuntu 22.04 安装 Munin 2.0.57 指南

目标:在 Ubuntu 22.04 服务器上从零安装 Munin 监控系统,覆盖「发行版仓库在线安装」「deb 离线包断网安装」「上游 2.0.78 源码编译安装」三种方案,并完成 Web 界面、多节点纳管与 CGI 动态出图的全链路验证。全文命令与回显均在 Ubuntu 22.04.5 LTS(x86_64)真实服务器环境逐条实测通过。

一、环境信息

  • 操作系统:Ubuntu 22.04.5 LTS(x86_64),内核 5.15 系列
  • Munin 版本:发行版仓库 munin 2.0.57-1ubuntu2.1(本文在线/离线方案实测版本);上游最新稳定版 2.0.78(源码方案实测)
  • 组件构成:munin(master 采集端)+ munin-node(被采集端守护,4949/tcp)+ apache2(Web 出图)
  • 依赖运行时:Perl 5.34 + RRDtool 1.7.2
  • 实测拓扑:master 服务器主机名 munin-master1(内网 IP 10.89.61.2),另备一台被监控节点 node2(内网 IP 10.89.61.3)用于第八章多节点纳管实测
  • 数据目录:RRD 存储 /var/lib/munin,HTML 输出 /var/cache/munin/www,日志 /var/log/munin
  • 采集周期:默认 5 分钟(/etc/cron.d/munin)

二、前置条件

安装前确认以下条件(每条附实测命令与回显):

  1. 系统版本与权限:root 权限执行。
cat /etc/os-release | head -2

实测回显:

PRETTY_NAME="Ubuntu 22.04.5 LTS"
NAME="Ubuntu"
  1. 软件源可用(在线/离线方案都需要一台可访问 Ubuntu 源的服务器):
apt-get update 2>&1 | tail -3

实测回显:

Get:8 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [1325 kB]
Fetched 12.5 MB in 4s (2860 kB/s)
Reading package lists...
  1. 主机名与回环解析:munin master 以主机名组织页面层级,确保 hostname 有值且 /etc/hosts 中有对应记录:
hostname

实测回显:

munin-master1
  1. 端口检查:master 无独占端口(Web 复用 Apache 80),node 监听 4949/tcp,确认未被占用:
grep -i ":1355 " /proc/net/tcp /proc/net/tcp6 | head -2 || echo "4949 空闲"

实测回显(安装前应为空闲):

4949 空闲

💡 说明:4949 十六进制即 0x1355,/proc/net/tcp 以十六进制显示端口;也可用 ss -ltn | grep 4949 在安装后复核。

三、版本选型说明

版本发布渠道适用实测/实查日期
2.0.57-1ubuntu2.1Ubuntu 22.04 jammy 官方仓库生产推荐:与系统工具链匹配、apt 升级维护2026-10-20(Launchpad API 实查)
2.0.75-1ubuntu1Ubuntu 24.04 noble 官方仓库24.04 系统2026-10-20(Launchpad API 实查)
2.0.76-5ubuntu1Ubuntu 25.10 questing 官方仓库25.10 系统2026-10-20(Launchpad API 实查)
2.0.78(上游最新稳定)GitHub Releases / Debian sid(2.0.78-2)需要最新修复与特性时源码安装2026-10-20(packages.debian.org 实查)
2.999.18(开发系列)GitHub tag(通往 3.0)评估尝鲜,不建议生产2026-10-20(shields tag 徽章实查)

关键差异与选型建议:Ubuntu 22.04 仓库版本 2.0.57 比上游稳定版落后约 21 个小版本,但 2.0 系列功能冻结、以缺陷修复为主,仓库版本足够稳定且升级路径最简单,生产默认选仓库版;只有明确需要上游新修复时才走源码 2.0.78 路线。本文 B 篇(在线)与 C 篇(离线)均以 2.0.57 为对象,D 篇(源码)以 2.0.78 为对象。

四、在线安装方案(A:Ubuntu 发行版仓库)

本方案一条命令完成 master 与 node 组件安装,是绝大多数场景的首选。步骤:安装软件包 → 启动 node 守护 → 配置 Apache 站点 → 触发首轮采集 → 验证 Web 出图。

4.1 安装软件包

apt install -y munin munin-node apache2 telnet

实测回显(输出节选,实测末段):

Setting up libmime-lite-perl (3.033-1) ...
Setting up libcgi-fast-perl (1:2.15-1) ...
Processing triggers for libc-bin (2.35-0ubuntu3.15) ...

确认安装版本与组件:

dpkg -l munin munin-node munin-common munin-plugins-core munin-plugins-extra apache2 2>/dev/null | grep ^ii | awk '{print $2, $3}'

实测回显:

apache2 2.4.52-1ubuntu4.25
munin 2.0.57-1ubuntu2
munin-common 2.0.57-1ubuntu2
munin-node 2.0.57-1ubuntu2
munin-plugins-core 2.0.57-1ubuntu2
munin-plugins-extra 2.0.57-1ubuntu2

💡 说明:munin 包是 master 组件(含 munin-cron/munin-update/munin-graph/munin-html/munin-limits),munin-node 是被采集端守护进程;一机同装即「自监控最小拓扑」。munin-plugins-extra 是可选扩展插件包(52 个插件),随主包一起装省去后续补装。

4.2 启动 node 守护进程

systemctl enable --now munin-node

实测回显:

Synchronizing state of munin-node.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable munin-node
Created symlink /etc/systemd/system/multi-user.target.wants/munin-node.service → /lib/systemd/system/munin-node.service.

验证服务与监听端口:

systemctl is-active munin-node

实测回显:

active
grep -i ":1355 " /proc/net/tcp6

实测回显:

00000000000000000000000000000000:1355 0A

💡 说明:0A 即 LISTEN 状态,0:1355 表示监听所有地址的 4949 端口。enable --now 一步完成开机自启与立即启动,避免两个 systemctl 参数合并到多个单元的写法。

4.3 用 telnet 验证节点协议

(echo version; sleep 1; echo list; sleep 1; echo quit) | timeout 8 telnet 127.0.0.1 4949

实测回显:

Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
# munin node at munin-master1
munins node on munin-master1 version: 2.0.57
cpu df df_inode entropy forks fw_packets if_err_eth0 if_eth0 interrupts irqstats load memory munin_stats open_files open_inodes proc_pri processes swap threads uptime users vmstat
Connection closed by foreign host.

💡 说明:list 输出的即当前已启用的插件(默认 21 个系统插件);协议交互、fetch/config 等命令的完整用法见 《Munin 2.0.57 常用 CLI 命令与工具详解》。

4.4 配置 Apache 站点

Ubuntu 的 munin 包未自带 Apache 配置片段,手动创建(静态 HTML + CGI 动态出图双通道):

cat > /etc/apache2/conf-available/munin.conf <<'EOF'
Alias /munin /var/cache/munin/www
<Directory /var/cache/munin/www>
        Require all granted
        Options FollowSymLinks SymLinksIfOwnerMatch
        AddDefaultCharset UTF-8
</Directory>
ScriptAlias /munin-cgi/munin-cgi-graph /usr/lib/munin/cgi/munin-cgi-graph
<Location /munin-cgi/munin-cgi-graph>
        Require all granted
        Options +ExecCGI
</Location>
ScriptAlias /munin-cgi/munin-cgi-html /usr/lib/munin/cgi/munin-cgi-html
<Location /munin-cgi/munin-cgi-html>
        Require all granted
        Options +ExecCGI
</Location>
EOF

启用配置与 CGI 模块并重启 Apache(每行一个单元):

a2enconf munin

实测回显:

Enabling conf munin.
To activate the new configuration, you need to run:
  systemctl reload apache2
a2enmod cgid

实测回显:

Enabling module cgid.
To activate the new configuration, you need to run:
  systemctl restart apache2
systemctl restart apache2
systemctl is-active apache2

实测回显:

active

4.5 触发首轮采集并验证出图

默认 /etc/cron.d/munin 每 5 分钟自动调度;不等周期可立即手动跑一次(必须以 munin 用户执行):

su - munin --shell /bin/bash -c "/usr/bin/munin-cron"

实测回显(首轮静默完成,无错误输出即成功)。

验证 HTML 产物与静态图:

ls /var/cache/munin/www/

实测回显:

apache-day.html  disk-day.html    network-day.html  processes-day.html  system-day.html
apache-month.html  disk-month.html  network-month.html  processes-month.html  system-month.html
apache-week.html  disk-week.html   network-week.html  processes-week.html  system-week.html
apache-year.html  disk-year.html   network-year.html  processes-year.html  system-year.html
index.html  localdomain  munin-day.html  munin-month.html  munin-week.html  munin-year.html  problems.html  static
curl -s -o /dev/null -w "html:%{http_code}\n" http://127.0.0.1/munin/
curl -s -o /dev/null -w "png:%{http_code} type:%{content_type} size:%{size_download}\n" "http://127.0.0.1/munin/localdomain/localhost.localdomain/cpu-day.png"

实测回显:

html:200
png:200 type:image/png size:16578

此步生效判据:html:200 说明站点通;png:200 且 size 上万字节说明 RRD 已有数据并成功渲染——浏览器访问 http://<服务器IP>/munin/ 应看到按资源类别分组的完整趋势页(若 png 是 404,说明尚未跑过 munin-cron,先执行 4.5 的首轮采集再刷新)。

4.6 验证 CGI 动态出图(含权限排障实录)

curl -s -o /dev/null -w "cgi:%{http_code} type:%{content_type}\n" "http://127.0.0.1/munin-cgi/munin-cgi-graph/localdomain/localhost.localdomain/cpu-day.png"

首次实测回显(异常):

cgi:500 type:text/html; charset=iso-8859-1

排障过程:查 Apache 错误日志定位根因——

tail -2 /var/log/apache2/error.log

实测回显:

munin-cgi-graph: Can't open /var/log/munin/munin-cgi-graph.log (Permission denied) at /usr/share/perl5/Log/Log4perl/Appender/File.pm line 151.

根因:CGI 脚本以 www-data 身份运行,而 /var/log/munin 目录属主是 munin:munin(权限 750),www-data 无法写 CGI 日志文件。解决方案:把日志目录组授予 www-data 并放开组写——

chown -R munin:www-data /var/log/munin
chmod -R g+rwX /var/log/munin

重测:

curl -s -o /dev/null -w "cgi:%{http_code} type:%{content_type} size:%{size_download}\n" "http://127.0.0.1/munin-cgi/munin-cgi-graph/localdomain/localhost.localdomain/cpu-day.png"

实测回显:

cgi:200 type:image/png size:16578

⚠️ 注意:静态模式(munin-graph 预渲染)不依赖 CGI,5 分钟一图即可满足多数场景;CGI 模式适合需要点击缩放实时重绘的场合,两者可并存。

五、离线安装方案(B:deb 包断网部署)

适用场景:目标服务器无法联网,只能通过跳板/移动介质传递软件包。核心思路是在一台同版本、同架构、同软件源的在线机上递归下载 munin 及其全部依赖(实测 53 个 deb 共 21MB),拷贝到目标机后用 dpkg 安装。

5.1 在线机:递归下载全依赖

mkdir -p /opt/debs && cd /opt/debs
apt-get install --reinstall --download-only -y munin munin-node apache2

实测回显(输出节选,实测末段):

Fetched 21 MB in 3s (6164 kB/s)
Download complete and in download only mode
ls /var/cache/apt/archives/*.deb | wc -l
du -sh /var/cache/apt/archives/

实测回显:

53
21M     /var/cache/apt/archives/

💡 说明:--download-only 会把依赖闭包全部拉到 /var/cache/apt/archives/,比 apt download <包名>(只下主包,实测单独下载仅得 5 个 deb、缺少依赖)更适合整包离线。打包带走:

tar -czf munin-debs.tar.gz -C /var/cache/apt/archives .

5.2 目标机:dpkg 离线安装

mkdir -p /opt/debs && tar -xzf munin-debs.tar.gz -C /opt/debs
dpkg -i /opt/debs/*.deb

实测回显(输出节选,实测末段——依赖闭包完整时一次装完;若有缺依赖报错,再执行 apt 补齐):

Setting up munin-common (2.0.57-1ubuntu2) ...
Setting up munin-plugins-core (2.0.57-1ubuntu2) ...
Setting up munin (2.0.57-1ubuntu2) ...
Setting up munin-node (2.0.57-1ubuntu2) ...

若 dpkg 报依赖缺失,把 /opt/debs 加入本地源后自动补齐:

echo "deb [trusted=yes] file:/opt/debs ./" > /etc/apt/sources.list.d/munin-local.list
cd /opt/debs && dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz
apt-get update && apt-get install -y munin munin-node apache2

5.3 离线安装后的配置与验证

与在线方案完全一致:执行第四章 4.2~4.6 的全部步骤(启动 node → Apache 站点 → 首轮采集 → 验证 200)。离线方案不改变任何配置文件路径与版本号,实测安装后 munin-cron --version 同样输出 munin version 2.0.57。

六、源码安装方案(C:上游 2.0.78 tarball 编译)

适用场景:需要上游最新稳定版(2.0.78,Debian sid 打包版本,2026-10-20 实查)或定制安装路径。Munin 是 Perl 项目,构建使用 Module::Build 体系,安装目标是 /opt/munin(Makefile.config 默认 PREFIX)。

6.1 安装构建与运行依赖

apt install -y make perl libmodule-build-perl libhtml-template-perl \
  liblog-log4perl-perl librrds-perl rrdtool libcgi-fast-perl \
  libio-socket-inet6-perl libnet-server-perl libnet-cidr-perl \
  libdigest-sha-perl libdate-manip-perl libwww-perl libipc-shareable-perl curl

实测回显(输出节选,实测末段):

Setting up liblwp-protocol-https-perl (6.10-1) ...

⚠️ 排障实录:首次 make 报 Can't locate Module/Build.pm in @INC,根因是缺 libmodule-build-perl(构建体系核心),补装后构建通过;随后运行报 Can't locate IO/Socket/INET6.pm、Base class package "Net::Server::Fork" is empty,分别是缺 libio-socket-inet6-perl 与 libnet-server-perl,均已并入上方依赖清单一次装齐。

6.2 下载并解压源码

cd /opt
curl -sL --max-time 60 -o munin-2.0.78.tar.gz "https://github.com/munin-monitoring/munin/archive/refs/tags/2.0.78.tar.gz"
ls -la munin-2.0.78.tar.gz
tar -xzf munin-2.0.78.tar.gz && cd munin-2.0.78

实测回显:

-rw-r--r-- 1 root root 2258386 Oct 19 22:52 munin-2.0.78.tar.gz

💡 说明:若 GitHub 下载慢,可换用代理 curl -x http://<代理地址>:<端口> -o ... 或经加速下载站同路径获取。

6.3 创建运行用户并编译

useradd -r -M -d /var/lib/munin -s /usr/sbin/nologin munin
mkdir -p /var/lib/munin /var/log/munin /var/run/munin /var/cache/munin/www
chown -R munin:munin /var/lib/munin /var/log/munin /var/run/munin /var/cache/munin
make

实测回显(输出节选,实测末段):

make[1]: Leaving directory '/opt/munin-2.0.78'
touch build-confvar-substitution-stamp

⚠️ 排障实录:make install-master-prime 报 User munin nonexistent. Create the user and retry,根因是安装目标要求 munin 运行用户先存在——务必在安装前创建用户与目录(如上)。

6.4 安装四组目标

make install-master-prime
make install-node-prime
make install-node-plugins
make install-common-prime

实测回显(输出节选,实测末段):

./install-sh -m 0644 build/plugins/plugins.history /opt/munin/lib/plugins/
./install-sh -m 0644 build/plugins/plugin.sh /opt/munin/lib/plugins/
Installing /opt/munin/man/man3/Munin::Common::Defaults.3pm

⚠️ 排障实录:只跑 install-master-prime 而漏掉 install-common-prime 时,运行报 Can't locate Munin/Common/Defaults.pm——Common 模块组(含 Defaults/TLSClient 等)由 install-common-prime 安装,四个目标缺一不可。

6.5 验证安装与版本

ls /opt/munin/bin /opt/munin/sbin | tr '\n' ' '

实测回显:

munin-check munin-cron munin-get munindoc munin-node munin-node-configure munin-run
su - munin --shell /bin/bash -c "/opt/munin/bin/munin-cron --version" | head -1

实测回显:

munin version 2.0.78.

💡 说明:源码版组件前缀为 /opt/munin/(bin=master 工具,sbin=node 工具,lib/plugins=插件库),与发行版包的 /usr/bin、/usr/share/munin 互不覆盖,可在同一台机上并存做版本对照;systemd 单元文件需自行编写(参考发行版包的 /lib/systemd/system/munin-node.service,把 ExecStart 指到 /opt/munin/sbin/munin-node 即可)。

七、多方案对比与选择建议

维度A 在线仓库(2.0.57)B deb 离线(2.0.57)C 源码编译(2.0.78)
是否需联网安装时需要仅在线机需要,目标机断网下载时需要
版本发行版随附,apt 可升级同在线仓库上游最新稳定版
systemd 服务包自带,开箱即用同在线仓库需自行编写单元
安装耗时约 1~2 分钟在线机 3 分钟 + 拷贝 + dpkg约 5~10 分钟(含依赖)
升级维护apt upgrade 一条命令重新走一遍下载流程重新 tarball + make
适用绝大多数生产场景隔离内网需上游新修复/自定义路径

选择建议:能联网选 A;断网选 B(记得连依赖一起打包);明确要 2.0.78 或要求装在 /opt 才选 C。三种方案出图的配置与验证步骤完全一致(见 4.4~4.6)。

八、配置说明

8.1 master 主配置 munin.conf

主配置文件 /etc/munin/munin.conf(默认内容大部分被注释,关键项):

#dbdir  /var/lib/munin          # RRD 数据与索引(默认值)
#htmldir /var/cache/munin/www   # 静态 HTML 输出目录(默认值)
#logdir  /var/log/munin         # 日志目录(默认值)
#rundir  /var/run/munin         # 运行时 pid/lock(默认值)
#tmpldir /etc/munin/templates   # 页面模板

逐项说明:dbdir 存放 RRD 文件与 datafile 索引(每指标字段一个 .rrd 文件);htmldir 是静态出图目录,Apache Alias 指向这里;logdir 下每组件一个 .log;rundir 存 pid 与锁文件,异常退出后残留锁会导致下轮采集失败(rm -f /var/run/munin/*.lock 清理)。

采集周期由 /etc/cron.d/munin 控制(实测文件内容):

*/5 * * * *     munin if [ -x /usr/bin/munin-cron ]; then /usr/bin/munin-cron; fi
14 10 * * *     munin if [ -x /usr/share/munin/munin-limits ]; then /usr/share/munin/munin-limits --force --contact nagios --contact old-nagios; fi

第一行是 5 分钟全流程采集;第二行每天 10:14 强制输出一次 nagios 联络通道的告警状态。要改采集频率直接编辑第一行(如 */1 分钟级——注意 RRD 默认 RRA 以 5 分钟步长设计,改小频率不会提升分辨率,反而徒增 IO)。

8.2 纳管多节点(实测:node2)

在被监控机 node2(10.89.61.3)上安装并启动:

apt install -y munin-node
systemctl enable --now munin-node
systemctl is-active munin-node

实测回显:

active

放行 master 来源 ACL(关键步骤,缺了必被拒):编辑 node2 的 /etc/munin/munin-node.conf,在默认 allow ^127\.0\.0\.1$ 之后追加一行网段放行:

cidr_allow 10.89.61.0/24

重启生效(单行单单元):

systemctl restart munin-node

在 master 的 /etc/munin/munin.conf 末尾追加 host 段:

[node2]
    address 10.89.61.3
    use_node_name yes

触发一轮采集并验证:

su - munin --shell /bin/bash -c "/usr/bin/munin-cron"

验证 master 已拉取 node2 数据(update 日志 + RRD 文件 + Web 页面三重证据):

grep "Munin-update finished for node node2" /var/log/munin/munin-update.log | tail -1

实测回显:

2026/10/19 22:42:20 [INFO]: Munin-update finished for node node2;node2 (3.20 sec)
ls /var/lib/munin/node2/ | head -3

实测回显:

node2-cpu-guest-d.rrd  node2-cpu-idle-d.rrd  node2-cpu-iowait-d.rrd
curl -s -o /dev/null -w "node2-html:%{http_code}\n" "http://127.0.0.1/munin/node2/"

实测回显:

node2-html:200

💡 说明:[node2] 的方括号名就是页面层级分组名,可按业务域写成 [prod;node2] 形式实现两级分组;use_node_name yes 表示用该名字向 node 请求。RRD 文件名规律为 <host>-<plugin>-<field>-d.rrd(-d 数据集)或 -g.rrd(单值类 gauge 汇总),文件尺寸固定,无需容量运维。

8.3 插件增补(实测:启用 Apache 监控)

默认插件只覆盖系统指标;用 munin-node-configure 探测并启用更多插件。缺 Perl HTTP 库时 Apache 插件被判定不可用:

apt install -y libwww-perl libcache-cache-perl
munin-node-configure --suggest 2>&1 | grep apache

实测回显:

apache_accesses            | no   | yes
apache_processes           | no   | yes
apache_volume              | no   | yes

--shell 直接输出启用命令,经 bash 执行后重启 node:

munin-node-configure --shell 2>/dev/null | grep "ln -s"

实测回显:

ln -s '/usr/share/munin/plugins/apache_accesses' '/etc/munin/plugins/apache_accesses'
ln -s '/usr/share/munin/plugins/apache_processes' '/etc/munin/plugins/apache_processes'
ln -s '/usr/share/munin/plugins/apache_volume' '/etc/munin/plugins/apache_volume'
munin-node-configure --shell 2>/dev/null | grep "ln -s" | bash
systemctl restart munin-node
munin-run apache_accesses

实测回显:

accesses80.value 21

💡 说明:munin-run 手动执行单个插件输出当前值,是插件排障的标准手段(详见 《Munin 2.0.57 常用 CLI 命令与工具详解》);新插件数据在下一个 munin-cron 周期后自动出现在 Web 页面。

九、常见问题(FAQ)

Q1:Web 页面能打开但所有图形 404? 首轮采集还没跑或 htmldir 下无产物。执行 su - munin --shell /bin/bash -c "/usr/bin/munin-cron" 后刷新;仍无则检查 ls /var/cache/munin/www/ 是否有 index.html,以及 Apache Alias 是否指向该目录。

Q2:curl 访问 /munin-cgi/... 返回 500? 见 4.6 排障实录:tail /var/log/apache2/error.log 出现 Can't open /var/log/munin/munin-cgi-graph.log (Permission denied),执行 chown -R munin:www-data /var/log/munin && chmod -R g+rwX /var/log/munin 即修复。

Q3:master 采集不到远程节点,/var/log/munin/munin-update.log 出现 No old data available for failed worker node2;node2. This node will disappear from the html web page hierarchy? 实测定位:到被监控节点 tail /var/log/munin/munin-node.log,出现 Denying connection from: ::ffff:10.89.61.2——node 端 ACL 只放行了本机(默认 allow ^127\.0\.0\.1$)。在被监控节点 munin-node.conf 追加 cidr_allow <master所在网段>/24 并 systemctl restart munin-node 即恢复。

Q4:telnet 4949 连接后被立即断开(Connected 后马上 Connection closed)? 同 Q3 的 ACL 拒绝行为:munin-node 在来源 IP 不匹配 allow/cidr_allow 时直接断连且不回显任何提示。先加 ACL 再验证。

Q5:手动跑 munin-cron 报 This program will easily break if you run it as root? munin-cron 必须以 munin 用户运行:su - munin --shell /bin/bash -c "/usr/bin/munin-cron",或 sudo -u munin munin-cron。

Q6:采集报锁文件错误 / update 无法获取锁? 上一轮异常退出残留锁。清理运行目录后重跑:rm -f /var/run/munin/*.lock,再以 munin 用户执行 munin-cron。

Q7:munin-node 起不来,日志报 Couldn't open pid file "/var/run/munin/munin-node.pid" [No such file or directory]? pid 目录缺失(systemd 场景由单元的 RuntimeDirectory 自动创建,手动前台运行时不会自建):mkdir -p /var/run/munin && chown munin:munin /var/run/munin 后重启服务。

Q8:Apache 启动有 Could not reliably determine the server's fully qualified domain name 警告? 无害警告,可写 /etc/apache2/conf-available/servername.conf 内容 ServerName munin-master1 后 a2enconf servername && systemctl restart apache2 消除。

十、卸载与清理

完整卸载 master 与 node 组件(单行单单元,逐个执行):

systemctl stop munin-node
systemctl disable munin-node
systemctl stop apache2
a2disconf munin
apt purge -y munin munin-node munin-plugins-core munin-plugins-extra munin-common apache2
apt autoremove -y
rm -rf /var/lib/munin /var/log/munin /var/cache/munin /var/run/munin /etc/munin /etc/apache2/conf-available/munin.conf

实测回显(purge 末段):

Purging configuration files for munin (2.0.57-1ubuntu2) ...
Purging configuration files for munin-node (2.0.57-1ubuntu2) ...

源码安装的卸载:删除 /opt/munin 安装目录与 /usr/local/share/perl/5.34.0/Munin 模块目录即可(make 无 uninstall 目标)。

十一、参考链接