-
Notifications
You must be signed in to change notification settings - Fork 347
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* T6949: adds blackbox exporter * T6949: adds basic config generation * T6949: extract shared module config options * T6949: switch to ipv4/6 literals * T6949: moves config file to /run * T6949: adds dns query name option * T6949: adds dns query type values * T6949: adds blackbox exporter to debian/control
- Loading branch information
Showing
7 changed files
with
290 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{% set vrf_command = 'ip vrf exec ' ~ vrf ~ ' runuser -u node_exporter -- ' if vrf is vyos_defined else '' %} | ||
[Unit] | ||
Description=Blackbox Exporter | ||
Documentation=https://github.com/prometheus/blackbox_exporter | ||
After=network.target | ||
|
||
[Service] | ||
{% if vrf is not vyos_defined %} | ||
User=node_exporter | ||
{% endif %} | ||
ExecStart={{ vrf_command }}/usr/sbin/blackbox_exporter \ | ||
{% if listen_address is vyos_defined %} | ||
{% for address in listen_address %} | ||
--web.listen-address={{ address }}:{{ port }} \ | ||
{% endfor %} | ||
{% else %} | ||
--web.listen-address=:{{ port }} \ | ||
{% endif %} | ||
--config.file=/run/blackbox_exporter/config.yml | ||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
modules: | ||
{% if modules is defined and modules.dns is defined and modules.dns.name is defined %} | ||
{% for module_name, module_config in modules.dns.name.items() %} | ||
{{ module_name }}: | ||
prober: dns | ||
timeout: {{ module_config.timeout }}s | ||
dns: | ||
query_name: "{{ module_config.query_name }}" | ||
query_type: "{{ module_config.query_type }}" | ||
preferred_ip_protocol: "{{ module_config.preferred_ip_protocol | replace('v', '') }}" | ||
ip_protocol_fallback: {{ 'true' if module_config.ip_protocol_fallback is vyos_defined else 'false' }} | ||
{% endfor %} | ||
{% endif %} | ||
{% if modules is defined and modules.icmp is vyos_defined and modules.icmp.name is vyos_defined %} | ||
{% for module_name, module_config in modules.icmp.name.items() %} | ||
{{ module_name }}: | ||
prober: icmp | ||
timeout: {{ module_config.timeout }}s | ||
icmp: | ||
preferred_ip_protocol: "{{ module_config.preferred_ip_protocol | replace('v', '') }}" | ||
ip_protocol_fallback: {{ 'true' if module_config.ip_protocol_fallback is vyos_defined else 'false' }} | ||
{% endfor %} | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
interface-definitions/include/monitoring/blackbox-exporter-module-commons.xml.i
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<!-- include start from monitoring/blackbox-module-commons.xml.i --> | ||
<leafNode name="timeout"> | ||
<properties> | ||
<help>Timeout in seconds for the probe request</help> | ||
<valueHelp> | ||
<format>u32:1-60</format> | ||
<description>Timeout in seconds</description> | ||
</valueHelp> | ||
<constraint> | ||
<validator name="numeric" argument="--range 1-60"/> | ||
</constraint> | ||
<constraintErrorMessage>Timeout must be between 1 and 60 seconds</constraintErrorMessage> | ||
</properties> | ||
<defaultValue>5</defaultValue> | ||
</leafNode> | ||
<leafNode name="preferred-ip-protocol"> | ||
<properties> | ||
<help>Preferred IP protocol for this module</help> | ||
<valueHelp> | ||
<format>ipv4</format> | ||
<description>Prefer IPv4</description> | ||
</valueHelp> | ||
<valueHelp> | ||
<format>ipv6</format> | ||
<description>Prefer IPv6</description> | ||
</valueHelp> | ||
<constraint> | ||
<regex>(ipv4|ipv6)</regex> | ||
</constraint> | ||
</properties> | ||
<defaultValue>ip6</defaultValue> | ||
</leafNode> | ||
<leafNode name="ip-protocol-fallback"> | ||
<properties> | ||
<help>Allow fallback to other IP protocol if necessary</help> | ||
<valueless/> | ||
</properties> | ||
</leafNode> | ||
<!-- include end --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters