Skip to content

Commit 4da2b93

Browse files
committed
Zyklisches prüfen, ob der DNS Server läuft.
1 parent 8023484 commit 4da2b93

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

check_bind_gw.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env python3
2+
3+
def check_bind9():
4+
from common import pinit
5+
6+
photon, settings = pinit('check_bind9', verbose=True)
7+
8+
status = photon.m(
9+
'testing for bind9',
10+
cmdd=dict(
11+
cmd='sudo rndc status',
12+
),
13+
critical=False
14+
)
15+
16+
if status.get('returncode') != 0:
17+
photon.m(
18+
'(re) starting bind9',
19+
cmdd=dict(
20+
cmd='sudo service bind9 start'
21+
),
22+
critical=False
23+
)
24+
else:
25+
photon.m('bind9 is running')
26+
27+
if __name__ == '__main__':
28+
check_bind9()

0 commit comments

Comments
 (0)