diff options
author | Sven Nierlein <sven@nierlein.de> | 2021-04-13 07:15:12 (GMT) |
---|---|---|
committer | Sven Nierlein <sven@nierlein.de> | 2021-04-30 07:56:52 (GMT) |
commit | fc71e3f9304ed51f3fd7ca544f38a30a590c8ba5 (patch) | |
tree | 3697fee9f0e6b4cafb53dd8d743ac7f40dfa2198 /.github/prepare_debian.sh | |
parent | 444a3579b2168eda949943a060bddff9ec95fd99 (diff) | |
download | monitoring-plugins-fc71e3f9304ed51f3fd7ca544f38a30a590c8ba5.tar.gz |
migrate travis ci to github actions
Diffstat (limited to '.github/prepare_debian.sh')
-rwxr-xr-x | .github/prepare_debian.sh | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/.github/prepare_debian.sh b/.github/prepare_debian.sh new file mode 100755 index 0000000..4005320 --- /dev/null +++ b/.github/prepare_debian.sh | |||
@@ -0,0 +1,99 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | set -x | ||
4 | set -e | ||
5 | |||
6 | export DEBIAN_FRONTEND=noninteractive | ||
7 | |||
8 | apt-get update | ||
9 | apt-get -y install software-properties-common | ||
10 | if [ $(lsb_release -is) = "Debian" ]; then | ||
11 | apt-add-repository non-free | ||
12 | apt-get update | ||
13 | fi | ||
14 | apt-get -y install perl autotools-dev libdbi-dev libldap2-dev libpq-dev libradcli-dev libnet-snmp-perl procps | ||
15 | apt-get -y install libdbi0-dev libdbd-sqlite3 libssl-dev dnsutils snmp-mibs-downloader libsnmp-perl snmpd | ||
16 | apt-get -y install fping snmp netcat smbclient vsftpd apache2 ssl-cert postfix libhttp-daemon-ssl-perl | ||
17 | apt-get -y install libdbd-sybase-perl libnet-dns-perl | ||
18 | apt-get -y install slapd ldap-utils | ||
19 | apt-get -y install gcc make autoconf automake gettext | ||
20 | apt-get -y install faketime | ||
21 | apt-get -y install libmonitoring-plugin-perl | ||
22 | apt-get -y install libcurl4-openssl-dev | ||
23 | apt-get -y install liburiparser-dev | ||
24 | apt-get -y install squid | ||
25 | apt-get -y install openssh-server | ||
26 | apt-get -y install mariadb-server mariadb-client libmariadb-dev | ||
27 | apt-get -y install cron iputils-ping | ||
28 | apt-get -y install iproute2 | ||
29 | |||
30 | # remove ipv6 interface from hosts | ||
31 | if [ $(ip addr show | grep "inet6 ::1" | wc -l) -eq "0" ]; then | ||
32 | sed '/^::1/d' /etc/hosts > /tmp/hosts | ||
33 | cp -f /tmp/hosts /etc/hosts | ||
34 | fi | ||
35 | |||
36 | ip addr show | ||
37 | |||
38 | cat /etc/hosts | ||
39 | |||
40 | |||
41 | # apache | ||
42 | a2enmod ssl | ||
43 | a2ensite default-ssl | ||
44 | make-ssl-cert generate-default-snakeoil --force-overwrite | ||
45 | service apache2 start | ||
46 | |||
47 | # squid | ||
48 | cp tools/squid.conf /etc/squid/squid.conf | ||
49 | service squid start | ||
50 | |||
51 | # mariadb | ||
52 | service mariadb start | ||
53 | mysql -e "create database IF NOT EXISTS test;" -uroot | ||
54 | |||
55 | # ldap | ||
56 | sed -e 's/cn=admin,dc=nodomain/'$(/usr/sbin/slapcat|grep ^dn:|awk '{print $2}')'/' -i .github/NPTest.cache | ||
57 | service slapd start | ||
58 | |||
59 | # sshd | ||
60 | ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa | ||
61 | cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys | ||
62 | service ssh start | ||
63 | sleep 1 | ||
64 | ssh-keyscan localhost >> ~/.ssh/known_hosts | ||
65 | touch ~/.ssh/config | ||
66 | |||
67 | # start one login session, required for check_users | ||
68 | ( ssh -n -tt root@localhost "top" < /dev/null >/dev/null 2>&1 & ) | ||
69 | sleep 1 | ||
70 | who | ||
71 | ssh root@localhost "top -b -n 1" | ||
72 | |||
73 | # snmpd | ||
74 | for DIR in /usr/share/snmp/mibs /usr/share/mibs; do | ||
75 | rm -f $DIR/ietf/SNMPv2-PDU \ | ||
76 | $DIR/ietf/IPSEC-SPD-MIB \ | ||
77 | $DIR/ietf/IPATM-IPMC-MIB \ | ||
78 | $DIR/iana/IANA-IPPM-METRICS-REGISTRY-MIB | ||
79 | done | ||
80 | mkdir -p /var/lib/snmp/mib_indexes | ||
81 | sed -e 's/^agentaddress.*/agentaddress 127.0.0.1/' -i /etc/snmp/snmpd.conf | ||
82 | service snmpd start | ||
83 | |||
84 | # start cron, will be used by check_nagios | ||
85 | cron | ||
86 | |||
87 | # start postfix | ||
88 | service postfix start | ||
89 | |||
90 | # start ftpd | ||
91 | service vsftpd start | ||
92 | |||
93 | # hostname | ||
94 | sed "/NP_HOST_TLS_CERT/s/.*/'NP_HOST_TLS_CERT' => '$(hostname)',/" -i /src/.github/NPTest.cache | ||
95 | |||
96 | # create some test files to lower inodes | ||
97 | for i in $(seq 10); do | ||
98 | touch /media/ramdisk2/test.$1 | ||
99 | done | ||