Mercurial > code > home > repos > infra
annotate pipe.py @ 105:95fcc05c2747
ntop systemd unit
author | drewp |
---|---|
date | Mon, 18 Jul 2022 18:13:47 -0700 |
parents | 8b8ef9d8f0fd |
children | 0833d1098983 |
rev | line source |
---|---|
105 | 1 from pyinfra.operations import apt, files, git, server, systemd |
96 | 2 |
3 | |
105 | 4 def ntop_build(): |
96 | 5 files.directory('/opt/ntop') |
103
8b8ef9d8f0fd
dead code and templates, reformat, maybe a little refactor
drewp@bigasterisk.com
parents:
96
diff
changeset
|
6 |
96 | 7 apt.packages(packages=[ |
8 "build-essential", "git", "bison", "flex", "libxml2-dev", "libpcap-dev", "libtool", "libtool-bin", "rrdtool", | |
9 "librrd-dev", "autoconf", "pkg-config", "automake", "autogen", "redis-server", "wget", "libsqlite3-dev", "libhiredis-dev", | |
10 "libmaxminddb-dev", "libcurl4-openssl-dev", "libpango1.0-dev", "libcairo2-dev", "libnetfilter-queue-dev", "zlib1g-dev", | |
11 "libssl-dev", "libcap-dev", "libnetfilter-conntrack-dev", "libreadline-dev", "libjson-c-dev", "libldap2-dev", "rename", | |
12 "libsnmp-dev", "libexpat1-dev", "libsnmp-dev", "libmaxminddb-dev", "libradcli-dev", "libjson-c-dev", "libzmq3-dev", | |
13 "libmariadb-dev" | |
14 ]) | |
15 git.repo(src='https://github.com/ntop/nDPI.git', dest='/opt/ntop/nDPI', branch='4.4-stable') | |
16 git.repo(src='https://github.com/ntop/ntopng.git', dest='/opt/ntop/ntopng', branch='5.4-stable') | |
17 | |
18 server.shell('cd /opt/ntop/nDPI; ./autogen.sh; ./configure; make -j 6') | |
19 server.shell('cd /opt/ntop/ntopng; ./autogen.sh; ./configure; make -j 6') | |
20 | |
105 | 21 def ntop_run(): |
96 | 22 |
105 | 23 files.template(src="templates/pipe/ntop.service.j2", dest="/etc/systemd/system/ntop.service") |
24 systemd.service(service='ntop.service', daemon_reload=True, enabled=True, running=True, restarted=True) | |
25 | |
26 | |
27 # ntop_build() | |
28 ntop_run() |