HUB
Sign inSign up

slzcc/openfalcon-agent

By slzcc

•Updated almost 8 years ago

OpenFalcon Agent 5.1.1

Image
0

690

slzcc/openfalcon-agent repository overview

⁠Dockerfile

FROM golang AS Code
LABEL AuthorEmail [email protected]  ProjectUrl https://github.com/open-falcon/agent
RUN mkdir -p $GOPATH/src/github.com/open-falcon \
 && cd $GOPATH/src/github.com/open-falcon \
 && git clone https://github.com/open-falcon/agent.git \
 && cd agent \
 && go get \
 && ./control build
FROM ubuntu:16.04
COPY --from=Code /go/src/github.com/open-falcon/agent /agent
EXPOSE 1988
WORKDIR /agent
COPY docker-entrypoint.sh /docker-entrypoint.sh
CMD ["/docker-entrypoint.sh"]

⁠docker-entrypoint.sh

#!/bin/bash
# docker-entrypoint.sh
set -e

HEARTBEAT_ADDR=${HEARTBEAT_ADDR:-"127.0.0.1:6030"}
TRANSFER_ADDR=${TRANSFER_ADDR:-"127.0.0.1:8433"}
AGENT_LISTEN=${AGENT_LISTEN:-"1988"}
COLLECTOR_NETWORK_PREFIX=${COLLECTOR_NETWORK_PREFIX:-[\"eth\", \"em\"]}

cat > /agent/cfg.json <<EOF
{
    "debug": true,
    "hostname": "",
    "ip": "",
    "plugin": {
        "enabled": false,
        "dir": "./plugin",
        "git": "https://github.com/open-falcon/plugin.git",
        "logs": "./logs"
    },
    "heartbeat": {
        "enabled": true,
        "addr": "${HEARTBEAT_ADDR}",
        "interval": 60,
        "timeout": 1000
    },
    "transfer": {
        "enabled": true,
        "addrs": [
            "${TRANSFER_ADDR}"
        ],
        "interval": 60,
        "timeout": 1000
    },
    "http": {
        "enabled": true,
        "listen": ":${AGENT_LISTEN}",
        "backdoor": false
    },
    "collector": {
        "ifacePrefix": ${COLLECTOR_NETWORK_PREFIX},
        "mountPoint": []
    },
    "default_tags": {
    },
    "ignore": {
        "cpu.busy": true,
        "df.bytes.free": true,
        "df.bytes.total": true,
        "df.bytes.used": true,
        "df.bytes.used.percent": true,
        "df.inodes.total": true,
        "df.inodes.free": true,
        "df.inodes.used": true,
        "df.inodes.used.percent": true,
        "mem.memtotal": true,
        "mem.memused": true,
        "mem.memused.percent": true,
        "mem.memfree": true,
        "mem.swaptotal": true,
        "mem.swapused": true,
        "mem.swapfree": true
    }
}
EOF

exec /agent/falcon-agent -c /agent/cfg.json

⁠Docker run

$ docker run -d --name falcon-agent --net host -e HEARTBEAT_ADDR=10.30.0.54:6030 -e TRANSFER_ADDR=10.30.0.54:8433 -e COLLECTOR_NETWORK_PREFIX="[]" -e TZ="Asia/Shanghai" slzcc/openfalcon-agent:latest
Tag summary
Recent tags
Content type
Image
Digest
Size
47.8 MB
Last updated
almost 8 years ago
docker pull slzcc/openfalcon-agent:latest