#!/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.9.1.1.1 1 --> IB-PLATFORMONE-MIB::ibServiceName.dhcp
# .1.3.6.1.4.1.7779.3.1.1.2.1.9.1.1.2 2 --> IB-PLATFORMONE-MIB::ibServiceName.dns
# .1.3.6.1.4.1.7779.3.1.1.2.1.9.1.1.3 3 --> IB-PLATFORMONE-MIB::ibServiceName.ntp
# .1.3.6.1.4.1.7779.3.1.1.2.1.9.1.1.4 4 --> IB-PLATFORMONE-MIB::ibServiceName.tftp
# .1.3.6.1.4.1.7779.3.1.1.2.1.9.1.1.5 5 --> IB-PLATFORMONE-MIB::ibServiceName.http-file-dist
# .1.3.6.1.4.1.7779.3.1.1.2.1.9.1.1.6 6 --> IB-PLATFORMONE-MIB::ibServiceName.ftp
# .1.3.6.1.4.1.7779.3.1.1.2.1.9.1.1.7 7 --> IB-PLATFORMONE-MIB::ibServiceName.bloxtools-move
# .1.3.6.1.4.1.7779.3.1.1.2.1.9.1.1.8 8 --> IB-PLATFORMONE-MIB::ibServiceName.bloxtools
# .1.3.6.1.4.1.7779.3.1.1.2.1.9.1.2.1 4 --> IB-PLATFORMONE-MIB::ibServiceStatus.dhcp
# .1.3.6.1.4.1.7779.3.1.1.2.1.9.1.2.2 4 --> IB-PLATFORMONE-MIB::ibServiceStatus.dns
# .1.3.6.1.4.1.7779.3.1.1.2.1.9.1.2.3 1 --> IB-PLATFORMONE-MIB::ibServiceStatus.ntp
# .1.3.6.1.4.1.7779.3.1.1.2.1.9.1.2.4 4 --> IB-PLATFORMONE-MIB::ibServiceStatus.tftp
# .1.3.6.1.4.1.7779.3.1.1.2.1.9.1.2.5 4 --> IB-PLATFORMONE-MIB::ibServiceStatus.http-file-dist
# .1.3.6.1.4.1.7779.3.1.1.2.1.9.1.2.6 4 --> IB-PLATFORMONE-MIB::ibServiceStatus.ftp
# .1.3.6.1.4.1.7779.3.1.1.2.1.9.1.2.7 5 --> IB-PLATFORMONE-MIB::ibServiceStatus.bloxtools-move
# .1.3.6.1.4.1.7779.3.1.1.2.1.9.1.2.8 4 --> IB-PLATFORMONE-MIB::ibServiceStatus.bloxtools
# .1.3.6.1.4.1.7779.3.1.1.2.1.9.1.3.1 DHCP Service is inactive --> IB-PLATFORMONE-MIB::ibServiceDesc.dhcp
# .1.3.6.1.4.1.7779.3.1.1.2.1.9.1.3.2 DNS Service is inactive --> IB-PLATFORMONE-MIB::ibServiceDesc.dns
# .1.3.6.1.4.1.7779.3.1.1.2.1.9.1.3.3 NTP Service is working --> IB-PLATFORMONE-MIB::ibServiceDesc.ntp
# .1.3.6.1.4.1.7779.3.1.1.2.1.9.1.3.4 Hard Disk: 0% - TFTP Service is inactive --> IB-PLATFORMONE-MIB::ibServiceDesc.tftp
# .1.3.6.1.4.1.7779.3.1.1.2.1.9.1.3.5 Hard Disk: 0% - HTTP File Dist Service is inactive --> IB-PLATFORMONE-MIB::ibServiceDesc.http-file-dist
# .1.3.6.1.4.1.7779.3.1.1.2.1.9.1.3.6 Hard Disk: 0% - FTP Service is inactive --> IB-PLATFORMONE-MIB::ibServiceDesc.ftp
# .1.3.6.1.4.1.7779.3.1.1.2.1.9.1.3.7 --> IB-PLATFORMONE-MIB::ibServiceDesc.bloxtools-move
# .1.3.6.1.4.1.7779.3.1.1.2.1.9.1.3.8 CPU: 100%, Memory: 0%, Hard Disk: 0% - --> IB-PLATFORMONE-MIB::ibServiceDesc.bloxtools


check_info['infoblox_services'] = {
    'parse_function'            : parse_infoblox_services,
    'inventory_function'        : inventory_infoblox_services,
    'check_function'            : check_infoblox_services,
    'service_description'       : 'Service %s',
    'snmp_info'                 : (".1.3.6.1.4.1.7779.3.1.1.2.1.9.1", [
                                        "1",    # IB-PLATFORMONE-MIB::ibServiceName
                                        "2",    # IB-PLATFORMONE-MIB::ibServiceStatus
                                        "3",    # IB-PLATFORMONE-MIB::ibServiceDesc
                                  ]),
    'snmp_scan_function'        : scan_infoblox,
    'includes'                  : [ "infoblox.include" ],
}
