Since this is something I think I've bumped into at least eight times in the past decade, I thought I'd document, comprehensively, how I get Munin to monitor Apache and/or Nginx using the
nginx_* Munin plugins that come with Munin itself.
Besides the obvious action of symlinking the plugins into Munin's plugins folder, you should—to avoid any surprises—forcibly configure the
env.url for all Apache and Nginx servers. As an example, in your munin-node configuration (on RedHat/CentOS, in
/etc/munin/plugin-conf.d, add a file named something like
# For Nginx:
# For Apache:
Now, something that often trips me up—especially since I maintain a variety of servers and containers, with some running ancient forms of CentOS, while others are running more recent builds of Debian, Fedora, or Ubuntu—is that
localhost doesn't always mean what you'd think it means.