Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/bash
echo "Role ${ROLE}"
sudo mv dcos-metrics-prometheus-plugin_1.10.5 /opt/mesosphere/bin/dcos-metrics-prometheus-plugin
echo "PROMETHEUS_PORT=61091" > dcos-metrics-prometheus.env
mv dcos-metrics-prometheus.env /opt/mesosphere/etc/
cat << EOF > dcos-metrics-prometheus-agent.service
[Unit]
Description=DC/OS Metrics Agent Prometheus Plugin
[Service]
Restart=always
RestartSec=60
PermissionsStartOnly=True
User=dcos_metrics
SupplementaryGroups=dcos_adminrouter
EnvironmentFile=/opt/mesosphere/environment
EnvironmentFile=/opt/mesosphere/etc/dcos-metrics.env
EnvironmentFile=/opt/mesosphere/etc/dcos-metrics-prometheus.env
ExecStart=/opt/mesosphere/bin/dcos-metrics-prometheus-plugin --dcos-role ${ROLE}
EOF
mv dcos-metrics-prometheus-agent.service /etc/systemd/system/
cat /etc/systemd/system/dcos-metrics-prometheus-agent.service
echo "Restarting systemd"
sudo systemctl daemon-reload
sudo systemctl restart dcos-metrics-prometheus-agent.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment