Sfoglia il codice sorgente

20171117 substitutions (substitutions verbessert insb. wg. EXPORT_DIR /var/lib/prometheus/node-exporter auf Linux)

Altlast 7 anni fa
parent
commit
8b51881b77
4 ha cambiato i file con 19 aggiunte e 16 eliminazioni
  1. 7 4
      Makefile.in
  2. 4 4
      conf/substitutions.conf.FreeBSD
  3. 7 7
      conf/substitutions.conf.Linux
  4. 1 1
      dashboard/Makefile.in

+ 7 - 4
Makefile.in

@@ -55,13 +55,16 @@ dist/Makefile: dist/Makefile.in
 dist/nodes2grafana.txz:
 	cd dist && rm -f $@ && ${MAKE}
 
-install: install-bin %%EXPORT_DIR%% install-crontab install-dashboard
+install: install-bin install-export install-crontab install-dashboard
 
-install-bin: src/nodes2prom src/json-pp etc/nodes2prometheus.sh %%HEAP_FILES%%
+install-bin: src/nodes2prom src/json-pp etc/nodes2prometheus.sh %%HEAP_INSTALL_FILES%%
 	%%INSTALL_BIN_CMD%% $> %%BIN_DIR%%
 
-%%EXPORT_DIR%%:
-	%%EXPORT_DIR_CMD%% $@
+install-export:
+	if [ -e %%EXPORT_DIR%% ] ; \
+	then %%EXPORT_DIR_CHOWN%% %%EXPORT_DIR%% ; \
+	else %%EXPORT_DIR_INSTALL%% %%EXPORT_DIR%% ; \
+	fi
 
 install-crontab:
 	[ ! -r %%ETC_DIR%%/crontab ] || { \

+ 4 - 4
conf/substitutions.conf.FreeBSD

@@ -1,15 +1,15 @@
 FETCH_CMD		fetch -q -T 30 --no-verify-peer -o
 EXPORT_DIR		/var/tmp/node_exporter
-EXPORT_DIR_CMD		install -d -o nobody -g nobody -m 1755
+EXPORT_DIR_CHOWN	chown nobody:nogroup
+EXPORT_DIR_INSTALL	install -d -o nobody -g nobody -m 1755
 RUN_SML			/usr/local/smlnj/bin/.run-sml
 HEAP_SUFFIX		x86-bsd
-HEAP_FILES
-HEAP_TAR_EXCLUDE	--exclude=src/*.x86-bsd
+HEAP_INSTALL_FILES
 BIN_DIR			/usr/local/bin
 # keep this:
 ETC_DIR			/etc
 DASHBOARD_DIR		/var/db/grafana/dashboards
-DASHBOARD_DIR_CMD	install -d -o grafana -g grafana -m 755
+DASHBOARD_DIR_INSTALL	install -d -o grafana -g grafana -m 755
 INSTALL_BIN_CMD		install -o 0 -g 0 -p -S -v
 INSTALL_DATA_CMD	install -o 0 -g 0 -p -S -v -m 644
 # keep this:

+ 7 - 7
conf/substitutions.conf.Linux

@@ -1,17 +1,17 @@
 FETCH_CMD		wget -q -O
-EXPORT_DIR		/var/tmp/node_exporter
-EXPORT_DIR_CMD		install -d -o nobody -g nogroup -m 1755
-#EXPORT_DIR_CMD		mkdir -p
+EXPORT_DIR		/var/lib/prometheus/node-exporter
+EXPORT_DIR_CHOWN	chown nobody:nogroup
+EXPORT_DIR_INSTALL	install -d -o nobody -g nobody -m 1755
+#EXPORT_DIR_INSTALL	mkdir -p
 RUN_SML			/usr/lib/smlnj/bin/.run-sml
 HEAP_SUFFIX		x86-linux
-HEAP_FILES		src/nodes2prom.x86-linux src/json-pp.x86-linux
-HEAP_TAR_EXCLUDE
+HEAP_INSTALL_FILES	src/nodes2prom.x86-linux src/json-pp.x86-linux
 BIN_DIR			/usr/local/bin
 # keep this:
 ETC_DIR			/etc
 DASHBOARD_DIR		/var/lib/grafana/dashboards
-DASHBOARD_DIR_CMD	install -d -o grafana -g grafana -m 755
-#DASHBOARD_DIR_CMD	mkdir -p
+DASHBOARD_DIR_INSTALL	install -d -o grafana -g grafana -m 755
+#DASHBOARD_DIR_INSTALL	mkdir -p
 INSTALL_BIN_CMD		install -o 0 -g 0 -p -v
 #INSTALL_BIN_CMD	cp -a
 INSTALL_DATA_CMD	install -o 0 -g 0 -p -v -m 644

+ 1 - 1
dashboard/Makefile.in

@@ -20,7 +20,7 @@ dashboard: %%DASHBOARD_PREFIX%%status.json %%DASHBOARD_PREFIX%%status-render.jso
 install: %%EXPORT_DIR%%/%%PROM_GROUPS_PREFIX%%.prom %%DASHBOARD_DIR%% %%DASHBOARD_DIR%%/%%DASHBOARD_PREFIX%%status.json %%DASHBOARD_DIR%%/%%DASHBOARD_PREFIX%%status-render.json %%DASHBOARD_DIR%%/%%DASHBOARD_PREFIX%%status-group.json %%DASHBOARD_DIR%%/%%DASHBOARD_PREFIX%%status-group-render.json
 
 %%DASHBOARD_DIR%%:
-	%%DASHBOARD_DIR_CMD%% $@
+	%%DASHBOARD_DIR_INSTALL%% $@
 
 %%EXPORT_DIR%%/%%PROM_GROUPS_PREFIX%%.prom: %%PROM_GROUPS_PREFIX%%.prom
 	%%INSTALL_DATA_CMD%% $> $@