Skip to content
This repository was archived by the owner on Jun 12, 2024. It is now read-only.

Commit 96e3aeb

Browse files
authored
Merge pull request #8 from TYPO3-cookbooks/powerdns_stretch
[TASK] Adapt PowerDNS checks to Debian Stretch
2 parents fc7928c + b849a5d commit 96e3aeb

File tree

7 files changed

+20
-36
lines changed

7 files changed

+20
-36
lines changed

.kitchen.dokken.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,5 @@ platforms:
3535
- RUN /usr/bin/apt-get update
3636
- RUN /usr/bin/apt-get install apt-transport-https lsb-release procps net-tools -y
3737

38-
# comment this out, if Debian 7 is not needed
39-
- name: debian-7
40-
driver:
41-
image: debian:7
42-
intermediate_instructions:
43-
- RUN /usr/bin/apt-get update
44-
- RUN /usr/bin/apt-get install apt-transport-https lsb-release procps net-tools -y
45-
4638
# suites are taken from .kitchen.yml usually
4739
# suites:

.kitchen.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ provisioner:
66
name: chef_zero
77

88
platforms:
9-
- name: debian-7.11
10-
- name: debian-8.9
9+
- name: debian-8.11
10+
- name: debian-9.9
1111

1212
suites:
1313
- name: default

templates/pdns/pdns_errors

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313
# https://github.com/Rikbruggink/Zabbix-templates
1414
# rev 5098005dfd70d91c4f11195f26f5166e981cc24f
1515

16-
command="/etc/init.d/pdns dump"
16+
command="/usr/bin/pdns_control list"
1717

18-
if [ "$1" = "autoconf" ]; then
18+
if [[ "$1" = "autoconf" ]]; then
1919
echo yes
2020
exit 0
2121
fi
2222

23-
if [ "$1" = "config" ]; then
23+
if [[ "$1" = "config" ]]; then
2424
echo 'graph_title Power DNS errors'
2525
echo 'graph_args -l 0 --base 1000'
2626
echo 'graph_vlabel numbers of'
@@ -41,5 +41,4 @@ if [ "$1" = "config" ]; then
4141
exit 0
4242
fi
4343

44-
45-
$command | sed 's/=\([0-9]\+\),/.value \1\n/g' | grep corrupt'\|'servfail'\|'timedout | sed 's/-/_/g'
44+
${command} | sed 's/=\([0-9]\+\),/.value \1\n/g' | grep corrupt'\|'servfail'\|'timedout | sed 's/-/_/g'

templates/pdns/pdns_latency

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313
# https://github.com/Rikbruggink/Zabbix-templates
1414
# rev 5098005dfd70d91c4f11195f26f5166e981cc24f
1515

16-
command="/etc/init.d/pdns show"
16+
command="/usr/bin/pdns_control show"
1717

18-
if [ "$1" = "autoconf" ]; then
18+
if [[ "$1" = "autoconf" ]]; then
1919
echo yes
2020
exit 0
2121
fi
2222

23-
if [ "$1" = "config" ]; then
23+
if [[ "$1" = "config" ]]; then
2424
echo 'graph_title Power DNS latency'
2525
echo 'graph_args -l 0'
2626
echo 'graph_vlabel usec'
@@ -32,7 +32,4 @@ if [ "$1" = "config" ]; then
3232
exit 0
3333
fi
3434

35-
36-
37-
38-
echo "latency.value $($command latency | awk -F= '{print $2}')"
35+
echo "latency.value $(${command} latency | awk -F= '{print $2}')"

templates/pdns/pdns_qsize

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313
# https://github.com/Rikbruggink/Zabbix-templates
1414
# rev 5098005dfd70d91c4f11195f26f5166e981cc24f
1515

16-
command="/etc/init.d/pdns show"
16+
command="/usr/bin/pdns_control show"
1717

18-
if [ "$1" = "autoconf" ]; then
18+
if [[ "$1" = "autoconf" ]]; then
1919
echo yes
2020
exit 0
2121
fi
2222

23-
if [ "$1" = "config" ]; then
23+
if [[ "$1" = "config" ]]; then
2424
echo 'graph_title Power DNS database queue'
2525
echo 'graph_args -l 0'
2626
echo 'graph_vlabel number of waiting queries'
@@ -32,8 +32,5 @@ if [ "$1" = "config" ]; then
3232
exit 0
3333
fi
3434

35-
36-
37-
38-
echo "qsize.value $($command qsize_q | awk -F= '{print $2}')"
35+
echo "qsize.value $(${command} qsize-q)"
3936

templates/pdns/pdns_queries

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313
# https://github.com/Rikbruggink/Zabbix-templates
1414
# rev 5098005dfd70d91c4f11195f26f5166e981cc24f
1515

16-
command="/etc/init.d/pdns dump"
16+
command="/usr/bin/pdns_control list"
1717

18-
if [ "$1" = "autoconf" ]; then
18+
if [[ "$1" = "autoconf" ]]; then
1919
echo yes
2020
exit 0
2121
fi
2222

23-
if [ "$1" = "config" ]; then
23+
if [[ "$1" = "config" ]]; then
2424
echo 'graph_title Power DNS queries'
2525
echo 'graph_args -l 0 --base 1000'
2626
echo 'graph_vlabel numbers of'
@@ -53,5 +53,4 @@ if [ "$1" = "config" ]; then
5353
exit 0
5454
fi
5555

56-
57-
$command | sed 's/=\([0-9]\+\),/.value \1\n/g' | grep udp-'\|'recursing'\|'tcp | sed 's/-/_/g'
56+
${command} | sed 's/=\([0-9]\+\),/.value \1\n/g' | grep udp-'\|'recursing'\|'tcp | sed 's/-/_/g'

templates/pdns/zabbix.conf.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ UserParameter=custom.pdns_qsize.qsize, sudo <%= node[:zabbix][:external_dir] %>/
1616

1717
UserParameter=custom.pdns_queries.recursing_answers, sudo <%= node[:zabbix][:external_dir] %>/pdns_queries|grep 'recursing_answers'|cut -f2 -d" "
1818
UserParameter=custom.pdns_queries.recursing_questions, sudo <%= node[:zabbix][:external_dir] %>/pdns_queries|grep 'recursing_questions'|cut -f2 -d" "
19-
UserParameter=custom.pdns_queries.tcp_answers, sudo <%= node[:zabbix][:external_dir] %>/pdns_queries|grep 'tcp_answers'|cut -f2 -d" "
19+
UserParameter=custom.pdns_queries.tcp_answers, sudo <%= node[:zabbix][:external_dir] %>/pdns_queries|grep 'tcp_answers.value'|cut -f2 -d" "
2020
UserParameter=custom.pdns_queries.tcp_queries, sudo <%= node[:zabbix][:external_dir] %>/pdns_queries|grep 'tcp_queries'|cut -f2 -d" "
21-
UserParameter=custom.pdns_queries.udp_answers, sudo <%= node[:zabbix][:external_dir] %>/pdns_queries|grep 'udp_answers'|cut -f2 -d" "
21+
UserParameter=custom.pdns_queries.udp_answers, sudo <%= node[:zabbix][:external_dir] %>/pdns_queries|grep 'udp_answers.value'|cut -f2 -d" "
2222
UserParameter=custom.pdns_queries.udp_queries, sudo <%= node[:zabbix][:external_dir] %>/pdns_queries|grep 'udp_queries'|cut -f2 -d" "
2323

0 commit comments

Comments
 (0)