Deploy `consul config for `snmp_exporter`.

This commit is contained in:
Kazuhiro MUSASHI 2020-10-24 19:34:01 +09:00
parent ace020419f
commit a5b6dbd529
2 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,12 @@
{
"service": {
"name": "snmp_exporter",
"port": 9116,
"check":{
"tcp": "127.0.0.1:9116",
"interval": "60s",
"timeout": "1s",
"success_before_passing": 3
}
}
}

View File

@ -12,6 +12,15 @@ remote_file '/etc/supervisor/conf.d/snmp_exporter.conf' do
notifies :restart, 'service[supervisor]'
end
# Deploy `consul` config:
remote_file '/etc/consul.d/service-snmp_exporter.json' do
owner 'root'
group 'root'
mode '644'
notifies :restart, 'service[supervisor]'
end
# Restart the `supervisor`:
service 'supervisor' do
action :nothing