#cloud-config

coreos:
  units:
    - name: "zabbix-agentd.service"
      command: "start"
      content: |
        [Unit]
        Description=Zabbix Agentd
        After=network.target

        [Service]
        Type=forking
        Restart=on-failure
        Environment="CONFFILE=/opt/etc/zabbix/zabbix_agentd.conf"
        Environment="ZBX_VERSION=3.2.1"
        Environment="ZABBIX_SERVER=monitoramento.ts3corp.com.br"
        Environment="LD_LIBRARY_PATH=/opt/lib"
        PIDFile=/var/run/zabbix/zabbix_agentd.pid
        KillMode=control-group
        ExecStartPre=/usr/bin/wget https://raw.githubusercontent.com/gcavalcante8808/zabbix-agentd-coreos/master/scripts/bootstrap_agentd.sh -O /bootstrap_agentd.sh
        ExecStartPre=/usr/bin/chmod +x /bootstrap_agentd.sh
        ExecStartPre=/bootstrap_agentd.sh
        ExecStart=/opt/bin/zabbix_agentd -c $CONFFILE
        ExecStop=/bin/kill -SIGTERM $MAINPID
        RestartSec=10s

        [Install]
        WantedBy=multi-user.target

users:
  - name: "zabbix"
    no-create-home: true
    groups:
     - docker


#cloud-config

coreos:
  units:
    - name: "zabbix-agentd.service"
      enable: true
      command: "start"
      content: |
        [Unit]
        Description=Zabbix Agentd
        After=network.target

        [Service]
        Type=forking
        Restart=on-failure
        Environment="CONFFILE=/opt/etc/zabbix/zabbix_agentd.conf"
        Environment="ZBX_VERSION=3.2.1"
        Environment="ZABBIX_SERVER=monitoramento.ts3corp.com.br"
        Environment="LD_LIBRARY_PATH=/opt/lib"
        PIDFile=/var/run/zabbix/zabbix_agentd.pid
        KillMode=control-group
        ExecStartPre=/usr/bin/wget https://raw.githubusercontent.com/gcavalcante8808/zabbix-agentd-coreos/master/scripts/bootstrap_agentd.sh -O /bootstrap_agentd.sh
        ExecStartPre=/usr/bin/chmod +x /bootstrap_agentd.sh
        ExecStartPre=/bootstrap_agentd.sh
        ExecStart=/opt/bin/zabbix_agentd -c $CONFFILE
        ExecStop=/bin/kill -SIGTERM $MAINPID
        RestartSec=10s

        [Install]
        WantedBy=multi-user.target

users:
  - name: "zabbix"
    no-create-home: true
    groups:
     - docker


Enable zabbix-agentd service at boot.
Enable zabbix-agentd service at boot.
