#!/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.

#definitions:
# cmp', '(obp-device = pyhsical CPU's
# core', '(core      = cores
# cpu', '(cpu        = thread


def inv_solaris_prtpicl(info):
    node = inv_tree("hardware.cpu.")
    cmp_no = 0
    core_no = 0
    cpu_no = 0
    for line in info:
        if line[0] == "cmp":
            cmp_no += 1
        elif line[0] == "core":
            core_no += 1
        elif line[0] == "cpu":
            cpu_no += 1

    node["cpus"] = cmp_no
    node["cores"] = core_no
    node["threads"] = cpu_no


inv_info['solaris_prtpicl'] = {
    "inv_function": inv_solaris_prtpicl,
}
