Skip to content

Commit

Permalink
Add netdata & test python script
Browse files Browse the repository at this point in the history
  • Loading branch information
Jbithell committed May 13, 2017
1 parent 0d997e4 commit 9cc339f
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 0 deletions.
40 changes: 40 additions & 0 deletions Dockerfile.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
FROM resin/%%RESIN_MACHINE_NAME%%-debian


RUN apt-get update && apt-get install -yq \
libpng-dev \
libfreetype6-dev \
pkg-config \
build-essential \
curl \
manpages-dev \
python3 \
python3-dev \
python3-pip \
python3-tk \
python3-setuptools \
libfreetype6-dev \
rpl \
git

RUN sudo easy_install3 pip
#RUN pip install -r

# Set our working directory
WORKDIR /usr/src/app

# switch on systemd init system in container
ENV INITSYSTEM on

# Install NetData Monitoring
RUN curl -Ss 'https://raw.githubusercontent.com/firehol/netdata-demo-site/master/install-required-packages.sh' >/tmp/kickstart.sh && bash /tmp/kickstart.sh -i netdata-all
RUN git clone https://github.com/firehol/netdata.git --depth=1
RUN cd netdata/ && bash netdata-installer.sh && cd ../

# This will copy all files in our root to the working directory in the container
COPY . ./

RUN apt-get clean && rm -rf /var/lib/apt/lists/*

# main.py will run when container starts up on the device
CMD ["bash","/usr/src/app/start.sh"]
1 change: 1 addition & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print("Hi!")
43 changes: 43 additions & 0 deletions netdataconfig.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
[global]
port = 80
multi threaded web server = no
enable web responses gzip compression = no
history = 600
update every = 5
memory mode = ram
debug log = none
error log = none
access log = none
[plugins]
proc = yes

tc = no
idlejitter = no
cgroups = no
checks = no
apps = no
charts.d = no
node.d = no

plugins directory = /usr/libexec/netdata/plugins.d
enable running new plugins = no
check for new plugins every = 60
[plugin:proc]
/proc/net/dev = yes # network interfaces
/proc/diskstats = yes # disks
/proc/net/snmp = yes # generic IPv4
# /proc/net/snmp6 = yes # generic IPv6
# /proc/net/netstat = yes # TCP and UDP
# /proc/net/stat/conntrack = yes # firewall
# /proc/net/ip_vs/stats = yes # IP load balancer
# /proc/net/stat/synproxy = yes # Anti-DDoS
/proc/stat = yes # CPU, context switches
/proc/meminfo = yes # Memory
/proc/vmstat = yes # Memory operations
# /proc/net/rpc/nfsd = yes # NFS Server
/proc/sys/kernel/random/entropy_avail = yes # Cryptography
# /proc/interrupts = yes # Interrupts
# /proc/softirqs = yes # SoftIRQs
# /proc/loadavg = yes # Load Average
# /sys/kernel/mm/ksm = yes # Memory deduper
netdata server resources = yes # netdata charts
2 changes: 2 additions & 0 deletions start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
netdata -p 80 -c /usr/src/app/netdataconfig.txt
python3 /usr/src/app/main.py

0 comments on commit 9cc339f

Please sign in to comment.