-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcheck_unbound-ng.sh
29 lines (23 loc) · 1.29 KB
/
check_unbound-ng.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh
#######################################################################
# #
# This is a script that monitors Unbound DNS resolvers. #
# #
# The script uses unbound-control to check that Unbound is running, #
# and to display the statistics as performace data. #
# #
# #
# Version 1.0 2018-09-04 Initial release #
# #
# Licensed under the Apache License Version 2.0 #
# Written by [email protected] #
# #
#######################################################################
unboundcontrol="/usr/bin/sudo /usr/sbin/unbound-control"
$unboundcontrol -q status
if [ "$?" != 0 ]; then
echo "Unbound not running properly!"
exit 3
fi
echo "Unbound OK | " | tr -d '\n'
$unboundcontrol stats | grep -v thread | grep -v histogram | grep -v time. | sed 's/$/; /' | tr -d '\n'