def test_that_fail2ban_is_running_on(node):
with settings(
hide('stdout', 'running'),
host_string=node.host_string,
private_key_filename=node.private_key
):
print(" running on %s" % node.host_string)
cmd = sudo('COLUMNS=1000 ps -edalf | grep fail2ban | grep -v grep ')
try:
assert 'fail2ban' in cmd.stdout
except Exception as detail:
raise Exception("%s %s" % (cmd.stdout, detail))
cmd = sudo('systemctl is-active fail2ban')
try:
assert 'active' in cmd.stdout
except Exception as detail:
raise Exception("%s %s" % (cmd.stdout, detail))
评论列表
文章目录