#!/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 inv_solaris_uname(info):
    solaris_uname = {}
    node = inv_tree("software.os.")
    for key, value in info:
        solaris_uname[key.strip()] = value.strip()
    node["vendor"] = "Oracle"
    node["type"] = solaris_uname["System"]
    node["version"] = solaris_uname["Release"]
    node["name"] = "%s %s" % (solaris_uname["System"], solaris_uname["Release"])
    node["kernel_version"] = solaris_uname["KernelID"]
    node["hostname"] = solaris_uname["Node"]


inv_info["solaris_uname"] = {
    "inv_function": inv_solaris_uname,
}
