# 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 sys
import time
import re
import os
from collectors.lib import utils
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser
# General Public License for more details.  You should have received a copy
# of the GNU Lesser General Public License along with this program.  If not,
# see <http://www.gnu.org/licenses/>.
#
"""netfilter stats for TSDB. This collector exposes metrics from /proc/sys/net/ipv4/netfilter/*. 
   Note that the plugin also collects the setting values from this directory, as it makes
   it possible to monitor for incorrect settings, and also gives access to the value of 
   these for non-root users."""



interval = 15  # seconds

STATS = ("ip_conntrack_buckets", "ip_conntrack_checksum", "ip_conntrack_count", 
         "ip_conntrack_generic_timeout", "ip_conntrack_icmp_timeout", 
         "ip_conntrack_log_invalid", "ip_conntrack_max", "ip_conntrack_tcp_be_liberal", 
         "ip_conntrack_tcp_loose", "ip_conntrack_tcp_max_retrans", 
         "ip_conntrack_tcp_timeout_close", "ip_conntrack_tcp_timeout_close_wait", 
         "ip_conntrack_tcp_timeout_established", "ip_conntrack_tcp_timeout_fin_wait", 
         "ip_conntrack_tcp_timeout_last_ack", "ip_conntrack_tcp_timeout_max_retrans", 
         "ip_conntrack_tcp_timeout_syn_recv", "ip_conntrack_tcp_timeout_syn_sent", 
         "ip_conntrack_tcp_timeout_time_wait", "ip_conntrack_udp_timeout", 
         "ip_conntrack_udp_timeout_stream") 

basedir = "/proc/sys/net/ipv4/netfilter"

def main():
    """netfilter main loop"""


# 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/netfilter.py
import sys
import time
import re
import os
from collectors.lib import utils

# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser
# General Public License for more details.  You should have received a copy
# of the GNU Lesser General Public License along with this program.  If not,
# see <http://www.gnu.org/licenses/>.
#
"""netfilter stats for TSDB. This collector exposes metrics from /proc/sys/net/ipv4/netfilter/*. 
   Note that the plugin also collects the setting values from this directory, as it makes
   it possible to monitor for incorrect settings, and also gives access to the value of 
   these for non-root users."""



interval = 15  # seconds

STATS = ("ip_conntrack_buckets", "ip_conntrack_checksum", "ip_conntrack_count", 
         "ip_conntrack_generic_timeout", "ip_conntrack_icmp_timeout", 
         "ip_conntrack_log_invalid", "ip_conntrack_max", "ip_conntrack_tcp_be_liberal", 
         "ip_conntrack_tcp_loose", "ip_conntrack_tcp_max_retrans", 
         "ip_conntrack_tcp_timeout_close", "ip_conntrack_tcp_timeout_close_wait", 
         "ip_conntrack_tcp_timeout_established", "ip_conntrack_tcp_timeout_fin_wait", 
         "ip_conntrack_tcp_timeout_last_ack", "ip_conntrack_tcp_timeout_max_retrans", 
         "ip_conntrack_tcp_timeout_syn_recv", "ip_conntrack_tcp_timeout_syn_sent", 
         "ip_conntrack_tcp_timeout_time_wait", "ip_conntrack_udp_timeout", 
         "ip_conntrack_udp_timeout_stream") 

basedir = "/proc/sys/net/ipv4/netfilter"

def main():
    """netfilter main loop"""


    utils.drop_privileges()