parent
fcc0d615a7
commit
4a7df9969d
23 changed files with 746 additions and 0 deletions
34
chris-here-bitte/templates/alloy/icmp_probes.json
Normal file
34
chris-here-bitte/templates/alloy/icmp_probes.json
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
[
|
||||
{% for i in query("netbox.netbox.nb_lookup", "devices", api_endpoint="https://netbox.ef.scientress.de/") -%}
|
||||
{% if i.value.role.slug not in ["patchpanel", "accesspoint"] -%}
|
||||
{
|
||||
"targets": [ "" ],
|
||||
"labels": {
|
||||
"name": "{{ i.value.name }}",
|
||||
"probed_instance": "{{ i.value.name }}",
|
||||
"location": "{{ i.value.location.name | default("unknown") }}",
|
||||
"netbox_type": "device",
|
||||
"netbox_role": "{{ i.value.role.slug | default("undefined") }}",
|
||||
"netbox_status": "{{ i.value.status.value }}",
|
||||
"module": "icmp4",
|
||||
"address": "{{ (i.value.primary_ip4.address | default("192.0.2.0/24")).rsplit("/", maxsplit=1) | first }}"
|
||||
}
|
||||
},
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% for i in query("netbox.netbox.nb_lookup", "virtual-machines", api_endpoint="https://netbox.ef.scientress.de/") -%}
|
||||
{
|
||||
"targets": [ "" ],
|
||||
"labels": {
|
||||
"name": "{{ i.value.name }}",
|
||||
"probed_instance": "{{ i.value.name }}",
|
||||
"netbox_type": "virtual-machine",
|
||||
"netbox_role": "{{ i.value.role.slug | default("undefined") }}",
|
||||
"netbox_status": "{{ i.value.status.value }}",
|
||||
"module": "icmp4",
|
||||
"address": "{{ (i.value.primary_ip4.address | default("192.0.2.0/24")).rsplit("/", maxsplit=1) | first }}"
|
||||
}
|
||||
}{% if not loop.last %},{% endif %}
|
||||
{% endfor %}
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue