Alexandros Kosiaris has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/334367 )
Change subject: osm prometheus: Fix bug with hardcoded state file
......................................................................
osm prometheus: Fix bug with hardcoded state file
Use the variable instead.
Change-Id: Ib318d88049affd883cad8468346852f4466aaeca
---
M modules/osm/files/osm_sync_lag.sh
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/operations/puppet
refs/changes/67/334367/1
diff --git a/modules/osm/files/osm_sync_lag.sh
b/modules/osm/files/osm_sync_lag.sh
index d27e475..e5a2a6c 100644
--- a/modules/osm/files/osm_sync_lag.sh
+++ b/modules/osm/files/osm_sync_lag.sh
@@ -6,7 +6,7 @@
state_path=${1:-"/srv/osmosis/state.txt"}
prometheus_path=${2:-"/var/lib/prometheus/node-exporter/osm_sync_lag.prom"}
-timestamp=$(awk -F= '/^timestamp=/ { print $2 }' state.txt | tr -d \\\\)
+timestamp=$(awk -F= '/^timestamp=/ { print $2 }' $state_path | tr -d \\\\)
lag=$(date "+%s" --date=${timestamp})
echo "osm_sync_timestamp" $lag > $prometheus_path.$$
mv $prometheus_path.$$ $prometheus_path
--
To view, visit https://gerrit.wikimedia.org/r/334367
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib318d88049affd883cad8468346852f4466aaeca
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits