Update
This commit is contained in:
parent
7386ea1274
commit
caae472169
@ -1,6 +1,7 @@
|
||||
FROM prom/node-exporter:latest
|
||||
|
||||
ENV NODE_ID=none
|
||||
USER root
|
||||
COPY entrypoint.sh /etc/node-exporter/
|
||||
ENTRYPOINT ["sh", "/etc/node-exporter/entrypoint.sh"]
|
||||
ENTRYPOINT ["/etc/node-exporter/entrypoint.sh"]
|
||||
CMD ["/bin/node_exporter"]
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
#!/bin/sh -e
|
||||
|
||||
NODE_NAME=$(cat "/host/etc/hostname")
|
||||
echo "node_meta{node_name=\"$NODE_NAME\"} 1" > /etc/node-exporter/node-meta.prom
|
||||
echo "node_meta{node_id=\"$NODE_ID\", container_label_com_docker_swarm_node_id=\"$NODE_ID\", node_name=\"$NODE_NAME\"} 1" > /etc/node-exporter/node-meta.prom
|
||||
set -- /bin/node_exporter "$@"
|
||||
exec "$@"
|
||||
|
Loading…
Reference in New Issue
Block a user