LINUX.ORG.RU

История изменений

Исправление ZeroNight, (текущая версия) :

1.3.6.1.4.1.32108.1.9.2.2.0 - 1 порт
                        ^
1.3.6.1.4.1.32108.1.9.2.3.0 - 2 порт
                        ^

Вот тебе индексы указывающие на порт. Просто нумерация может идти не от 1 или 0. У меня есть свич, на котором ifIndex начинается с 69. А вопрос о лейблах и одной метрике я не понял. Тебе snmp-exporter будет отдавать в таком вот формате:

# HELP ifOutErrors The number of outbound packets that could not be transmitted because of errors. - 1.3.6.1.2.1.2.2.1.20
# TYPE ifOutErrors counter
ifOutErrors{ifAlias="swc1-myru-43.km:26",ifIndex="2",ifName="ethernet2"} 0
ifOutErrors{ifAlias="to swc1-duna.km",ifIndex="4",ifName="ethernet4"} 783
ifOutErrors{ifAlias="to swc1-myru-71.km",ifIndex="3",ifName="ethernet3"} 2274
ifOutErrors{ifAlias="to swc1-pod-93.km",ifIndex="5",ifName="ethernet5"} 0
ifOutErrors{ifAlias="to swc1-vld-66.km",ifIndex="8",ifName="ethernet8"} 1.295033e+07
# HELP snAgentCpuUtil100thPercent The statistical CPU utilization in units of one-hundredth of a percent. - 1.3.6.1.4.1.1991.1.1.2.11.1.1.6
# TYPE snAgentCpuUtil100thPercent gauge
snAgentCpuUtil100thPercent{snAgentCpuUtilCpuId="1",snAgentCpuUtilInterval="60",snAgentCpuUtilSlotNum="1"} 1300
# HELP snmp_scrape_duration_seconds Total SNMP time scrape took (walk and processing).
# TYPE snmp_scrape_duration_seconds gauge
snmp_scrape_duration_seconds 0.035164471
# HELP snmp_scrape_pdus_returned PDUs returned from walk.
# TYPE snmp_scrape_pdus_returned gauge
snmp_scrape_pdus_returned 241
# HELP snmp_scrape_walk_duration_seconds Time SNMP walk/bulkwalk took.
# TYPE snmp_scrape_walk_duration_seconds gauge
snmp_scrape_walk_duration_seconds 0.031992059

Исходная версия ZeroNight, :

1.3.6.1.4.1.32108.1.9.2.2.0 - 1 порт
                        ^
1.3.6.1.4.1.32108.1.9.2.3.0 - 2 порт
                        ^

Вот тебе индексы указывающие на порт. Просто нумерация может идти не от 1 или 0. У меня есть свич, на котором ifIndex начинается с 69. А вопрос о лейблах и одной метрике я не понял. Тебе snmp-exporter будет отдавать в таком вот формате:

# HELP ifOutErrors The number of outbound packets that could not be transmitted because of errors. - 1.3.6.1.2.1.2.2.1.20
# TYPE ifOutErrors counter
ifOutErrors{ifAlias="",ifIndex="10",ifName="ethernet10"} 3.427538e+06
ifOutErrors{ifAlias="",ifIndex="20",ifName="ethernet20"} 0
ifOutErrors{ifAlias="",ifIndex="21",ifName="ethernet21"} 0
ifOutErrors{ifAlias="",ifIndex="22",ifName="ethernet22"} 0
ifOutErrors{ifAlias="GM-Host",ifIndex="6",ifName="ethernet6"} 9
ifOutErrors{ifAlias="Interconnect-dataline",ifIndex="1",ifName="ethernet1"} 0
ifOutErrors{ifAlias="Krasyliv-cwdm",ifIndex="15",ifName="ethernet15"} 0
ifOutErrors{ifAlias="LACP to pod93",ifIndex="17",ifName="ethernet17"} 4.91334843e+08
ifOutErrors{ifAlias="LACP to pod93",ifIndex="18",ifName="ethernet18"} 5.40945781e+08
ifOutErrors{ifAlias="LAG5-to-myru-71-4",ifIndex="23",ifName="ethernet23"} 1.6943e+06
ifOutErrors{ifAlias="LAG5-to-myru-71-4",ifIndex="24",ifName="ethernet24"} 1.552343e+06
ifOutErrors{ifAlias="Magicom",ifIndex="19",ifName="ethernet19"} 160
ifOutErrors{ifAlias="Omega",ifIndex="12",ifName="ethernet12"} 2481
ifOutErrors{ifAlias="Polonne",ifIndex="11",ifName="ethernet11"} 12726
ifOutErrors{ifAlias="X-City",ifIndex="7",ifName="ethernet7"} 19
ifOutErrors{ifAlias="lacp to swc1-myru-43.km",ifIndex="9",ifName="ethernet9"} 101619
ifOutErrors{ifAlias="lacp-to-pod93",ifIndex="16",ifName="ethernet16"} 2.2452303e+07
ifOutErrors{ifAlias="lag-pod93",ifIndex="13",ifName="ethernet13"} 19
ifOutErrors{ifAlias="lag-pod93",ifIndex="14",ifName="ethernet14"} 0
ifOutErrors{ifAlias="swc1-myru-43.km:26",ifIndex="2",ifName="ethernet2"} 0
ifOutErrors{ifAlias="to swc1-duna.km",ifIndex="4",ifName="ethernet4"} 783
ifOutErrors{ifAlias="to swc1-myru-71.km",ifIndex="3",ifName="ethernet3"} 2274
ifOutErrors{ifAlias="to swc1-pod-93.km",ifIndex="5",ifName="ethernet5"} 0
ifOutErrors{ifAlias="to swc1-vld-66.km",ifIndex="8",ifName="ethernet8"} 1.295033e+07
# HELP snAgentCpuUtil100thPercent The statistical CPU utilization in units of one-hundredth of a percent. - 1.3.6.1.4.1.1991.1.1.2.11.1.1.6
# TYPE snAgentCpuUtil100thPercent gauge
snAgentCpuUtil100thPercent{snAgentCpuUtilCpuId="1",snAgentCpuUtilInterval="60",snAgentCpuUtilSlotNum="1"} 1300
# HELP snmp_scrape_duration_seconds Total SNMP time scrape took (walk and processing).
# TYPE snmp_scrape_duration_seconds gauge
snmp_scrape_duration_seconds 0.035164471
# HELP snmp_scrape_pdus_returned PDUs returned from walk.
# TYPE snmp_scrape_pdus_returned gauge
snmp_scrape_pdus_returned 241
# HELP snmp_scrape_walk_duration_seconds Time SNMP walk/bulkwalk took.
# TYPE snmp_scrape_walk_duration_seconds gauge
snmp_scrape_walk_duration_seconds 0.031992059