Commit ee0c5a57 authored by Andrey Vertiprahov's avatar Andrey Vertiprahov Committed by Dmitry Volodin
Browse files

Generic.get_metrics. Add units (Measurement Units) param to set_metrics.

parent 18b3646a
......@@ -2,5 +2,6 @@
"$metric": "Interface | Errors | Out | Delta",
"$type": "ifindex",
"oid": "IF-MIB::ifOutErrors.{{ ifIndex }}",
"type": "delta"
"type": "delta",
"units": "pkt"
}
......@@ -5,12 +5,14 @@
"$type": "ifindex",
"oid": "IF-MIB::ifHCInOctets.{{ ifIndex }}",
"type": "counter",
"scale": 8
"scale": 8,
"units": "byte"
},
"normal": {
"$type": "ifindex",
"oid": "IF-MIB::ifInOctets.{{ ifIndex }}",
"type": "counter",
"scale": 8
"scale": 8,
"units": "byte"
}
}
......@@ -5,12 +5,14 @@
"$type": "ifindex",
"oid": "IF-MIB::ifHCOutOctets.{{ ifIndex }}",
"type": "counter",
"scale": 8
"scale": 8,
"units": "byte"
},
"normal": {
"$type": "ifindex",
"oid": "IF-MIB::ifOutOctets.{{ ifIndex }}",
"type": "counter",
"scale": 8
"scale": 8,
"units": "byte"
}
}
......@@ -4,11 +4,13 @@
"hires": {
"$type": "ifindex",
"oid": "IF-MIB::ifHCInMulticastPkts.{{ ifIndex }}",
"type": "counter"
"type": "counter",
"units": "pkt"
},
"normal": {
"$type": "ifindex",
"oid": "IF-MIB::ifInMulticastPkts.{{ ifIndex }}",
"type": "counter"
"type": "counter",
"units": "pkt"
}
}
......@@ -4,11 +4,13 @@
"hires": {
"$type": "ifindex",
"oid": "IF-MIB::ifHCOutMulticastPkts.{{ ifIndex }}",
"type": "counter"
"type": "counter",
"units": "pkt"
},
"normal": {
"$type": "ifindex",
"oid": "IF-MIB::ifOutMulticastPkts.{{ ifIndex }}",
"type": "counter"
"type": "counter",
"units": "pkt"
}
}
......@@ -4,11 +4,13 @@
"hires": {
"$type": "ifindex",
"oid": "IF-MIB::ifHCInOctets.{{ ifIndex }}",
"type": "delta"
"type": "delta",
"units": "byte"
},
"normal": {
"$type": "ifindex",
"oid": "IF-MIB::ifInOctets.{{ ifIndex }}",
"type": "delta"
"type": "delta",
"units": "byte"
}
}
......@@ -4,11 +4,13 @@
"hires": {
"$type": "ifindex",
"oid": "IF-MIB::ifHCOutOctets.{{ ifIndex }}",
"type": "delta"
"type": "delta",
"units": "byte"
},
"normal": {
"$type": "ifindex",
"oid": "IF-MIB::ifOutOctets.{{ ifIndex }}",
"type": "delta"
"type": "delta",
"units": "byte"
}
}
......@@ -4,11 +4,13 @@
"hires": {
"$type": "ifindex",
"oid": "IF-MIB::ifHCInUcastPkts.{{ ifIndex }}",
"type": "counter"
"type": "counter",
"units": "pkt"
},
"normal": {
"$type": "ifindex",
"oid": "IF-MIB::ifInUcastPkts.{{ ifIndex }}",
"type": "counter"
"type": "counter",
"units": "pkt"
}
}
......@@ -4,11 +4,13 @@
"hires": {
"$type": "ifindex",
"oid": "IF-MIB::ifHCOutUcastPkts.{{ ifIndex }}",
"type": "counter"
"type": "counter",
"units": "pkt"
},
"normal": {
"$type": "ifindex",
"oid": "IF-MIB::ifOutUcastPkts.{{ ifIndex }}",
"type": "counter"
"type": "counter",
"units": "pkt"
}
}
......@@ -5,11 +5,13 @@
"$type": "ifindex",
"oid": "IF-MIB::ifHighSpeed.{{ ifIndex }}",
"type": "gauge",
"scale": 1000000
"scale": 1000000,
"units": "bit/s"
},
"normal": {
"$type": "ifindex",
"oid": "IF-MIB::ifSpeed.{{ ifIndex }}",
"type": "gauge"
"type": "gauge",
"units": "bit/s"
}
}
......@@ -3,5 +3,6 @@
"$type": "oid",
"oid": "1.3.6.1.2.1.1.3.0",
"type": "gauge",
"scale": "scale(0.01)"
"scale": "scale(0.01)",
"units": "s"
}
{
"$metric": "CPU | Usage",
"$type": "oid",
"oid": "1.3.6.1.4.1.2011.2.23.1.18.1.3.0"
"oid": "1.3.6.1.4.1.2011.2.23.1.18.1.3.0",
"units": "%"
}
......@@ -5,5 +5,6 @@
"1.3.6.1.4.1.2011.6.1.2.1.1.2.65536",
"1.3.6.1.4.1.2011.6.1.2.1.1.3.65536"
],
"scale": "percent"
"scale": "percent",
"units": "%"
}
{
"$metric": "CPU | Usage",
"$type": "oid",
"oid": "1.3.6.1.4.1.25506.2.6.1.1.1.1.6.8"
"oid": "1.3.6.1.4.1.25506.2.6.1.1.1.1.6.8",
"units": "%"
}
{
"$metric": "Memory | Usage",
"$type": "oid",
"oid": "1.3.6.1.4.1.25506.2.6.1.1.1.1.8.8"
"oid": "1.3.6.1.4.1.25506.2.6.1.1.1.1.8.8",
"units": "%"
}
......@@ -40,4 +40,4 @@ class GponPortsRule(OIDRule):
)
]
if oid:
yield oid, self.type, self.scale, metric.labels
yield oid, self.type, self.scale, self.units, metric.labels
......@@ -6,6 +6,7 @@
"$type": "hwslots",
"oid": "1.3.6.1.4.1.2011.6.3.3.2.1.13.0.{{ item }}",
"type": "gauge",
"scale": 1
"scale": 1,
"units": "C"
}]
}
......@@ -6,13 +6,15 @@
"$match": "is_gpon_ports",
"$type": "gponports",
"oid": "{{ oid_prifix }}.{{ ifindex }}",
"type": "counter"
"type": "counter",
"units": "pkt"
},
{
"$metric": "Interface | Errors | In",
"$type": "ifindex",
"oid": "IF-MIB::ifInErrors.{{ ifIndex }}",
"type": "counter"
"type": "counter",
"units": "pkt"
}
]
}
......@@ -6,13 +6,15 @@
"$match": "is_gpon_ports",
"$type": "gponports",
"oid": "{{ oid_prifix }}.{{ ifindex }}",
"type": "delta"
"type": "delta",
"units": "pkt"
},
{
"$metric": "Interface | Errors | In",
"$type": "ifindex",
"oid": "IF-MIB::ifInErrors.{{ ifIndex }}",
"type": "delta"
"type": "delta",
"units": "pkt"
}
]
}
......@@ -7,7 +7,8 @@
"$type": "gponports",
"oid": "{{ oid_prifix }}.{{ ifindex }}",
"type": "counter",
"scale": 8
"scale": 8,
"units": "byte"
},
{
"$type": "hires",
......@@ -15,13 +16,15 @@
"$type": "ifindex",
"oid": "IF-MIB::ifHCInOctets.{{ ifIndex }}",
"type": "counter",
"scale": 8
"scale": 8,
"units": "byte"
},
"normal": {
"$type": "ifindex",
"oid": "IF-MIB::ifInOctets.{{ ifIndex }}",
"type": "counter",
"scale": 8
"scale": 8,
"units": "byte"
}
}]
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment