Convert mbps to mib/s — conversion of measurement units

Содержание:

Разработка субагента

Техника написания субагента подробно описана на сайте проекта
net-snmp. Кроме этого, можно рекомендовать также публикацию
Конрада Ржечутека (Konrad Rzeszutek)
NetSNMP subagent development
manual.

В данном случае мы не станем писать отдельное приложение на языке C для обслуживания OID проекта,
а сразу воспользуемся Perl-сценарием для генерации
начального шаблона кода для обработки OID. Этот сценарий имеет большое количество
опций:

$ mib2c -h
/usr/bin/mib2c    mibNode
...

Сгенерируем шаблон кода для переменной .

$ env MIBS="+OLEJ-MANAGEMENT-MIB" mib2c -c mib2c.scalar.conf currentValue
writing to currentValue.h
writing to currentValue.c
running indent on currentValue.c
running indent on currentValue.h

Конфигурационный файл mib2c.scalar.conf для
, определяющий правила генерации для скалярного
OID, можно не указывать, но тогда точные параметры создаваемого кода придётся устанавливать в
диалоговом режиме. Разработчиками утилиты подготовлено множество конфигураций для разных типов
OID, главным образом для разных представлений табличных OID:

$ cd /usr/share/snmp
$ ls -w100 mib2c*.conf
mib2c.access_functions.conf    mib2c.container.conf       mib2c.notify.conf
mib2c.array-user.conf          mib2c.create-dataset.conf  mib2c.old-api.conf
mib2c.check_values.conf        mib2c.emulation.conf       mib2c.perl.conf
...

Выполним аналогичные действия для второй переменной:

$ env MIBS="+OLEJ-MANAGEMENT-MIB" mib2c -c mib2c.scalar.conf nextStep
writing to nextStep.h
writing to nextStep.c
running indent on nextStep.c
running indent on nextStep.h

После этого в рабочем каталоге появятся файлы с шаблонами кода, отвечающего за обработку OID проекта:

$ ls *.h
common.h  currentValue.h  nextStep.h
$ ls *.c
cli.c  currentValue.c  locl.c  nextStep.c  snmp.c

Остаётся наполнить обработчики конкретной функциональностью, относящейся к
целевой задаче

Обратите внимание, что для переменной
определена только операция чтения, а для — записи (всё
в соответствии с описаниями в MIB-файле). Это потребует внесения некоторых изменений в код
сгенерированных шаблонов

MIB Browser Family Feature Set

Feature Set 
Visual MIB Browser Pro
Visual MIB Browser
Visual MIB Browser Basic
SNMPv3 User Management Wizard
Support for IPv6
Support for SNMPv1/v2
Support for SNMPv3 security
(HMAC-MD5, HMAC-SHA, SHA224, SHA256, SHA384 and SHA512 authentication; CBC-DES, 3DES, CFB128-AES-128, AES192 and AES256 privacy)
SNMPv3 Administration Framework Support for Notifications
(implements SNMP-TARGET-MIB and SNMP-NOTIFICATION-MIB)
Device centric view for managing devices organized by network
Hierarchical device specific alarm detection, filtering, presentation and management
Device alarm “short cut” to Alarm Log
Device web interface
“Plug in” component interface for user specific functionality extension
sample “Plug in” C++ project
Expression based charting and alarm detection
SNMPv3 reports detection with configurable alarm forwarding
“Ledger” style information presentation
Table pivot view
Splitter window in pivot view to pan data.
Automatically inserts Spinlock for SNMPv3 Framework Management Operations
Integrated V3 User and Notification Management
Find SNMPv3 Agent Engine ID Tool
Create default NuDesign USM Users with single button push
SNMP Proxy Forwarder Support
Snmp “Get”
Snmp “Walk”
*
Snmp “Set”
support for UTF-8 encoding for Windows-1252 character set
Easy viewing of Scalar, Table, Row and Columnar Objects
Quick Set from Get Scalar, Table, or Row Object Applets
SNMP CLI interface to the SNMP Agent
(provides for complete control over PDU fields, for example Get any object with a user provided OID)
User assignable, color coded alarm and trap priorities
Alarm Detection & Notifications through Emails or Traps
Multiple, user selectable, alarm detection algorithms
SNMP Trap / Notification Send / Receive Tool
Includes MIB Compiler (settable error tolerances)
Enhanced MIB loading (multiple user – definable MIB search directories)
Maintains a MIB Load / Unload log
Automatic resolution of MIB IMPORT dependencies.
View Module Dependencies and Predecessors
User definable MIBs groups
MIB Viewer & Editor that presents errors of MIB being loaded in a diagnostic view
MIB Component Tab view
VB and JScript capabilities (included are sample scripts implementing typical SNMP functions)
Enhanced scripting object model with access to internal components, such as the MIB compiler.
Automatically finds what MIB modules the agent implements
(of the MIB modules currently loaded into the MIB Browser)
Tests the MIB modules the agent implements
(it evaluates SNMP read / write access compliance using Get-Next / Get / Set.  Tests write operation on read-only objects.  Produces report.)
Save and Replay previous operations
Logging (alarms, received notifications, SNMP operation results):
    – to Text File
    – to Database
    – to Excel spreadsheet
Improved browsing and searching
SNMP session characteristics short cut
Create, manage and execute: queries / groups / scripts
Hyperlinking of MIB variables to source ASN.1 MIB docs
Select Browser nodes, queries, etc. as “Go to Favorites”
Select Device nodes as “Go to Favorites”
SNMP Traffic Monitor and Analyzer (capture, custom filter, decode, store & retrieve SNMPv1/v2c/v3 exchanges, including encrypted.  Display using object’s MIB names)
Support for UDP port numbers up to 65535

    *    walk up to 5 objects at a time with Visual MIB Browser Basic

Table 1. Feature Set Comparison

Loading and Unloading MIB’s

To load the MIB files in the MibBrowser use the LOAD MIB image button or select the File—> Load MIB menu item. This brings up a dialog box, which prompts you for the URL of the MIB module file you wish to load.

You can load multiple modules and choose any one of them as the current module at any time. When any MIB module is selected, the root node for that module becomes the current OID.

The loading of MIB modules is via URLs. A few MIB modules are provided in the mibs directory, i.e. RFC1213-MIB, HOST-RESOURCE-MIB, SNMPv2-MIB and SNMPv2-SMI. It may be convenient to copy your MIB module files to be loaded into the «mibs» directory.

To unload the loaded MIB select the node of the MIB Tree then click on the UNLOAD MIB image button or select the File —> UnLoad MIB menu item. This will remove the MIB Tree of the MIB unloaded.

›› Want other units?

You can do the reverse unit conversion from
kBps to MiB/s, or enter any two units below:

››
Common computer data rate conversions

MiB/s to gibibyte/secondMiB/s to kilobit/secondMiB/s to terabyte/secondMiB/s to tebibit/secondMiB/s to gigabyte/secondMiB/s to terabit/secondMiB/s to megabit/secondMiB/s to gigabit/secondMiB/s to mebibit/secondMiB/s to kibibit/second

››
Metric conversions and more

ConvertUnits.com provides an online
conversion calculator for all types of measurement units.
You can find metric conversion tables for SI units, as well
as English units, currency, and other data. Type in unit
symbols, abbreviations, or full names for units of length,
area, mass, pressure, and other types. Examples include mm,
inch, 100 kg, US fluid ounce, 6’3″, 10 stone 4, cubic cm,
metres squared, grams, moles, feet per second, and many more!

SNMP Operations

The MibBrowser allows the user to do the typical SNMP operations such as GET, GET NEXT and SET. It also allows to perform GET BULK for V2 and V3 version.

To do the GET operation, the user has to load the MIB file, select the desired node and press the «get» icon or choose the Operations —> Get from the menu bar. To fully specify an object to an SNMP agent, both the Object ID (which defines the type of object) and the instance (the specific object of the given type) need to be provided. From the MIB you get the Object ID, to which an instance needs to be added to completely identify the object of interest. For non-tabular (or scalar) objects this is simply an instance of 0 (e.g. sysDescr.0)(this need not be specified). For tabular objects the instance is defined by the MIB, and is a sequence of one or more variables.

We also need to specify the hostname and community string of the SNMP agent you’re talking to in the appropriate field.

If you want to talk to a V3 agent, then you have to choose the Version3 in the Settings dialog and also make sure that the v3 parameters are set in V3 Settings Dialog.

Automatic Device — SNMP Mapper

The ManageEngine Mibbrowser smartly loads the SNMP OID’s for various device types while performing SNMP operations for SNMP enabled devices. Auto suggestion is available for SNMP devices for all major vendors. MibBrowser is pre bundled with more than 750 device templates which maps to SNMP OID of corresponding SNMP device types.
Following options are available in the DeviceType panel of the MibBrowser :
Select the oid from suggested oid’s drop down list and carry out SNMP Operations for loaded device type.  Hence, no need to remember the SNMP OID’s and to traverse mib tree to select the node.
Reload Device type:   
To load the modified templates/device type at run time, click «reload» button. This will parse the templates, populate the latest SNMP OIDS for that device.
Import templates :
Go to MibBrowser —>Settings —> Template Settings
To import the customized templates, click «Import» Button . This will copy the templates to <ProductHome>/Templates
directory.
View templates :
Go to MibBrowser—> Settings —> Template Settings
You can view all the available templates. Select the template from the List to view the available Oids and its description.

Подключение MIB файлов

Далее необходимо добавить расшифровку OID

Выяснять где хранятся MIB файлы

1
2
3
4

net-snmp-config—snmpconfpath

etcsnmpusrsharesnmpusrlib64snmproot.snmpvarlibnet-snmp

Просматриваем лог трап сервера и находим OID s, который не поддерживаются. Например, в логе такая запись

1
2
3

14380620180203.1.3.6.1.4.1.9.9.46.2.0.2Normal»General event»10.10.12.3-ZBXTRAP10.10.12.310.10.12.3

Осуществляем поиск необходимого MIB файла на сайте Cisco.com Можно воспользоваться другим источником или скачать с моего сайта одним архивом.

На сайте находим необходимый MIB по данному OID.

Это файл – CISCO-VTP-MIB.

Загружаем все необходимые зависимости из таблицы

Таблица 1

 MIB Name   Version 1   Version 2   Dependencies
1. SNMPv2-SMI Download  | Download  | View Dependencies
2. SNMPv2-TC Download  | Download  | View Dependencies
3. SNMPv2-CONF Not Required  | Download  | View Dependencies
4. SNMPv2-MIB Download  | Download  | View Dependencies
5. CISCO-SMI Download  | Download  | View Dependencies
6. IANAifType-MIB Download  | Download  | View Dependencies
7. IF-MIB Download  | Download  | View Dependencies
8. CISCO-TC Download  | Download  | View Dependencies
9. INET-ADDRESS-MIB Download  | Download  | View Dependencies
10. SNMP-FRAMEWORK-MIB Download  | Download  | View Dependencies
11. RFC1155-SMI Non-Cisco MIB  | Non-Cisco MIB  |
12. RFC-1212 Non-Cisco MIB  | Non-Cisco MIB  |
13. RFC-1215 Non-Cisco MIB  | Non-Cisco MIB  |
14. SNMPv2-TC-v1 Non-Cisco MIB  | Non-Cisco MIB  |
15. RMON-MIB Download  | Download  | View Dependencies
16. CISCO-VTP-MIB Download  | Download  |

Загружаем файлы

1
2
3
4
5
6
7
8
9
10
11
12
13
14

wget ftp//ftp.cisco.com/pub/mibs/v2/SNMPv2-SMI.my

wget ftp//ftp.cisco.com/pub/mibs/v2/SNMPv2-TC.my

wget ftp//ftp.cisco.com/pub/mibs/v2/SNMPv2-CONF.my

wget ftp//ftp.cisco.com/pub/mibs/v2/SNMPv2-MIB.my

wget ftp//ftp.cisco.com/pub/mibs/v2/CISCO-SMI.my

wget ftp//ftp.cisco.com/pub/mibs/v2/IANAifType-MIB.my

wget ftp//ftp.cisco.com/pub/mibs/v2/IF-MIB.my

wget ftp//ftp.cisco.com/pub/mibs/v2/CISCO-TC.my

wget ftp//ftp.cisco.com/pub/mibs/v2/INET-ADDRESS-MIB.my

wget ftp//ftp.cisco.com/pub/mibs/v2/SNMP-FRAMEWORK-MIB.my

wget ftp//ftp.cisco.com/pub/mibs/v2/RMON-MIB.my

wget ftp//ftp.cisco.com/pub/mibs/v2/CISCO-VTP-MIB.my

Далее необходимо подключить данные файлы в конфигурационный файл – /etc/snmp/cisco.conf, в том же порядке, каком скачивали, следующим способом

1
2
3
4
5

snmpttconvertmib—in=root.snmpSNMPv2-SMI.my—out=etcsnmpcisco.conf—debug

snmpttconvertmib—in=root.snmpSSNMPv2-TC.my—out=etcsnmpcisco.conf—debug

snmpttconvertmib—in=root.snmpSNMPv2-CONF.my—out=etcsnmpcisco.conf—debug

Таким образом мы внесли изменения в файл /etc/snmp/cisco.conf , в нём появились секции с описанием цифровых OID SNMP трапов. Отредактируйте этот файл, вставте ZBXTRAP $aA после слова FORMAT (сейчас вам надо вставить ZBXTRAP $aA всего в трёх строчках) например была строка

1
2
3

FORMAT Notification ofaconfiguration management event as$*

Стало

1
2
3

FORMAT ZBXTRAP$aA Notification ofaconfiguration management event as$*

Все прикрепленые MIB фалы прописаны в /etc/snmp/cisco.conf. Можно скачать его или добавлять вручную

Весть каталог /etc/snmp/

›› Want other units?

You can do the reverse unit conversion from
megabyte to MiB, or enter any two units below:

››
Common computer data storage conversions

MiB to kilobitMiB to terabyteMiB to kibibyteMiB to tebibyteMiB to megabitMiB to kibibitMiB to byteMiB to gigabitMiB to gibibitMiB to bit

››
Definition: Mebibyte

The mebibyte (a contraction of mega binary byte) is a unit of digital information storage. It is equal to 1,024 kibibytes.

››
Definition: Megabyte

The SI prefix «mega» represents a factor of
106, or in exponential notation, 1E6.

So 1 megabyte = 106 bytes.

The definition of a byte is as follows:

A byte is the basic unit of measurement of information storage in computer science. In many computer architectures it is a unit of memory addressing, consisting of 8 bits.
Since computer memory comes in base two rather than 10, a large portion of the software and computer industry use binary estimates of the SI-prefixed quantities, while producers of computer storage devices prefer the SI values. This is why a computer hard drive advertised with a «100 GB» decimal storage capacity actually contains no more than 93 GB of 8-bit (power of 2) addressable storage.

››
Metric conversions and more

ConvertUnits.com provides an online
conversion calculator for all types of measurement units.
You can find metric conversion tables for SI units, as well
as English units, currency, and other data. Type in unit
symbols, abbreviations, or full names for units of length,
area, mass, pressure, and other types. Examples include mm,
inch, 100 kg, US fluid ounce, 6’3″, 10 stone 4, cubic cm,
metres squared, grams, moles, feet per second, and many more!

›› Want other units?

You can do the reverse unit conversion from
megabit/second to MiB/s, or enter any two units below:

››
Common computer data rate conversions

MiB/s to terabyte/secondMiB/s to terabit/secondMiB/s to gibibyte/secondMiB/s to bit/secondMiB/s to gibibit/secondMiB/s to tebibyte/secondMiB/s to kilobit/secondMiB/s to kilobyte/secondMiB/s to mebibit/secondMiB/s to kibibyte/second

››
Metric conversions and more

ConvertUnits.com provides an online
conversion calculator for all types of measurement units.
You can find metric conversion tables for SI units, as well
as English units, currency, and other data. Type in unit
symbols, abbreviations, or full names for units of length,
area, mass, pressure, and other types. Examples include mm,
inch, 100 kg, US fluid ounce, 6’3″, 10 stone 4, cubic cm,
metres squared, grams, moles, feet per second, and many more!

MIB файлы одним архивом для HP

По отдельности

rfc3636 rfc3413a rfc3019 rfc2863 rfc2579 rfc2578 rfc2108 rfc2096-07 rfc2021 rfc2012 rfc2011D10 rfc1850b ianaAFN hpNetSwitch hpicfVgRptr hpicfTC hpicfIpRoute hpicfIpLockdown hpicfIpAddress hpicfGppc hpicfFf hpicfChain hpicfAutz hpAcmxlSystem rfc2674_q rfc2674_p rfc2665 rfc2620 rfc2618 rfc2613 rfc2576 rfc2266 rfc2020 rfc2013 rfc1850 rfc1749 rfc1742 rfc1724 rfc1513 rfc1512 rfc1493 rfc1213 ipx ieee80211 ieee8023lag ieee8021pae ieee802af ianaiprouteprotocol ianaiftype hpVlan hpSwitchStat hpSwitchStack hpSwitchDrivers hpSwitchDma hpSwitchDistributedTrunk hpSwitchConfig hpicfXrrp hpicfVrrp hpicfvg hpicfUsrProf hpicfUsrAuth hpicfUSBPort hpicfUdpForward hpicfUdld hpicfSyslog hpicfStack hpicfSntp hpicfSnmp hpicfSecurity hpicfSavepower hpicfRip hpicfRateLimit hpicfProviderBridge hpicfPoe hpicfPim hpicfOspf hpicfOobm hpicfOid hpicfMld hpicfLinktest hpicfL3MacConfig hpicfJumbo hpicfInstMon hpicfHighAvailability hpicfGenRptr hpicfFtrCo hpicfEtwist hpicfDownload hpicfDot1x hpicfDosFilter hpicfDhcpv6Relay hpicfDhcpSnoop hpicfDcPower hpicfDcFan hpicfConnectionRateFilter hpicfChassis hpicfBridge hpicfBasic hpicfAutorun hpicfAuth hpicfArpProtect hpicf8023Rptr hpHttpMg hpentmib hpAcmxlMemProc hpAcmxlIfExt hpAcmxlBase rfc4022 rfc3636 rfc3413a rfc3019 rfc2863 rfc2579 rfc2578 rfc2108 rfc2096-07 rfc2021 rfc2012 rfc2011D10 rfc1850b ianaAFN hpNetSwitch hpicfVgRptr hpicfTC hpicfIpRoute hpicfIpLockdown hpicfIpAddress hpicfGppc hpicfFf hpicfChain hpicfAutz hpAcmxlSystem

›› Want other units?

You can do the reverse unit conversion from
Mbps to MiB/s, or enter any two units below:

››
Common computer data rate conversions

MiB/s to kibibyte/secondMiB/s to terabyte/secondMiB/s to megabyte/secondMiB/s to gigabit/secondMiB/s to byte/secondMiB/s to gibibyte/secondMiB/s to tebibyte/secondMiB/s to kilobit/secondMiB/s to terabit/secondMiB/s to kilobyte/second

››
Metric conversions and more

ConvertUnits.com provides an online
conversion calculator for all types of measurement units.
You can find metric conversion tables for SI units, as well
as English units, currency, and other data. Type in unit
symbols, abbreviations, or full names for units of length,
area, mass, pressure, and other types. Examples include mm,
inch, 100 kg, US fluid ounce, 6’3″, 10 stone 4, cubic cm,
metres squared, grams, moles, feet per second, and many more!

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *