update all
This commit is contained in:
8
Librenms/librenms/files/etc/cron.d/librenms
Normal file
8
Librenms/librenms/files/etc/cron.d/librenms
Normal file
@ -0,0 +1,8 @@
|
||||
33 */6 * * * librenms . /etc/librenms_environment; /opt/librenms/discovery.php -h all >> /dev/null 2>&1
|
||||
*/5 * * * * librenms . /etc/librenms_environment; /opt/librenms/discovery.php -h new >> /dev/null 2>&1
|
||||
*/5 * * * * librenms . /etc/librenms_environment; /opt/librenms/cronic /opt/librenms/poller-wrapper.py 16
|
||||
15 0 * * * librenms . /etc/librenms_environment; /opt/librenms/daily.sh >> /dev/null 2>&1
|
||||
* * * * * librenms . /etc/librenms_environment; /opt/librenms/alerts.php >> /dev/null 2>&1
|
||||
*/5 * * * * librenms . /etc/librenms_environment; /opt/librenms/poll-billing.php >> /dev/null 2>&1
|
||||
01 * * * * librenms . /etc/librenms_environment; /opt/librenms/billing-calculate.php >> /dev/null 2>&1
|
||||
*/5 * * * * librenms . /etc/librenms_environment; /opt/librenms/check-services.php >> /dev/null 2>&1
|
15
Librenms/librenms/files/etc/my_init.d/0_cron
Normal file
15
Librenms/librenms/files/etc/my_init.d/0_cron
Normal file
@ -0,0 +1,15 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
LOCK_FILE=/var/lock/0_cron.lock
|
||||
|
||||
if [ -f "$LOCK_FILE" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -z "$POLLERS" ]; then
|
||||
POLLERS=8
|
||||
fi
|
||||
|
||||
sed -i "s/PLACEHOLDER_POLLERS/$POLLERS/g" /etc/cron.d/librenms
|
||||
|
||||
touch "$LOCK_FILE"
|
22
Librenms/librenms/files/etc/my_init.d/1_ssl
Normal file
22
Librenms/librenms/files/etc/my_init.d/1_ssl
Normal file
@ -0,0 +1,22 @@
|
||||
#!/bin/bash -eu
|
||||
|
||||
LOCK_FILE=/var/lock/1_ssl.lock
|
||||
|
||||
if [ -f "$LOCK_FILE" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
CONF_FILE=/etc/nginx/sites-available/librenms.https
|
||||
SSL_CERT=/etc/nginx/ssl/ssl.crt
|
||||
SSL_KEY=/etc/nginx/ssl/ssl.key
|
||||
SSL_OCSP=/etc/nginx/ssl/ssl.ocsp.crt
|
||||
|
||||
if [ -f "$SSL_CERT" ] && [ -f "$SSL_KEY" ]; then
|
||||
if [ -f "$SSL_OCSP" ]; then
|
||||
sed -i 's/#ssl_trusted_certificate/ssl_trusted_certificate/g' "$CONF_FILE"
|
||||
fi
|
||||
|
||||
ln -s "$CONF_FILE" /etc/nginx/sites-enabled/librenms.https
|
||||
fi
|
||||
|
||||
touch "$LOCK_FILE"
|
14
Librenms/librenms/files/etc/my_init.d/2_ipv6
Normal file
14
Librenms/librenms/files/etc/my_init.d/2_ipv6
Normal file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
LOCK_FILE=/var/lock/2_ipv6.lock
|
||||
|
||||
if [ -f "$LOCK_FILE" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -n "$DISABLE_IPV6" ]; then
|
||||
sed -i 's/listen \[::\]:80/#listen [::]:80/g' /etc/nginx/sites-enabled/librenms.http
|
||||
sed -i 's/listen \[::\]:443/#listen [::]:443/g' /etc/nginx/sites-available/librenms.https
|
||||
fi
|
||||
|
||||
touch "$LOCK_FILE"
|
20
Librenms/librenms/files/etc/my_init.d/3_config
Normal file
20
Librenms/librenms/files/etc/my_init.d/3_config
Normal file
@ -0,0 +1,20 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
function requireConfig() {
|
||||
if [ -z ${!1} ]; then
|
||||
echo "Error: $1 is unset"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
requireConfig DB_HOST
|
||||
requireConfig DB_USER
|
||||
requireConfig DB_PASS
|
||||
requireConfig DB_NAME
|
||||
requireConfig BASE_URL
|
||||
|
||||
cp /opt/librenms/config.docker.php /opt/librenms/config.php
|
||||
|
||||
if [ -f /opt/librenms/config.custom.php ]; then
|
||||
cat /opt/librenms/config.custom.php >> /opt/librenms/config.php
|
||||
fi
|
24
Librenms/librenms/files/etc/my_init.d/4_environment
Normal file
24
Librenms/librenms/files/etc/my_init.d/4_environment
Normal file
@ -0,0 +1,24 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
LOCK_FILE=/var/lock/4_environment.lock
|
||||
|
||||
if [ -f "$LOCK_FILE" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
function addConfig() {
|
||||
if [ -n "${!1}" ]; then
|
||||
echo "export $1=${!1}" >> /etc/librenms_environment
|
||||
fi
|
||||
}
|
||||
|
||||
addConfig DB_HOST
|
||||
addConfig DB_USER
|
||||
addConfig DB_PASS
|
||||
addConfig DB_NAME
|
||||
addConfig BASE_URL
|
||||
addConfig MEMCACHED_ENABLE
|
||||
addConfig MEMCACHED_HOST
|
||||
addConfig MEMCACHED_PORT
|
||||
|
||||
touch "$LOCK_FILE"
|
4
Librenms/librenms/files/etc/my_init.d/5_permissions
Normal file
4
Librenms/librenms/files/etc/my_init.d/5_permissions
Normal file
@ -0,0 +1,4 @@
|
||||
#!/bin/bash -eu
|
||||
|
||||
chown -R librenms:librenms /opt/librenms/logs /opt/librenms/rrd
|
||||
chmod -R u=rwX,g=rwX,o=rX /opt/librenms/logs /opt/librenms/rrd
|
13
Librenms/librenms/files/etc/nginx/dhparam.pem
Normal file
13
Librenms/librenms/files/etc/nginx/dhparam.pem
Normal file
@ -0,0 +1,13 @@
|
||||
-----BEGIN DH PARAMETERS-----
|
||||
MIICCAKCAgEAhJMm2xG4581l9U2dE5pHQdI3HEAj8kkQ6g0pDGKp9U8Lvkt+AZ9Z
|
||||
PsLCO9//hKN2VAbSAc3goBUnlt4Ej29pBgI80DFTOF5A/BEIuHwXGaWNNPGR1KBs
|
||||
jzzj0rd1baXCj5nAFsg8PL6bMXZlr00hJQlQToFf3ib2mkuMqrw2hxrpMCvYknbh
|
||||
ougJa8gqva/zhxZFurHnsOqCor8aXjDzOahxE9MM502lVIv/NZdn6aFgk7Pey/d6
|
||||
9bwRNnf33tCdz04jkzprsbe6wU9XUyfZqn2Xc94cTLIg/QkpKrMDgVBzTyn0NXwq
|
||||
YqsSxYdZQKp1U5/N3/KEnoJbWpH7ucZ8FcTZLq4hpPfz8O/FrgIqxLzSFf8MHOeI
|
||||
1cPiyXeL7SN2RWRCrh9Zh4gbE4uMt8DQwWX5PqdQ46NetOYgx4GksFmn804RiKU3
|
||||
Mmr0dYcoVMODB5goNEVPE0GBEL9rNnERuvM27L+HoFDkdiTtzVpFtSKM4CImatbH
|
||||
T2lb4+V3vUhFdbER1JPOHNC9H1FqnqYSndfA0PcY0hka2lRf1RK/E0HMZht/QROZ
|
||||
BpiK80YYgLoB2j/7EIw98SicIHPZrLat7+zg+rUSgzP9YrvcZeLJ1e5Fqgc+xVSF
|
||||
JLy0GUBfldGxQddwr0X8+8cTBlUrvgWt4v4CeojFWUWgtotRR6mw8csCAQI=
|
||||
-----END DH PARAMETERS-----
|
47
Librenms/librenms/files/etc/nginx/nginx.conf
Normal file
47
Librenms/librenms/files/etc/nginx/nginx.conf
Normal file
@ -0,0 +1,47 @@
|
||||
user www-data;
|
||||
worker_processes auto;
|
||||
pid /var/run/nginx.pid;
|
||||
daemon off;
|
||||
|
||||
events {
|
||||
worker_connections 2048;
|
||||
multi_accept on;
|
||||
}
|
||||
|
||||
http {
|
||||
server_tokens off;
|
||||
server_name_in_redirect on;
|
||||
index index.html index.htm index.php;
|
||||
|
||||
sendfile on;
|
||||
tcp_nopush on;
|
||||
tcp_nodelay on;
|
||||
|
||||
ssl_protocols TLSv1.2;
|
||||
ssl_prefer_server_ciphers off;
|
||||
ssl_ciphers ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDH-ECDSA-AES256-GCM-SHA384:ECDH-RSA-AES256-GCM-SHA384:DHE-DSS-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256;
|
||||
ssl_ecdh_curve secp384r1;
|
||||
ssl_session_cache builtin:1000 shared:SSL:64M;
|
||||
ssl_session_timeout 10m;
|
||||
ssl_dhparam /etc/nginx/dhparam.pem;
|
||||
resolver 8.8.8.8 8.8.4.4 valid=300s;
|
||||
resolver_timeout 5s;
|
||||
ssl_stapling on;
|
||||
ssl_stapling_verify on;
|
||||
|
||||
types_hash_max_size 2048;
|
||||
|
||||
charset utf-8;
|
||||
|
||||
access_log /var/log/nginx/access.log;
|
||||
error_log /var/log/nginx/error.log;
|
||||
|
||||
gzip on;
|
||||
gzip_vary on;
|
||||
gzip_types text/plain text/css text/javascript text/xml application/json application/x-javascript application/xml application/xml+rss application/x-font-ttf;
|
||||
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
include /etc/nginx/conf.d/*.conf;
|
||||
include /etc/nginx/sites-enabled/*;
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
server {
|
||||
listen 443 ssl http2 default_server;
|
||||
listen [::]:443 ssl http2 default_server;
|
||||
server_name _;
|
||||
root /opt/librenms/html;
|
||||
|
||||
ssl_certificate /etc/nginx/ssl/ssl.crt;
|
||||
ssl_certificate_key /etc/nginx/ssl/ssl.key;
|
||||
#ssl_trusted_certificate /etc/nginx/ssl/ssl.ocsp.crt;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ @librenms;
|
||||
}
|
||||
|
||||
location ~ \.php {
|
||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||
include fastcgi_params;
|
||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
}
|
||||
|
||||
location ~ /\.ht {
|
||||
deny all;
|
||||
}
|
||||
|
||||
location @librenms {
|
||||
rewrite api/v0(.*)$ /api_v0.php/$1 last;
|
||||
rewrite ^(.+)$ /index.php/$1 last;
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
server {
|
||||
listen 80 default_server;
|
||||
listen [::]:80 default_server;
|
||||
server_name _;
|
||||
root /opt/librenms/html;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ @librenms;
|
||||
}
|
||||
|
||||
location ~ \.php {
|
||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||
include fastcgi_params;
|
||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
}
|
||||
|
||||
location ~ /\.ht {
|
||||
deny all;
|
||||
}
|
||||
|
||||
location @librenms {
|
||||
rewrite api/v0(.*)$ /api_v0.php/$1 last;
|
||||
rewrite ^(.+)$ /index.php/$1 last;
|
||||
}
|
||||
}
|
@ -0,0 +1 @@
|
||||
include_path = ".:/usr/share/php:/usr/lib/php/pear"
|
@ -0,0 +1 @@
|
||||
include_path = ".:/usr/share/php:/usr/lib/php/pear"
|
@ -0,0 +1,7 @@
|
||||
opcache.enable = 1
|
||||
opcache.fast_shutdown = 1
|
||||
opcache.enable_file_override = 1
|
||||
opcache.revalidate_path = 1
|
||||
opcache.load_comments = 0
|
||||
opcache.save_comments = 0
|
||||
opcache.revalidate_freq = 60
|
@ -0,0 +1,2 @@
|
||||
; no memory limit for php
|
||||
memory_limit = -1
|
3
Librenms/librenms/files/etc/service/nginx/run
Normal file
3
Librenms/librenms/files/etc/service/nginx/run
Normal file
@ -0,0 +1,3 @@
|
||||
#!/bin/bash -eu
|
||||
|
||||
exec /usr/sbin/nginx
|
7
Librenms/librenms/files/etc/service/php-fpm/run
Normal file
7
Librenms/librenms/files/etc/service/php-fpm/run
Normal file
@ -0,0 +1,7 @@
|
||||
#!/bin/bash -eu
|
||||
|
||||
if [ ! -d /run/php ]; then
|
||||
mkdir /run/php
|
||||
fi
|
||||
|
||||
exec /usr/sbin/php-fpm7.0 --nodaemonize --fpm-config /etc/php/7.0/fpm/php-fpm.conf
|
5
Librenms/librenms/files/etc/service/rrdcached/run
Normal file
5
Librenms/librenms/files/etc/service/rrdcached/run
Normal file
@ -0,0 +1,5 @@
|
||||
#!/bin/bash -eu
|
||||
|
||||
rm -rf /var/run/rrdcached.pid
|
||||
|
||||
exec rrdcached -g -w 1800 -z 1800 -f 3600 -s librenms -U librenms -G librenms -B -R -j /var/tmp -l unix:/var/run/rrdcached/rrdcached.sock -t 4 -F -b /opt/librenms/rrd
|
26
Librenms/librenms/files/opt/librenms/config.docker.php
Normal file
26
Librenms/librenms/files/opt/librenms/config.docker.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
$config['db_host'] = getenv('DB_HOST');
|
||||
$config['db_user'] = getenv('DB_USER');
|
||||
$config['db_pass'] = getenv('DB_PASS');
|
||||
$config['db_name'] = getenv('DB_NAME');
|
||||
$config['db']['extension'] = 'mysqli';
|
||||
|
||||
$config['user'] = 'librenms';
|
||||
$config['base_url'] = getenv('BASE_URL');
|
||||
$config['snmp']['community'] = array("public");
|
||||
$config['auth_mechanism'] = "mysql";
|
||||
$config['rrd_purge'] = 0;
|
||||
$config['enable_billing'] = 1;
|
||||
$config['show_services'] = 1;
|
||||
$config['update'] = 0;
|
||||
|
||||
$config['nagios_plugins'] = "/usr/lib/nagios/plugins";
|
||||
|
||||
$config['rrdtool_version'] = '1.5.5';
|
||||
$config['rrdcached'] = "unix:/var/run/rrdcached/rrdcached.sock";
|
||||
|
||||
$config['memcached']['enable'] = filter_var(getenv('MEMCACHED_ENABLE'), FILTER_VALIDATE_BOOLEAN);
|
||||
$config['memcached']['host'] = getenv('MEMCACHED_HOST');
|
||||
$config['memcached']['port'] = getenv('MEMCACHED_PORT') ?: 11211;
|
||||
$config['memcached']['ttl'] = 240;
|
Reference in New Issue
Block a user