#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# |             ____ _               _        __  __ _  __           |
# |            / ___| |__   ___  ___| | __   |  \/  | |/ /           |
# |           | |   | '_ \ / _ \/ __| |/ /   | |\/| | ' /            |
# |           | |___| | | |  __/ (__|   <    | |  | | . \            |
# |            \____|_| |_|\___|\___|_|\_\___|_|  |_|_|\_\           |
# |                                                                  |
# | Copyright Mathias Kettner 2016             mk@mathias-kettner.de |
# +------------------------------------------------------------------+
#
# This file is part of Check_MK.
# The official homepage is at http://mathias-kettner.de/check_mk.
#
# check_mk is free software;  you can redistribute it and/or modify it
# under the  terms of the  GNU General Public License  as published by
# the Free Software Foundation in version 2.  check_mk is  distributed
# in the hope that it will be useful, but WITHOUT ANY WARRANTY;  with-
# out even the implied warranty of  MERCHANTABILITY  or  FITNESS FOR A
# PARTICULAR PURPOSE. See the  GNU General Public License for more de-
# tails. You should have  received  a copy of the  GNU  General Public
# License along with GNU Make; see the file  COPYING.  If  not,  write
# to the Free Software Foundation, Inc., 51 Franklin St,  Fifth Floor,
# Boston, MA 02110-1301 USA.


# .1.3.6.1.4.1.7779.3.1.1.2.1.10.1.1.9 9 --> IB-PLATFORMONE-MIB::ibNodeServiceName.node-status
# .1.3.6.1.4.1.7779.3.1.1.2.1.10.1.1.10 10 --> IB-PLATFORMONE-MIB::ibNodeServiceName.disk-usage
# .1.3.6.1.4.1.7779.3.1.1.2.1.10.1.1.11 11 --> IB-PLATFORMONE-MIB::ibNodeServiceName.enet-lan
# .1.3.6.1.4.1.7779.3.1.1.2.1.10.1.1.12 12 --> IB-PLATFORMONE-MIB::ibNodeServiceName.enet-lan2
# .1.3.6.1.4.1.7779.3.1.1.2.1.10.1.1.13 13 --> IB-PLATFORMONE-MIB::ibNodeServiceName.enet-ha
# .1.3.6.1.4.1.7779.3.1.1.2.1.10.1.1.14 14 --> IB-PLATFORMONE-MIB::ibNodeServiceName.enet-mgmt
# .1.3.6.1.4.1.7779.3.1.1.2.1.10.1.1.15 15 --> IB-PLATFORMONE-MIB::ibNodeServiceName.lcd
# .1.3.6.1.4.1.7779.3.1.1.2.1.10.1.2.9 1 --> IB-PLATFORMONE-MIB::ibNodeServiceStatus.node-status
# .1.3.6.1.4.1.7779.3.1.1.2.1.10.1.2.10 1 --> IB-PLATFORMONE-MIB::ibNodeServiceStatus.disk-usage
# .1.3.6.1.4.1.7779.3.1.1.2.1.10.1.2.11 1 --> IB-PLATFORMONE-MIB::ibNodeServiceStatus.enet-lan
# .1.3.6.1.4.1.7779.3.1.1.2.1.10.1.2.12 5 --> IB-PLATFORMONE-MIB::ibNodeServiceStatus.enet-lan2
# .1.3.6.1.4.1.7779.3.1.1.2.1.10.1.2.13 5 --> IB-PLATFORMONE-MIB::ibNodeServiceStatus.enet-ha
# .1.3.6.1.4.1.7779.3.1.1.2.1.10.1.2.14 1 --> IB-PLATFORMONE-MIB::ibNodeServiceStatus.enet-mgmt
# .1.3.6.1.4.1.7779.3.1.1.2.1.10.1.2.15 5 --> IB-PLATFORMONE-MIB::ibNodeServiceStatus.lcd
# .1.3.6.1.4.1.7779.3.1.1.2.1.10.1.3.9 Running --> IB-PLATFORMONE-MIB::ibNodeServiceDesc.node-status
# .1.3.6.1.4.1.7779.3.1.1.2.1.10.1.3.10 15% - Primary drive usage is OK. --> IB-PLATFORMONE-MIB::ibNodeServiceDesc.disk-usage
# .1.3.6.1.4.1.7779.3.1.1.2.1.10.1.3.11 X.X.X.X --> IB-PLATFORMONE-MIB::ibNodeServiceDesc.enet-lan
# .1.3.6.1.4.1.7779.3.1.1.2.1.10.1.3.12 --> IB-PLATFORMONE-MIB::ibNodeServiceDesc.enet-lan2
# .1.3.6.1.4.1.7779.3.1.1.2.1.10.1.3.13 --> IB-PLATFORMONE-MIB::ibNodeServiceDesc.enet-ha
# .1.3.6.1.4.1.7779.3.1.1.2.1.10.1.3.14 X.X.X.X --> IB-PLATFORMONE-MIB::ibNodeServiceDesc.enet-mgmt
# .1.3.6.1.4.1.7779.3.1.1.2.1.10.1.3.15 --> IB-PLATFORMONE-MIB::ibNodeServiceDesc.lcd


check_info['infoblox_node_services'] = {
    'parse_function'            : parse_infoblox_services,
    'inventory_function'        : inventory_infoblox_services,
    'check_function'            : check_infoblox_services,
    'service_description'       : 'Node service %s',
    'snmp_info'                 : (".1.3.6.1.4.1.7779.3.1.1.2.1.10.1", [
                                        "1",    # IB-PLATFORMONE-MIB::ibNodeServiceName
                                        "2",    # IB-PLATFORMONE-MIB::ibNodeServiceStatus
                                        "3",    # IB-PLATFORMONE-MIB::ibNodeServiceDesc
                                  ]),
    'snmp_scan_function'        : scan_infoblox,
    'includes'                  : [ "infoblox.include" ],
}
