#!/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_bdt_tape_info(info):
    return [(None, None)]


def check_bdt_tape_info(_no_item, _no_params, info):
    for name, value in zip(["Name", "Description", "Vendor", "Agent Version"], info[0]):
        yield 0, "%s: %s" % (name, value)


check_info["bdt_tape_info"] = {
    "inventory_function": inventory_bdt_tape_info,
    "check_function": check_bdt_tape_info,
    "service_description": "Tape Library Info",
    "snmp_scan_function": lambda oid: (
        ".1.3.6.1.4.1.20884.10893.2.101" in oid(".1.3.6.1.2.1.1.2.0")
    ),
    "snmp_info": (
        ".1.3.6.1.4.1.20884.10893.2.101.1",
        [
            "1",  # bDTDisplayName
            "2",  # bDTDescription
            "3",  # bDTAgentVendor
            "4",  # bDTAgentVersion
        ],
    ),
}
