diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000000000000000000000000000000000000..ec31a21e34feff9918f657915986b8394bf52ef4 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,19 @@ +# Contributing + +If you have any issues or ideas for improvement you can send me an email to _thl-cmk[at]outlook[dot]com_. + +For some fixes/improvements I migth need a _snmpwalk_ fom the device in question. +This must contain + +- .1.3.6.1.2.1.1.1 sysDescr +- .1.3.6.1.2.1.1.2 sysObjectID + +and all the SNMP OIDs used in the plugin. + +If you run the _snmpwalk_ command, please uses these options _**-ObentU**_ in addition to your snmp options like community, version etc. +For example: +``` +snmpwalk -v2c -c public -ObentU 10.10.10.10 .1.3.6.1.2.1.1.1 > hostname.snmpwalk +snmpwalk -v2c -c public -ObentU 10.10.10.10 .1.3.6.1.2.1.1.2 >> hostname.snmpwalk +snmpwalk -v2c -c public -ObentU 10.10.10.10 .1.3.6.1.4.1.9.9.147.1.2.1.1.1 >> hostname.snmpwalk +``` diff --git a/README.md b/README.md index c3738689526c362abf735a3ed98057b4df6b6537..e98aeca73b5b24b804bd03d3fa2a0b31141040d9 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,9 @@ This snmp section/parse function extends the if64 check by replacing ifDescr wit --- +#### Want to contribute? +Nice ;-) Have a look at the [contribution guidelines](CONTRIBUTING.md "Contributing") +--- Sample output | | original if64 | modifiyed if64name | diff --git a/agent_based/if64name.py b/agent_based/if64name.py index d5405eb87c094cd11d0864c2f1db168a3ce17b0d..84f89b9c5674dce7b5d28ee7d2d903c5a971d0f5 100644 --- a/agent_based/if64name.py +++ b/agent_based/if64name.py @@ -4,7 +4,14 @@ # 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. -# 2021-07-01: extended if64 to use ifNAme instead of ifDescr +# Author: thl-cmk[at]outlook[dot]com +# URL : https://thl-cmk.hopto.org +# Date : 2021-07-01 + +# extended if64 to use ifNAme instead of ifDescr +# +# 2021-0929: fixed empty interface name handling +# from typing import ( @@ -50,7 +57,7 @@ def _get_short_if_name(ifname: str) -> str: def parse_if64name(string_table: List[type_defs.StringByteTable]) -> interfaces.Section: for interface in string_table[0]: - if interface[-1] is not '': + if interface[-1] != '': interface[1] = interface[-1] # replace ifDescr with ifName (.1.3.6.1.2.1.31.1.1.1.1) interface[1] = _get_short_if_name(interface[1]) # ifDescr (.1.3.6.1.2.1.2.2.1.2) interface.pop() # remove last entry from interfaces (ifName) -> return original if64 format @@ -68,5 +75,5 @@ register.snmp_section( ), ], detect=if64.HAS_ifHCInOctets, - supersedes=['if', 'statgrab_net', 'if64'], + supersedes=['if', 'statgrab_net', 'if64', 'interfaces'], ) diff --git a/if64name.mkp b/if64name.mkp index 2f0fb20ddbea5e17ae58aaa05ecf3a6a7212af81..5fca8de45829d403b0c59c901700cbe257005add 100644 Binary files a/if64name.mkp and b/if64name.mkp differ diff --git a/packages/if64name b/packages/if64name index 3f7f08f8364f836e2a3d37e2b8710fd99538addc..e5134e580f01359690ccbad66d35b4c40bd25ccd 100644 --- a/packages/if64name +++ b/packages/if64name @@ -11,7 +11,7 @@ 'name': 'if64name', 'num_files': 1, 'title': 'ifName extension for if64', - 'version': '20210704_v0.0.1', + 'version': '20210929.v0.0.1a', 'version.min_required': '2.0.0', - 'version.packaged': '2021.04.10', + 'version.packaged': '2021.09.20', 'version.usable_until': None} \ No newline at end of file