File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change 1515 "reason" : " ConntrackFull" ,
1616 "path" : " ./config/plugin/network_problem.sh" ,
1717 "timeout" : " 3s"
18+ },
19+ {
20+ "type" : " temporary" ,
21+ "reason" : " DNSUnreachable" ,
22+ "path" : " ./config/plugin/dns_problem.sh" ,
23+ "timeout" : " 3s"
1824 }
1925 ]
2026}
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # This plugin checks for dns network issues.
4+
5+ readonly OK=0
6+ readonly NONOK=1
7+ readonly UNKNOWN=2
8+
9+ readonly KUBERNETES_SERVICE=' kubernetes.default'
10+
11+ # Check getent command is present
12+ if ! command -v getent > /dev/null; then
13+ echo " Could not find 'getent' - require getent"
14+ exit $UNKNOWN
15+ fi
16+
17+ # Return success if a DNS lookup of the kubernetes service is successful
18+ if getent hosts " ${KUBERNETES_SERVICE} " > /dev/null; then
19+ echo " DNS lookup to ${KUBERNETES_SERVICE} is working"
20+ exit $OK
21+ else
22+ echo " DNS lookup to ${KUBERNETES_SERVICE} is not working"
23+ exit $NONOK
24+ fi
You can’t perform that action at this time.
0 commit comments