#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2019 tribe29 GmbH - License: GNU General Public License v2
# This file is part of Checkmk (https://checkmk.com). It is subject to the terms and
# conditions defined in the file COPYING, which is part of this source code package.


def inventory_tsm_paths(info):
    return [(None, None)]


def check_tsm_paths(item, _no_params, info):
    count_pathes = len(info)
    error_paths = [x[1] for x in info if x[2] != "YES"]
    if len(error_paths) > 0:
        return 2, "Paths with errors: %s" % ", ".join(error_paths)
    return 0, " %d paths OK" % count_pathes


check_info["tsm_paths"] = {
    "check_function": check_tsm_paths,
    "inventory_function": inventory_tsm_paths,
    "service_description": "TSM Paths",
}
