Skip to content
Snippets Groups Projects
Commit 85acb084 authored by Florian Sesser's avatar Florian Sesser
Browse files

Monitoring: Also have atomicity for megacli2prom

parent 787e8537
No related branches found
No related tags found
2 merge requests!228merge develop into production,!216Monitoring: Add regular scraping for Tahoe OpenMetrics statistics
Pipeline #1486 passed
......@@ -42,7 +42,13 @@ in {
wantedBy = [ "multi-user.target" ];
startAt = cfg.interval;
path = [ pkgs.megacli ];
script = "${ourpkgs.megacli2prom}/bin/megacli2prom > ${cfg.outFile}";
# Save to a temp file and then move atomically so the
# textfile collector won't read a partial file.
# See https://github.com/prometheus/node_exporter#textfile-collector
script = ''
"${ourpkgs.megacli2prom}/bin/megacli2prom" > "${cfg.outFile}.tmp"
mv "${cfg.outFile}.tmp" "${cfg.outFile}"
'';
};
};
}
......
......@@ -46,8 +46,8 @@ in {
startAt = cfg.interval;
path = [ pkgs.curl ];
# Curl to a temp file and then move atomically so textfile collector
# won't read a partial file.
# Save to a temp file and then move atomically so the
# textfile collector won't read a partial file.
# See https://github.com/prometheus/node_exporter#textfile-collector
script = ''
curl --silent --show-error --fail-with-body --output "${cfg.outFile}.tmp" "${cfg.scrapeEndpoint}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment