项目作者: Ekhozie

项目描述 :
Custom munin plugins for plex and traffic monitroing
高级语言: Shell
项目地址: git://github.com/Ekhozie/munin-plugins.git
创建时间: 2021-05-18T08:35:06Z
项目社区:https://github.com/Ekhozie/munin-plugins

开源协议:GNU General Public License v3.0

下载


munin-plugins

Available plugins

Plex

Show number of playing / transcoding steams.
Use https by default.

plex

Thanks to MorbZ for the initial idea https://gist.github.com/MorbZ/e5d05856a6bdbcf4ca52c4cae21f2228.

Traffic

Show iptables traffic by port.

traffic_incoming
traffic_outgoing

You need to create iptable rules with comment, so the plugin can get the required data. Syntax for the comment is traffic_<incoming|outgoing>:<port> like this: traffic_incoming:80.
For instance:

  1. *filter
  2. [...]
  3. # add comment directly on a rule
  4. -A INPUT -p tcp --dport 80 -j ACCEPT -m comment --comment "traffic_incoming:80"
  5. -A INPUT -p tcp --dport 443 -j ACCEPT -m comment --comment "traffic_incoming:443"
  6. # or on a dedicated line
  7. -I INPUT -p tcp --dport 22 -m comment --comment "traffic_incoming:22"
  8. # also needed for outgoing traffic
  9. -I OUTPUT -p tcp --sport 22 -m comment --comment "traffic_outgoing:22"
  10. -I OUTPUT -p tcp --dport 80 -m comment --comment "traffic_outgoing:80"
  11. -I OUTPUT -p tcp --dport 443 -m comment --comment "traffic_outgoing:443"
  12. [...]
  13. COMMIT

Installation / configuration

Install plugins in folder /usr/local/munin/lib/plugins/. Link them in /etc/munin/plugins/:

  1. ln -s /usr/local/munin/lib/plugins/plex /etc/munin/plugins/plex
  2. ln -s /usr/local/munin/lib/plugins/traffic_* /etc/munin/plugins/.

Install configuration files in /etc/munin/plugin-conf.d/, and update the configuration accordingly.

Finally restart munin-node:

  1. systemctl restart munin-node

Testing

Test plugins with munin-run

  1. munin-run plex
  2. munin-run traffic_incoming
  3. munin-run traffic_outgoing