@cryptotaxi247 / netdata-1 / commits / 5861a38bf

go.d snmp change label name organization->vendor (#18535)

Ilya Mashchenko committed Sep 12, 2024 at 14:49 UTC 5861a38bfa82a8a3359ddf2f6115a013a5039026
2 files changed +4 -3
src/go/plugin/go.d/modules/snmp/charts.go
+2 -2
@@ -162,7 +162,7 @@ func (s *SNMP) addNetIfaceCharts(iface *netInterface) {
162 for _, chart := range *charts {
163 chart.ID = fmt.Sprintf(chart.ID, cleanIfaceName(iface.ifName))
164 chart.Labels = []module.Label{
165 - {Key: "organization", Value: s.sysInfo.organization},
165 + {Key: "vendor", Value: s.sysInfo.organization},
166 {Key: "sysName", Value: s.sysInfo.name},
167 {Key: "ifDescr", Value: iface.ifDescr},
168 {Key: "ifName", Value: iface.ifName},
@@ -191,7 +191,7 @@ func (s *SNMP) removeNetIfaceCharts(iface *netInterface) {
191 func (s *SNMP) addSysUptimeChart() {
192 chart := uptimeChart.Copy()
193 chart.Labels = []module.Label{
194 - {Key: "organization", Value: s.sysInfo.organization},
194 + {Key: "vendor", Value: s.sysInfo.organization},
195 {Key: "sysName", Value: s.sysInfo.name},
196 }
197 if err := s.Charts().Add(chart); err != nil {
src/go/plugin/go.d/modules/snmp/collect.go
+2 -1
@@ -80,7 +80,8 @@ func (s *SNMP) setupVnode(si *sysInfo) *vnodes.VirtualNode {
80 if si.location != "" {
81 labels["sysLocation"] = si.location
82 }
83 - labels["organization"] = si.organization
83 + // FIXME: vendor should be obtained from sysDescr, org should be used as a fallback
84 + labels["vendor"] = si.organization
85
86 return &vnodes.VirtualNode{
87 GUID: s.Vnode.GUID,