# -*- coding: UTF-8 -*-
"""
Surveillance du service Dansguardian (instance 3)
"""
from zephir.monitor.agentmanager.config import ACTIVER_SQUID2, CONTAINER_IP_PROXY, \
        ADRESSE_IP_SERVICE_PROXY, NOM_MACHINE_PROXY, \
        INTERFACE_PROXY, ACTIVER_FILTRAGE_PROXY

INSTANCE=3
PORT=1340 + INSTANCE - 1

if ACTIVER_SQUID2 and ACTIVER_FILTRAGE_PROXY:
    prct_name = 'e2guardian'
    test = '%s:%s' % (ADRESSE_IP_SERVICE_PROXY[0], PORT)
    desc1 = 'Filtrage web (instance 3) sur %s' % NOM_MACHINE_PROXY
    desc2 = 'eth' + INTERFACE_PROXY
    from zephir.monitor.agents.services import TCPServices
    AGENTS.append(TCPServices('dans3', {test:desc1}, period=115, container_ip=CONTAINER_IP_PROXY,
                  description="Etat du service {0} (instance 3) sur {1}".format(prct_name, desc2)))
