mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-09-19 17:13:21 +00:00
added graph for netfilter ipset
This commit is contained in:
parent
b0d1f5b595
commit
d4b97724e2
1 changed files with 25 additions and 0 deletions
25
plugins/network/ipset
Normal file
25
plugins/network/ipset
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
#!/bin/bash
|
||||||
|
#Graph number of members of netfilter ipsets
|
||||||
|
#(c) Tomas Mudrunka 2016
|
||||||
|
#
|
||||||
|
#Add this line to sudoers:
|
||||||
|
#ALL ALL = (root) NOPASSWD: /sbin/ipset list [!-]*, /sbin/ipset list -n
|
||||||
|
|
||||||
|
|
||||||
|
[ "$1" = "config" ] && {
|
||||||
|
echo graph_title Netfilter IPSets
|
||||||
|
echo graph_category network
|
||||||
|
echo graph_vlabel Members
|
||||||
|
echo graph_args --base 1000 --logarithmic --units=si
|
||||||
|
}
|
||||||
|
|
||||||
|
sudo ipset list -n | while read list; do
|
||||||
|
[ "$1" = "config" ] && {
|
||||||
|
echo "$list.label $list"
|
||||||
|
echo "$list.min 0"
|
||||||
|
} || {
|
||||||
|
echo "$list.value $(( $(sudo ipset list $list | wc -l) - 7 ))"
|
||||||
|
}
|
||||||
|
done;
|
||||||
|
|
||||||
|
exit 0
|
Loading…
Add table
Add a link
Reference in a new issue