Fichiers MIB à convertir (Zabbix)

Tags: #<Tag:0x00007f2c9544fac0>

Bonjour,

Je souhaterais un coups de main pour la mise en place du SNMP d’un équipement ASUSTOR sur Zabbix.
Dans la documentation d’ASUSTOR, il charge les fichiers pour ne former qu’un fichier, ce que j’arrive pas à faire.

Auriez-vous une solution ?

Script de conversion (Incomplet)

#!/usr/bin/bash

########################################################################
#  CONSOLE #
############
clear;

########################################################################
#  VARIABLES #
#############
TOOL="/root/.snmp/mibs/mib2zabbix"
DOSSIER="/mnt/Media_5/asustor_mib/"
OID1=".1.3.6.1.4.1.44738.1"
OID2=".1.3.6.1.4.1.44738.4"
OID3=".1.3.6.1.4.1.44738.6"

##############################################################################################################
# Read #
########
snmptranslate -Tz -m ${DOSSIER}/ASUSTOR-DISK-MIB.txt;
snmptranslate -Tz -m ${DOSSIER}/ASUSTOR-SYSTEM-MIB.txt;
snmptranslate -Tz -m ${DOSSIER}/ASUSTOR-UPS-MIB.txt;

##############################################################################################################
# Conversion - Experimental #
###########################
snmptranslate -Tz -m ${DOSSIER}/ASUSTOR-DISK-MIB.txt    | ${TOOL} -o ${OID1} ${DOSSIER}/ASUSTOR-DISK-MIB.xml;
snmptranslate -Tz -m ${DOSSIER}/ASUSTOR-SYSTEM-MIB.txt  | ${TOOL} -o ${OID2} ${DOSSIER}/ASUSTOR-SYSTEM-MIB.xml;
snmptranslate -Tz -m ${DOSSIER}/ASUSTOR-UPS-MIB.txt     | ${TOOL} -o ${OID3} ${DOSSIER}/ASUSTOR-UPS-MIB.xml;
##############################################################################################################

ASUSTOR-DISK-MIB.txt

Expected LAST-UPDATED (ORGANIZATION): At line 13 in /mnt/Media_5/asustor_mib/ASUSTOR-DISK-MIB.txt
Expected LAST-UPDATED (ORGANIZATION): At line 114 in /mnt/Media_5/asustor_mib/ASUSTOR-DISK-MIB.txt
"org"                   "1.3"
"dod"                   "1.3.6"
"internet"                      "1.3.6.1"
"directory"                     "1.3.6.1.1"
"mgmt"                  "1.3.6.1.2"
"mib-2"                 "1.3.6.1.2.1"
"transmission"                  "1.3.6.1.2.1.10"
"experimental"                  "1.3.6.1.3"
"private"                       "1.3.6.1.4"
"enterprises"                   "1.3.6.1.4.1"
"asustor"                       "1.3.6.1.4.1.44738"
"asustorDisk"                   "1.3.6.1.4.1.44738.4"
"diskTable"                     "1.3.6.1.4.1.44738.4.1"
"diskEntry"                     "1.3.6.1.4.1.44738.4.1.1"
"diskIndex"                     "1.3.6.1.4.1.44738.4.1.1.1"
"diskID"                        "1.3.6.1.4.1.44738.4.1.1.2"
"diskModel"                     "1.3.6.1.4.1.44738.4.1.1.3"
"diskType"                      "1.3.6.1.4.1.44738.4.1.1.4"
"diskStatus"                    "1.3.6.1.4.1.44738.4.1.1.5"
"diskTemperature"                       "1.3.6.1.4.1.44738.4.1.1.6"
"diskSize"                      "1.3.6.1.4.1.44738.4.1.1.7"
"diskConformances"                      "1.3.6.1.4.1.44738.4.2"
"diskCompliances"                       "1.3.6.1.4.1.44738.4.2.1"
"diskCompliance"                        "1.3.6.1.4.1.44738.4.2.1.1"
"diskGroups"                    "1.3.6.1.4.1.44738.4.2.2"
"diskGroup"                     "1.3.6.1.4.1.44738.4.2.2.1"
"asustorVolume"                 "1.3.6.1.4.1.44738.5"
"volumeTable"                   "1.3.6.1.4.1.44738.5.1"
"volumeEntry"                   "1.3.6.1.4.1.44738.5.1.1"
"volumeIndex"                   "1.3.6.1.4.1.44738.5.1.1.1"
"volumeName"                    "1.3.6.1.4.1.44738.5.1.1.2"
"volumeLevel"                   "1.3.6.1.4.1.44738.5.1.1.3"
"volumeStatus"                  "1.3.6.1.4.1.44738.5.1.1.4"
"volumeFileSystem"                      "1.3.6.1.4.1.44738.5.1.1.5"
"volumeTotalSize"                       "1.3.6.1.4.1.44738.5.1.1.6"
"volumeFreeSize"                        "1.3.6.1.4.1.44738.5.1.1.7"
"security"                      "1.3.6.1.5"
"snmpV2"                        "1.3.6.1.6"
"snmpDomains"                   "1.3.6.1.6.1"
"snmpProxys"                    "1.3.6.1.6.2"
"snmpModules"                   "1.3.6.1.6.3"
"zeroDotZero"                   "0.0"

-------------------------------
Conversion:
Expected LAST-UPDATED (ORGANIZATION): At line 13 in /mnt/Media_5/asustor_mib//ASUSTOR-DISK-MIB.txt
Expected LAST-UPDATED (ORGANIZATION): At line 114 in /mnt/Media_5/asustor_mib//ASUSTOR-DISK-MIB.txt
Smartmatch is experimental at /root/.snmp/mibs/mib2zabbix line 475.
OID .1.3.6.1.4.1.44738.1 not found in MIB tree.

ASUSTOR-SYSTEM-MIB.txt

Expected LAST-UPDATED (ORGANIZATION): At line 12 in /mnt/Media_5/asustor_mib/ASUSTOR-SYSTEM-MIB.txt
"org"                   "1.3"
"dod"                   "1.3.6"
"internet"                      "1.3.6.1"
"directory"                     "1.3.6.1.1"
"mgmt"                  "1.3.6.1.2"
"mib-2"                 "1.3.6.1.2.1"
"transmission"                  "1.3.6.1.2.1.10"
"experimental"                  "1.3.6.1.3"
"private"                       "1.3.6.1.4"
"enterprises"                   "1.3.6.1.4.1"
"asustor"                       "1.3.6.1.4.1.44738"
"asustorSystem"                 "1.3.6.1.4.1.44738.1"
"sysSerialNumber"                       "1.3.6.1.4.1.44738.1.1"
"sysADMVersion"                 "1.3.6.1.4.1.44738.1.2"
"sysBiosVersion"                        "1.3.6.1.4.1.44738.1.3"
"sysUptime"                     "1.3.6.1.4.1.44738.1.4"
"syssysTime"                    "1.3.6.1.4.1.44738.1.5"
"sysTimeZone"                   "1.3.6.1.4.1.44738.1.6"
"sysUpgradeAvailable"                   "1.3.6.1.4.1.44738.1.7"
"sysAsustorID"                  "1.3.6.1.4.1.44738.1.8"
"systemConformances"                    "1.3.6.1.4.1.44738.1.9"
"systemCompliances"                     "1.3.6.1.4.1.44738.1.9.1"
"systemCompliance"                      "1.3.6.1.4.1.44738.1.9.1.1"
"systemGroups"                  "1.3.6.1.4.1.44738.1.9.2"
"systemGroup"                   "1.3.6.1.4.1.44738.1.9.2.1"
"asustorHardware"                       "1.3.6.1.4.1.44738.2"
"hwmodelName"                   "1.3.6.1.4.1.44738.2.1"
"hwprocessor"                   "1.3.6.1.4.1.44738.2.2"
"hwCPUUsage"                    "1.3.6.1.4.1.44738.2.3"
"hwcpuTable"                    "1.3.6.1.4.1.44738.2.3.1"
"cpuEntry"                      "1.3.6.1.4.1.44738.2.3.1.1"
"cpuIndex"                      "1.3.6.1.4.1.44738.2.3.1.1.1"
"cpuUsage"                      "1.3.6.1.4.1.44738.2.3.1.1.2"
"hwFanSpeed"                    "1.3.6.1.4.1.44738.2.4"
"hwfanTable"                    "1.3.6.1.4.1.44738.2.4.1"
"fanEntry"                      "1.3.6.1.4.1.44738.2.4.1.1"
"fanIndex"                      "1.3.6.1.4.1.44738.2.4.1.1.1"
"fanSpeed"                      "1.3.6.1.4.1.44738.2.4.1.1.2"
"hwCPUTemperature"                      "1.3.6.1.4.1.44738.2.5"
"hwSysTemperature"                      "1.3.6.1.4.1.44738.2.6"
"hwTotalMem"                    "1.3.6.1.4.1.44738.2.7"
"hwFreeMem"                     "1.3.6.1.4.1.44738.2.8"
"hwFreeMemPercentage"                   "1.3.6.1.4.1.44738.2.9"
"asustorNetwork"                        "1.3.6.1.4.1.44738.3"
"netTable"                      "1.3.6.1.4.1.44738.3.1"
"netEntry"                      "1.3.6.1.4.1.44738.3.1.1"
"netIndex"                      "1.3.6.1.4.1.44738.3.1.1.1"
"netInterface"                  "1.3.6.1.4.1.44738.3.1.1.2"
"netMacAddress"                 "1.3.6.1.4.1.44738.3.1.1.3"
"netIPv4Address"                        "1.3.6.1.4.1.44738.3.1.1.4"
"netIPv6Address"                        "1.3.6.1.4.1.44738.3.1.1.5"
"netPacketSent"                 "1.3.6.1.4.1.44738.3.1.1.6"
"netPacketReceived"                     "1.3.6.1.4.1.44738.3.1.1.7"
"security"                      "1.3.6.1.5"
"snmpV2"                        "1.3.6.1.6"
"snmpDomains"                   "1.3.6.1.6.1"
"snmpProxys"                    "1.3.6.1.6.2"
"snmpModules"                   "1.3.6.1.6.3"
"zeroDotZero"                   "0.0"
-------------------------------
Conversion:
Expected LAST-UPDATED (ORGANIZATION): At line 12 in /mnt/Media_5/asustor_mib//ASUSTOR-SYSTEM-MIB.txt
Smartmatch is experimental at /root/.snmp/mibs/mib2zabbix line 475.
OID .1.3.6.1.4.1.44738.4 not found in MIB tree.

ASUSTOR-UPS-MIB.txt

"org"                   "1.3"
"dod"                   "1.3.6"
"internet"                      "1.3.6.1"
"directory"                     "1.3.6.1.1"
"mgmt"                  "1.3.6.1.2"
"mib-2"                 "1.3.6.1.2.1"
"transmission"                  "1.3.6.1.2.1.10"
"experimental"                  "1.3.6.1.3"
"private"                       "1.3.6.1.4"
"enterprises"                   "1.3.6.1.4.1"
"asustor"                       "1.3.6.1.4.1.44738"
"asustorUps"                    "1.3.6.1.4.1.44738.6"
"upsTable"                      "1.3.6.1.4.1.44738.6.1"
"upsEntry"                      "1.3.6.1.4.1.44738.6.1.1"
"upsIndex"                      "1.3.6.1.4.1.44738.6.1.1.1"
"upsManufacture"                        "1.3.6.1.4.1.44738.6.1.1.2"
"upsModel"                      "1.3.6.1.4.1.44738.6.1.1.3"
"upsVendorId"                   "1.3.6.1.4.1.44738.6.1.1.4"
"upsProductId"                  "1.3.6.1.4.1.44738.6.1.1.5"
"upsBatteryRemainSecond"                        "1.3.6.1.4.1.44738.6.1.1.6"
"upsBatteryChargePercent"                       "1.3.6.1.4.1.44738.6.1.1.7"
"upsConformances"                       "1.3.6.1.4.1.44738.6.2"
"upsCompliances"                        "1.3.6.1.4.1.44738.6.2.1"
"upsCompliance"                 "1.3.6.1.4.1.44738.6.2.1.1"
"upsGroups"                     "1.3.6.1.4.1.44738.6.2.2"
"upsGroup"                      "1.3.6.1.4.1.44738.6.2.2.1"
"security"                      "1.3.6.1.5"
"snmpV2"                        "1.3.6.1.6"
"snmpDomains"                   "1.3.6.1.6.1"
"snmpProxys"                    "1.3.6.1.6.2"
"snmpModules"                   "1.3.6.1.6.3"
"zeroDotZero"                   "0.0"
-------------------------------
Conversion:
snmptranslate -Tz -m ${DOSSIER}/ASUSTOR-UPS-MIB.txt     | ${TOOL} -o ${OID3} ${DOSSIER}/ASUSTOR-UPS-MIB.xml;
Expected LAST-UPDATED (ORGANIZATION): At line 13 in /mnt/Media_5/asustor_mib//ASUSTOR-UPS-MIB.txt
Smartmatch is experimental at /root/.snmp/mibs/mib2zabbix line 475.
OID .1.3.6.1.4.1.44738.6 not found in MIB tree.

Documentation:

MIB:
ASUSTOR-SYSTEM-MIB.txt (8,2 Ko)
ASUSTOR-UPS-MIB.txt (3,0 Ko)
ASUSTOR-DISK-MIB.txt (5,4 Ko)

Je sais pas ce que tu cherches à faire exactement mais te casse pas la tête et regarde pour utiliser simplement ce template et active/désactive ce que tu veux :wink:

N’oublie pas de sécuriser le snmp si ton NAS est accessible depuis l’extérieur :wink: