From 3297ac72f15d9df5650e2532782bc81e31b7178c Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Tue, 29 Dec 2020 17:47:58 +0000 Subject: nixos/prometheus: add smokeping and corresponding NixOS test --- nixos/tests/prometheus-exporters.nix | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'nixos/tests') diff --git a/nixos/tests/prometheus-exporters.nix b/nixos/tests/prometheus-exporters.nix index ffa7f420c093..4dcea39cef17 100644 --- a/nixos/tests/prometheus-exporters.nix +++ b/nixos/tests/prometheus-exporters.nix @@ -670,6 +670,27 @@ let ''; }; + smokeping = { + exporterConfig = { + enable = true; + hosts = ["127.0.0.1"]; + }; + exporterTest = '' + wait_for_unit("prometheus-smokeping-exporter.service") + wait_for_open_port(9374) + wait_until_succeeds( + "curl -sSf localhost:9374/metrics | grep '{}' | grep -qv ' 0$'".format( + 'smokeping_requests_total{host="127.0.0.1",ip="127.0.0.1"} ' + ) + ) + wait_until_succeeds( + "curl -sSf localhost:9374/metrics | grep -q '{}'".format( + 'smokeping_response_ttl{host="127.0.0.1",ip="127.0.0.1"}' + ) + ) + ''; + }; + snmp = { exporterConfig = { enable = true; -- cgit v1.2.3