mirror of
https://github.com/kemko/keenetic-grafana-monitoring.git
synced 2026-01-01 15:45:43 +03:00
Adding ntce export
This commit is contained in:
@@ -51,18 +51,6 @@
|
||||
"state": "$.state"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "ip nat",
|
||||
"root" : "$.[*]",
|
||||
"tags" : {
|
||||
"src" : "$.src",
|
||||
"dst" : "$.dst"
|
||||
},
|
||||
"values" : {
|
||||
"bytes-in": "$.bytes",
|
||||
"bytes-out": "$.bytes-out"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "system",
|
||||
"root" : "$",
|
||||
@@ -174,6 +162,24 @@
|
||||
"rxspeed": "$.rxspeed",
|
||||
"txspeed": "$.txspeed"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "ntce hosts",
|
||||
"root" : "$.host[*].application[*]",
|
||||
"tags" : {
|
||||
"group-long" : "$.group-long",
|
||||
"groupset-long-id" : "$.groupset-long-id",
|
||||
"long" : "$.long",
|
||||
"short": "$.short",
|
||||
|
||||
"name": "`parent`.`parent`.host.name",
|
||||
"ip": "`parent`.`parent`.host.ip",
|
||||
"hostname": "`parent`.`parent`.host.hostname"
|
||||
},
|
||||
"values" : {
|
||||
"rxbytes": "$.rxbytes",
|
||||
"txbytes": "$.txbytes"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -55,6 +55,9 @@ class KeeneticCollector(object):
|
||||
for tagName, tagPath in self._tags.items():
|
||||
if tagPath == '~':
|
||||
tags[tagName] = root.path.fields[0]
|
||||
elif str(tagPath).startswith('`parent`'):
|
||||
full_path = root.full_path.child(tagPath)
|
||||
tags[tagName] = self.get_first_value(full_path.find(response))
|
||||
else:
|
||||
tags[tagName] = self.get_first_value(tagPath.find(root.value))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user