File tree Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ "plugin" : " custom" ,
3
+ "pluginConfig" : {
4
+ "invoke_interval" : " 30s" ,
5
+ "timeout" : " 5s" ,
6
+ "max_output_length" : 80 ,
7
+ "concurrency" : 3
8
+ },
9
+ "source" : " network-custom-plugin-monitor" ,
10
+ "conditions" : [],
11
+ "rules" : [
12
+ {
13
+ "type" : " temporary" ,
14
+ "reason" : " ConntrackFull" ,
15
+ "path" : " ./config/plugin/network_problem.sh" ,
16
+ "timeout" : " 3s"
17
+ }
18
+ ]
19
+ }
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # This plugin checks for common network issues. Currently, it only checks
4
+ # if the conntrack table is full.
5
+
6
+ OK=0
7
+ NONOK=1
8
+ UNKNOWN=2
9
+
10
+ [ -f /proc/sys/net/ipv4/netfilter/ip_conntrack_max ] || echo $UNKNOWN
11
+ [ -f /proc/sys/net/ipv4/netfilter/ip_conntrack_count ] || echo $UNKNOWN
12
+
13
+ conntrack_max=$( cat /proc/sys/net/ipv4/netfilter/ip_conntrack_max)
14
+ conntrack_count=$( cat /proc/sys/net/ipv4/netfilter/ip_conntrack_count)
15
+
16
+ if (( conntrack_count >= conntrack_max )) ; then
17
+ echo " Conntrack table full"
18
+ exit $NONOK
19
+ fi
20
+
21
+ echo " Conntrack table available"
22
+ exit $OK
23
+
You can’t perform that action at this time.
0 commit comments