Skip to content

Custom munin plugins for plex and traffic monitoring

License

Notifications You must be signed in to change notification settings

Ekhozie/munin-plugins

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

*filter

[...]

# add comment directly on a rule
-A INPUT -p tcp --dport 80 -j ACCEPT -m comment --comment "traffic_incoming:80"
-A INPUT -p tcp --dport 443 -j ACCEPT -m comment --comment "traffic_incoming:443"

# or on a dedicated line
-I INPUT  -p tcp --dport 22   -m comment --comment "traffic_incoming:22"

# also needed for outgoing traffic
-I OUTPUT -p tcp --sport 22   -m comment --comment "traffic_outgoing:22"
-I OUTPUT -p tcp --dport 80   -m comment --comment "traffic_outgoing:80"
-I OUTPUT -p tcp --dport 443  -m comment --comment "traffic_outgoing:443"

[...]

COMMIT

Installation / configuration

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

ln -s /usr/local/munin/lib/plugins/plex /etc/munin/plugins/plex
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:

systemctl restart munin-node

Testing

Test plugins with munin-run

munin-run plex
munin-run traffic_incoming
munin-run traffic_outgoing

About

Custom munin plugins for plex and traffic monitoring

Topics

Resources

License

Stars

Watchers

Forks