# Path: collectors/etc/docker_conf.py
# def enabled():
# def get_config():
# 
# Path: collectors/lib/utils.py
# PY3 = sys.version_info[0] > 2
# USER = "nobody"
# def drop_privileges(user=USER):
# def is_sockfile(path):
# def err(msg):
#     def is_numeric(value):
#     def is_numeric(value):


import os
import re
import socket
import sys
import time
import json
from collectors.etc import docker_conf
from collectors.lib import utils
                            tags = "type=%s" % subcategory
                            if subcattype != None:
                              tags += " subtype=%s" % subcattype
                            datatosend = "%s %d %s %s" % (category, ts, value, tags)
                        else:
                            datatosend = "%s.%s %d %s" % (category, subcategory, ts, value)
                        senddata(datatosend, containerid)
            # proc_names_to_agg
            else:
                if (file_stat in proc_names_to_agg.keys()):
                    for field_to_match in proc_names_to_agg[file_stat]:
                        datatosend = None
                        f_stat.seek(0)
                        count = 0
                        for line in f_stat:
                            fields = line.split()
                            if fields[1] == field_to_match:
                                datatosend = "%s.%s" % (file_stat, fields[1].lower())
                                try:
                                    count += int(fields[2])
                                except:
                                    pass
                        if datatosend:
                            senddata("%s %d %s" % (datatosend, ts, count), containerid)
            f_stat.close()

def main():
    """docker_cpu main loop"""
    global containernames
    global containerimages

# Path: collectors/etc/docker_conf.py
# def enabled():
# def get_config():
# 
# Path: collectors/lib/utils.py
# PY3 = sys.version_info[0] > 2
# USER = "nobody"
# def drop_privileges(user=USER):
# def is_sockfile(path):
# def err(msg):
#     def is_numeric(value):
#     def is_numeric(value):


# Path: collectors/0/docker.py
import os
import re
import socket
import sys
import time
import json
from collectors.etc import docker_conf
from collectors.lib import utils

                            tags = "type=%s" % subcategory
                            if subcattype != None:
                              tags += " subtype=%s" % subcattype
                            datatosend = "%s %d %s %s" % (category, ts, value, tags)
                        else:
                            datatosend = "%s.%s %d %s" % (category, subcategory, ts, value)
                        senddata(datatosend, containerid)
            # proc_names_to_agg
            else:
                if (file_stat in proc_names_to_agg.keys()):
                    for field_to_match in proc_names_to_agg[file_stat]:
                        datatosend = None
                        f_stat.seek(0)
                        count = 0
                        for line in f_stat:
                            fields = line.split()
                            if fields[1] == field_to_match:
                                datatosend = "%s.%s" % (file_stat, fields[1].lower())
                                try:
                                    count += int(fields[2])
                                except:
                                    pass
                        if datatosend:
                            senddata("%s %d %s" % (datatosend, ts, count), containerid)
            f_stat.close()

def main():
    """docker_cpu main loop"""
    global containernames
    global containerimages

    utils.drop_privileges()