Set version to 1.5.0b9
[check_mk.git] / inventory / aix_packages
blob7552626cef2d7fbde84c8ece7e9ee3085529d082
1 #!/usr/bin/python
2 # -*- encoding: utf-8; py-indent-offset: 4 -*-
3 # +------------------------------------------------------------------+
4 # | ____ _ _ __ __ _ __ |
5 # | / ___| |__ ___ ___| | __ | \/ | |/ / |
6 # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
7 # | | |___| | | | __/ (__| < | | | | . \ |
8 # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
9 # | |
10 # | Copyright Mathias Kettner 2013 mk@mathias-kettner.de |
11 # +------------------------------------------------------------------+
13 # This file is part of Check_MK.
14 # The official homepage is at http://mathias-kettner.de/check_mk.
16 # check_mk is free software; you can redistribute it and/or modify it
17 # under the terms of the GNU General Public License as published by
18 # the Free Software Foundation in version 2. check_mk is distributed
19 # in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
20 # out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
21 # PARTICULAR PURPOSE. See the GNU General Public License for more de-
22 # tails. You should have received a copy of the GNU General Public
23 # License along with GNU Make; see the file COPYING. If not, write
24 # to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
25 # Boston, MA 02110-1301 USA.
27 # Example output from agent:
28 # <<<aix_packages:sep(58):persist(1404743142)>>>
29 # #Package Name:Fileset:Level:State:PTF Id:Fix State:Type:Description:Destination Dir.:Uninstaller:Message Catalog:Message Set:Message Number:Parent:Automatic:EFIX Locked:Install Path:Build Date
30 # EMC:EMC.CLARiiON.aix.rte:6.0.0.3: : :C: :EMC CLARiiON AIX Support Software: : : : : : :0:0:/:
31 # EMC:EMC.CLARiiON.fcp.rte:6.0.0.3: : :C: :EMC CLARiiON FCP Support Software: : : : : : :0:0:/:
32 # ICU4C.rte:ICU4C.rte:7.1.2.0: : :C: :International Components for Unicode : : : : : : :0:0:/:1241
33 # Java5.sdk:Java5.sdk:5.0.0.500: : :C:F:Java SDK 32-bit: : : : : : :0:0:/:
34 # Java5_64.sdk:Java5_64.sdk:5.0.0.500: : :C:F:Java SDK 64-bit: : : : : : :0:0:/:
35 # Java6.sdk:Java6.sdk:6.0.0.375: : :C:F:Java SDK 32-bit: : : : : : :0:0:/:
38 def inv_aix_packages(info):
39 paclist = inv_tree_list("software.packages:")
40 headers = info[0]
41 headers[0] = headers[0].lstrip("#")
42 for line in info[1:]:
43 row = dict(zip(headers, map(lambda x: x.strip(), line)))
45 # AIX Type codes
46 # Type codes:
47 # F -- Installp Fileset
48 # P -- Product
49 # C -- Component
50 # T -- Feature
51 # R -- RPM Package
52 # E -- Interim Fix
54 if row["Type"] == "R":
55 package_type = "rpm"
56 elif row["Type"]:
57 package_type = "aix_" + row["Type"].lower()
58 else:
59 package_type = "aix"
61 entry = {
62 "name" : row["Package Name"],
63 "summary" : row["Description"],
64 "version" : row["Level"],
65 "package_type" : package_type,
67 paclist.append(entry)
70 inv_info['aix_packages'] = {
71 "inv_function" : inv_aix_packages,