Skip to content

Instantly share code, notes, and snippets.

@grammy-jiang
Last active May 2, 2020 07:08
Show Gist options
  • Save grammy-jiang/f848f8919c852d0c86f69aba247c5aa2 to your computer and use it in GitHub Desktop.
Save grammy-jiang/f848f8919c852d0c86f69aba247c5aa2 to your computer and use it in GitHub Desktop.
Munin Usage

Master Node

Install apache2 and the module fcgid, enable the module fcgid and start apache2:

sudo -- sh -c "apt update && apt install --yes apache2 libapache2-mod-fcgid && a2enmod fcgid && apache2ctl start"
foo@bar:~$ sudo -- sh -c "apache2ctl -t -D DUMP_MODULES"
Loaded Modules:
 core_module (static)
 so_module (static)
 watchdog_module (static)
 http_module (static)
 log_config_module (static)
 logio_module (static)
 version_module (static)
 unixd_module (static)
 access_compat_module (shared)
 alias_module (shared)
 auth_basic_module (shared)
 authn_core_module (shared)
 authn_file_module (shared)
 authz_core_module (shared)
 authz_host_module (shared)
 authz_user_module (shared)
 autoindex_module (shared)
 deflate_module (shared)
 dir_module (shared)
 env_module (shared)
 fcgid_module (shared)
 filter_module (shared)
 mime_module (shared)
 mpm_event_module (shared)
 negotiation_module (shared)
 reqtimeout_module (shared)
 setenvif_module (shared)
 status_module (shared)

Install munin:

sudo -- sh -c "apt install --yes munin && systemctl status munin.service"

Configure munin to communicate with other nodes:

sudo vim /etc/munin/munin.conf

Restart munin:

sudo -- sh -c "systemctl status munin.service && systemctl start munin.service"

Client Node

Install munin-node:

sudo -- sh -c "apt install --yes munin-node && systemctl status munin-node.service"

Configure munin-node to communicate with master node:

sudo vim /etc/munin/munin-node.conf

Restart munin-node:

sudo -- sh -c "systemctl status munin-node.service && systemctl start munin-node.service"

Others

Install lynx first:

sudo -- sh -c "apt update && apt install --yes lynx"

Start apache2:

foo@bar:~$ sudo -- sh -c "apache2ctl start"

Get apache2 status:

foo@bar:~$ sudo -- sh -c "apache2ctl status"
               Apache Server Status for localhost (via 127.0.0.1)

   Server Version: Apache/2.4.29 (Ubuntu) mod_fcgid/2.3.9
   Server MPM: event
   Server Built: 2020-03-13T12:26:16
     __________________________________________________________________

   Current Time: Tuesday, 21-Apr-2020 10:28:15 AEST
   Restart Time: Tuesday, 21-Apr-2020 10:22:00 AEST
   Parent Server Config. Generation: 1
   Parent Server MPM Generation: 0
   Server uptime: 6 minutes 14 seconds
   Server load: 0.88 0.37 0.24
   Total accesses: 0 - Total Traffic: 0 kB
   CPU Usage: u0 s0 cu0 cs0
   0 requests/sec - 0 B/second -
   1 requests currently being processed, 49 idle workers

   Slot PID  Stopping   Connections    Threads      Async connections
                      total accepting busy idle writing keep-alive closing
   0    2259 no       0     yes       0    25   0       0          0
   1    2260 no       0     yes       1    24   0       0          0
   Sum  2    0        0               1    49   0       0          0

_________________________W________________________..............
................................................................
......................

   Scoreboard Key:
   "_" Waiting for Connection, "S" Starting up, "R" Reading Request,
   "W" Sending Reply, "K" Keepalive (read), "D" DNS Lookup,
   "C" Closing connection, "L" Logging, "G" Gracefully finishing,
   "I" Idle cleanup of worker, "." Open slot with no current process