Licenses: Updated the list of licenses and added a PDF containing all license texts
[check_mk.git] / inventory / lnx_video
blobf097bf04956c3758ac3f16920db1a5a9be3ecb3d
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
28 # <<<lnx_video>>>
29 # 05:00.0 VGA compatible controller: Advanced Micro Devices [AMD] nee ATI Cape Verde PRO [Radeon HD 7700 Series] (prog-if 00 [VGA controller])
30 # Subsystem: Hightech Information System Ltd. Device 200b
31 # Flags: bus master, fast devsel, latency 0, IRQ 58
32 # Memory at d0000000 (64-bit, prefetchable) [size=256M]
33 # Memory at fe8c0000 (64-bit, non-prefetchable) [size=256K]
34 # I/O ports at c000 [size=256]
35 # Expansion ROM at fe8a0000 [disabled] [size=128K]
36 # Capabilities: [48] Vendor Specific Information: Len=08 <?>
37 # Capabilities: [50] Power Management version 3
38 # Capabilities: [58] Express Legacy Endpoint, MSI 00
39 # Capabilities: [a0] MSI: Enable+ Count=1/1 Maskable- 64bit+
40 # Capabilities: [100] Vendor Specific Information: ID=0001 Rev=1 Len=010 <?>
41 # Capabilities: [150] Advanced Error Reporting
42 # Capabilities: [270] #19
43 # Kernel driver in use: fglrx_pci
46 def inv_lnx_video(info):
47 node = inv_tree_list("hardware.video:")
48 array = {}
49 for line in info:
50 if len(line) > 1:
51 if re.search("VGA compatible controller", line[1]):
52 array["name"] = line[2]
53 elif line[0] == "Subsystem":
54 array["subsystem"] = line[1]
55 elif line[0] == "Kernel driver in use":
56 array["driver"] = line[1]
57 node.append(array)
60 inv_info['lnx_video'] = {
61 "inv_function": inv_lnx_video,