mirror of
https://github.com/librenms/docker.git
synced 2026-01-23 10:15:22 +00:00
Compare commits
585 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f45cd5726f | ||
|
|
c8216efc47 | ||
|
|
13776f56bc | ||
|
|
6120a5356f | ||
|
|
7cf198beb8 | ||
|
|
9e69ad4b34 | ||
|
|
937a473821 | ||
|
|
5b2223cb12 | ||
|
|
334b5424b2 | ||
|
|
e656df0d06 | ||
|
|
423576751e | ||
|
|
b1c0b87ed7 | ||
|
|
a5da060384 | ||
|
|
92966a6d55 | ||
|
|
b0fa29b1b8 | ||
|
|
ef86f21ba7 | ||
|
|
9626a79b83 | ||
|
|
8aa4cdcbb4 | ||
|
|
4959802e5a | ||
|
|
752ee95d5d | ||
|
|
9ae0056841 | ||
|
|
d1c96e0326 | ||
|
|
11b253c23e | ||
|
|
23fa3ab820 | ||
|
|
4e8d991e9b | ||
|
|
66e8b6113e | ||
|
|
3b386b40d9 | ||
|
|
e3e8e4e98c | ||
|
|
1ed08504ea | ||
|
|
aa5f718980 | ||
|
|
5a58858186 | ||
|
|
6d49dfa1bb | ||
|
|
ba3a99ac18 | ||
|
|
8c1baafeef | ||
|
|
d26f4c4db6 | ||
|
|
88c46f68f5 | ||
|
|
df3e2cc119 | ||
|
|
669535c9e6 | ||
|
|
add33c7dc3 | ||
|
|
eb7f5f601b | ||
|
|
785109c30e | ||
|
|
e1cbd62804 | ||
|
|
6d85c3055d | ||
|
|
0c842f183b | ||
|
|
a902ff5172 | ||
|
|
afbddbc9f4 | ||
|
|
5c9ff72471 | ||
|
|
eeb552f9d4 | ||
|
|
bf1674d489 | ||
|
|
4c3b0172b0 | ||
|
|
db3cc0803a | ||
|
|
3d3c0e5412 | ||
|
|
415dff8907 | ||
|
|
b6023d6e92 | ||
|
|
d611af74cf | ||
|
|
def2fe31b0 | ||
|
|
b881060ada | ||
|
|
f461572af6 | ||
|
|
ebe7f5076d | ||
|
|
1885d81fc3 | ||
|
|
7130dce0ac | ||
|
|
5b5927ba9d | ||
|
|
54bd47c374 | ||
|
|
74d179c244 | ||
|
|
d7b059db79 | ||
|
|
fdfd4c3d20 | ||
|
|
ac9e0329cb | ||
|
|
7632ef4601 | ||
|
|
b5a5b431c6 | ||
|
|
5004ab3263 | ||
|
|
1d7c972fab | ||
|
|
146a28d098 | ||
|
|
de9185e18a | ||
|
|
c05069b90a | ||
|
|
09717b7e27 | ||
|
|
ab00dbd2a5 | ||
|
|
5cb724210d | ||
|
|
e0a9d145b1 | ||
|
|
515d15ba5a | ||
|
|
b211ecaa74 | ||
|
|
1366d51a2d | ||
|
|
02b30caeca | ||
|
|
aeb4e238e3 | ||
|
|
7a13807ea5 | ||
|
|
94ba2e52a4 | ||
|
|
9c06661a73 | ||
|
|
df553f096e | ||
|
|
000bf44183 | ||
|
|
7828d6d2e0 | ||
|
|
bb454d0b23 | ||
|
|
eced9ae955 | ||
|
|
94b57ba456 | ||
|
|
993bd17cb2 | ||
|
|
3131ae9f5b | ||
|
|
6c185cd3e3 | ||
|
|
3fdcc0b230 | ||
|
|
68df0eb101 | ||
|
|
9bbe8f1d1d | ||
|
|
caf846857a | ||
|
|
15400f77e1 | ||
|
|
93eb528cbb | ||
|
|
fd34218028 | ||
|
|
d4242ab699 | ||
|
|
bc167c4f8d | ||
|
|
0f167f7062 | ||
|
|
57ae77c697 | ||
|
|
fe485f877a | ||
|
|
8b789d36f4 | ||
|
|
b823f6bc47 | ||
|
|
aa9fd2c1d7 | ||
|
|
b8493f7d1c | ||
|
|
ed3aa87814 | ||
|
|
e5b09b6dde | ||
|
|
78ef9bd4b7 | ||
|
|
bf27d28777 | ||
|
|
99fee57d6d | ||
|
|
ded183b473 | ||
|
|
d0ed3bb7d3 | ||
|
|
846881f816 | ||
|
|
d2fbcb10c5 | ||
|
|
5a69b6d497 | ||
|
|
4c8af274ec | ||
|
|
73ea05916e | ||
|
|
f0229dfab4 | ||
|
|
8ac8978614 | ||
|
|
498db0b86b | ||
|
|
bf4de1e754 | ||
|
|
93a2e0df01 | ||
|
|
7db9e84cfa | ||
|
|
e4fb7633d3 | ||
|
|
9ad6692bb2 | ||
|
|
c5451c1ece | ||
|
|
a9a54b1512 | ||
|
|
0850de591d | ||
|
|
2f114b035c | ||
|
|
20018068b0 | ||
|
|
97ff0fe6d8 | ||
|
|
af099d4cbe | ||
|
|
9d50911922 | ||
|
|
7abac7fb0c | ||
|
|
ce0f4d9a5f | ||
|
|
a88f2d0b1c | ||
|
|
b314a0d911 | ||
|
|
775fb7c5be | ||
|
|
c9e3f1b26e | ||
|
|
f4b894b26f | ||
|
|
01adc2c3fd | ||
|
|
01fed7dfe0 | ||
|
|
c25f5076e5 | ||
|
|
8d9cf3e991 | ||
|
|
e03b505d08 | ||
|
|
3874a7b505 | ||
|
|
ce5e994785 | ||
|
|
1168e59a3e | ||
|
|
cb5206846d | ||
|
|
6c07c0f4bb | ||
|
|
6c8286c0c6 | ||
|
|
8046ebe588 | ||
|
|
3e1aacbe7a | ||
|
|
aecf0a2648 | ||
|
|
16eaaf4fc0 | ||
|
|
c14d721377 | ||
|
|
90f2479639 | ||
|
|
229e794557 | ||
|
|
7ce699ce92 | ||
|
|
e62dc957ac | ||
|
|
74c391fe44 | ||
|
|
0ff799585b | ||
|
|
23c3e7559d | ||
|
|
a8481e1339 | ||
|
|
d36fd1e9e3 | ||
|
|
0540fd9512 | ||
|
|
d659c3d42e | ||
|
|
bdaf762827 | ||
|
|
9556df64ca | ||
|
|
18ef13c27c | ||
|
|
3cd6d96bc6 | ||
|
|
bccc520273 | ||
|
|
d56b8e7541 | ||
|
|
d6d3971d3d | ||
|
|
663fa6db11 | ||
|
|
453b31cc64 | ||
|
|
3ff31b4f6c | ||
|
|
deb81175df | ||
|
|
c70e3d3f0f | ||
|
|
9c1e7f46c3 | ||
|
|
fbde75c3c8 | ||
|
|
72e9f47e7f | ||
|
|
e44f17b4ec | ||
|
|
b97cdbd53f | ||
|
|
61507ca225 | ||
|
|
1d0c26d203 | ||
|
|
938828f65b | ||
|
|
4c05fc80c3 | ||
|
|
b2e30bf75f | ||
|
|
7cf09447a5 | ||
|
|
ee333d4357 | ||
|
|
e35fa8e600 | ||
|
|
00fa54010b | ||
|
|
0d2a2e3864 | ||
|
|
48251ee063 | ||
|
|
cabd8e407c | ||
|
|
aa962b1ba9 | ||
|
|
5d5c4fe6dc | ||
|
|
38791ad0af | ||
|
|
528545688d | ||
|
|
479e03be24 | ||
|
|
803f8a8cff | ||
|
|
d7496bbade | ||
|
|
e95987bcf2 | ||
|
|
2516b309d9 | ||
|
|
0af72265d4 | ||
|
|
dc731efce3 | ||
|
|
3c84a0a6b5 | ||
|
|
07f3baab8e | ||
|
|
afba315012 | ||
|
|
d57413a9cf | ||
|
|
27c4be0b7c | ||
|
|
3ec606df05 | ||
|
|
9c30554e81 | ||
|
|
d9dab05eb0 | ||
|
|
fc9666248d | ||
|
|
a9e2bbf252 | ||
|
|
6cece230da | ||
|
|
cedde585f6 | ||
|
|
a290b46d5d | ||
|
|
b48e1dc6e1 | ||
|
|
951008d69e | ||
|
|
a552bf285d | ||
|
|
f6a7b495c4 | ||
|
|
2c4abe5f34 | ||
|
|
b1c2fd7423 | ||
|
|
675c93441d | ||
|
|
c95e0d57b6 | ||
|
|
708131fe87 | ||
|
|
c8f4901ee3 | ||
|
|
6ad66f6007 | ||
|
|
17c9bd63ed | ||
|
|
7dc0719896 | ||
|
|
b102459a21 | ||
|
|
47df3999ac | ||
|
|
9316b6a081 | ||
|
|
4735fdba20 | ||
|
|
5f699da7e9 | ||
|
|
28e64d92ee | ||
|
|
4a9b6a27d1 | ||
|
|
0be2eaf77d | ||
|
|
41b329016f | ||
|
|
e4e5748a3c | ||
|
|
17733a097b | ||
|
|
a3ca4625fa | ||
|
|
1d2fb41aba | ||
|
|
766c8a6e81 | ||
|
|
81c09252bf | ||
|
|
768ba78da3 | ||
|
|
1fbca7d447 | ||
|
|
21ba60b288 | ||
|
|
b4836dca32 | ||
|
|
582edd1d2f | ||
|
|
00f8def153 | ||
|
|
7cbf636263 | ||
|
|
7f07e2ba8f | ||
|
|
8768a75b9b | ||
|
|
aeeacf3cd6 | ||
|
|
97485a60c9 | ||
|
|
c4c065d39e | ||
|
|
179f453c09 | ||
|
|
d44fa13ea5 | ||
|
|
6c90a3c889 | ||
|
|
7201be4290 | ||
|
|
c7e0f9f0c0 | ||
|
|
8ecb62da90 | ||
|
|
13474c860f | ||
|
|
b719b231e2 | ||
|
|
d95a775dea | ||
|
|
a453611d8e | ||
|
|
b4f921c300 | ||
|
|
f8b18336f8 | ||
|
|
9c27463bbf | ||
|
|
57b1df6596 | ||
|
|
a701a1d0fa | ||
|
|
6b9029dfcd | ||
|
|
0fe44f1d46 | ||
|
|
21d52c3117 | ||
|
|
d4b08e69fb | ||
|
|
b2d4ddb2c1 | ||
|
|
1111095afe | ||
|
|
12bf646980 | ||
|
|
5fc602e4a4 | ||
|
|
19e3a26943 | ||
|
|
36aa1601a4 | ||
|
|
08d98d38bf | ||
|
|
47f7d16158 | ||
|
|
3dcc7d7a69 | ||
|
|
3825abb2d8 | ||
|
|
957ca9e439 | ||
|
|
9c5dc1ae5c | ||
|
|
3640abdb7b | ||
|
|
4bb31cd6a5 | ||
|
|
b54299f950 | ||
|
|
491230f896 | ||
|
|
541c542bd3 | ||
|
|
16fe2c050e | ||
|
|
f9c0496021 | ||
|
|
2be3ce55fc | ||
|
|
48b8e4cd60 | ||
|
|
93be32f715 | ||
|
|
96c67e9204 | ||
|
|
cddc5e906a | ||
|
|
3efa499036 | ||
|
|
baca53ed29 | ||
|
|
f50355af7e | ||
|
|
a271596fc1 | ||
|
|
6bacd24dea | ||
|
|
ab027d7e85 | ||
|
|
03e71592a0 | ||
|
|
85ef301e40 | ||
|
|
daa7f37f9c | ||
|
|
6cf225069d | ||
|
|
fbe6cf7087 | ||
|
|
e612494bde | ||
|
|
263c47e895 | ||
|
|
8b1707a946 | ||
|
|
8301f68750 | ||
|
|
42fb44b987 | ||
|
|
55b5f93ef4 | ||
|
|
aff5d43251 | ||
|
|
fe9af3323e | ||
|
|
1d6627381c | ||
|
|
77f4c6104a | ||
|
|
ea17037275 | ||
|
|
49b492579b | ||
|
|
0c3e84d931 | ||
|
|
d933e76783 | ||
|
|
06d918843a | ||
|
|
da1cffdafe | ||
|
|
6477bd0c4e | ||
|
|
ea46055dab | ||
|
|
b410794a0a | ||
|
|
11d5a3acef | ||
|
|
7ed4bc231f | ||
|
|
70c94d3b84 | ||
|
|
432801e7c9 | ||
|
|
3e15edd030 | ||
|
|
60927b8d9a | ||
|
|
af6ec63e7d | ||
|
|
709240e29a | ||
|
|
bf2eea9de5 | ||
|
|
4a61bf26b7 | ||
|
|
84083b8a6d | ||
|
|
f15f998907 | ||
|
|
f37e540817 | ||
|
|
89b35ec4a2 | ||
|
|
740a665095 | ||
|
|
e0cd59c9ea | ||
|
|
b3fdfb6920 | ||
|
|
7e2a9f26c4 | ||
|
|
626b9ee479 | ||
|
|
f68d1b28b8 | ||
|
|
c94f69eb7d | ||
|
|
c9e6bcfe5a | ||
|
|
eecc7d8a59 | ||
|
|
163dcdbb23 | ||
|
|
9646691bf2 | ||
|
|
3323c616a7 | ||
|
|
3c0309b43a | ||
|
|
5a37ac37df | ||
|
|
1d2733b051 | ||
|
|
1a1c4899f8 | ||
|
|
edd80b0fc1 | ||
|
|
99b7d29203 | ||
|
|
47c8bf2af0 | ||
|
|
2f9215e36f | ||
|
|
6e1ecbb561 | ||
|
|
f21bdf7ef8 | ||
|
|
a858a4f5e2 | ||
|
|
d7e92cf497 | ||
|
|
ee2d7dd04d | ||
|
|
5c00943ddb | ||
|
|
4be8d30631 | ||
|
|
418a9e293c | ||
|
|
2734798d6c | ||
|
|
248c47b998 | ||
|
|
db32c6e043 | ||
|
|
9b875b5c42 | ||
|
|
9cab07ce75 | ||
|
|
c018f6a967 | ||
|
|
b6d48fa176 | ||
|
|
67e6921060 | ||
|
|
96b00b6f9c | ||
|
|
7bce19f268 | ||
|
|
efd41624b0 | ||
|
|
43851cf363 | ||
|
|
f3769c4a9c | ||
|
|
a8eb4b605d | ||
|
|
72e5c1f0d2 | ||
|
|
5275d5b533 | ||
|
|
1df9ee0ea9 | ||
|
|
e714a7aa19 | ||
|
|
0b03e2e417 | ||
|
|
8ce8147f42 | ||
|
|
ab70d73625 | ||
|
|
06f5b8caa4 | ||
|
|
3c3eec7326 | ||
|
|
6a6252d894 | ||
|
|
fd617cd7a2 | ||
|
|
0c5e471109 | ||
|
|
e00b3777d5 | ||
|
|
97099891e1 | ||
|
|
4d1bdba9bb | ||
|
|
9fad63bea5 | ||
|
|
f877e307eb | ||
|
|
004364f786 | ||
|
|
de203f6f09 | ||
|
|
351d95299f | ||
|
|
785f8b4d93 | ||
|
|
fee60a01c8 | ||
|
|
62a083f008 | ||
|
|
1088d9cdb3 | ||
|
|
986b7e7eaf | ||
|
|
721ce2815c | ||
|
|
155262e0d5 | ||
|
|
f33b3294d1 | ||
|
|
08664d8802 | ||
|
|
86c3d3f4b2 | ||
|
|
d6336d4f5e | ||
|
|
4b2c678d99 | ||
|
|
e35df14d42 | ||
|
|
944e949d11 | ||
|
|
6acb3577a7 | ||
|
|
39c753d1e8 | ||
|
|
68c9b01c0f | ||
|
|
7bd652f10a | ||
|
|
617a41f05b | ||
|
|
3cdecd3e00 | ||
|
|
7a2dfef43d | ||
|
|
f74e790a14 | ||
|
|
7daa8602b6 | ||
|
|
7693b6b44e | ||
|
|
72692bce06 | ||
|
|
d911499a47 | ||
|
|
ca84dd49cb | ||
|
|
286cd8d31d | ||
|
|
d982c7a74c | ||
|
|
8ea06f7624 | ||
|
|
062de7ff85 | ||
|
|
345a8d9233 | ||
|
|
a31f2a8840 | ||
|
|
457a614977 | ||
|
|
624b15beb1 | ||
|
|
75d5046430 | ||
|
|
af768511f2 | ||
|
|
54624eb62c | ||
|
|
260cbeef9e | ||
|
|
ae7ed07880 | ||
|
|
21118128e5 | ||
|
|
ad92ae4bae | ||
|
|
a0c4a93c53 | ||
|
|
b3c296eb21 | ||
|
|
027e9f48ae | ||
|
|
2f0af5d859 | ||
|
|
6ccfedd2a7 | ||
|
|
7935d50371 | ||
|
|
0f38a58bfe | ||
|
|
ee909221a8 | ||
|
|
4797423cae | ||
|
|
aeb070d3fc | ||
|
|
81106a65f4 | ||
|
|
705a44d9ad | ||
|
|
3156efff73 | ||
|
|
1ba2014e4d | ||
|
|
3a92d62e86 | ||
|
|
fbb387d0da | ||
|
|
1229a66464 | ||
|
|
4a5f8a0f4c | ||
|
|
66abae2189 | ||
|
|
616d2b901e | ||
|
|
31594a783f | ||
|
|
3313743ddb | ||
|
|
34d842341e | ||
|
|
a95e1ab194 | ||
|
|
8dae33ad08 | ||
|
|
f333dd5c52 | ||
|
|
62ba88cf8b | ||
|
|
2176933574 | ||
|
|
48e1c8343e | ||
|
|
d30292ec28 | ||
|
|
70403bfaf7 | ||
|
|
0377027362 | ||
|
|
e86031faf6 | ||
|
|
62cb36c280 | ||
|
|
ce51083aaf | ||
|
|
177b486e84 | ||
|
|
d627abc406 | ||
|
|
1fd872b086 | ||
|
|
7ba2b21ee7 | ||
|
|
a5f1e8412f | ||
|
|
2e663c5c54 | ||
|
|
9c77746198 | ||
|
|
55b58c96ab | ||
|
|
a9ed7ab954 | ||
|
|
ec94498f6b | ||
|
|
7cca9695e4 | ||
|
|
5ec49deacd | ||
|
|
5feee28958 | ||
|
|
d4851e8a9d | ||
|
|
a8dbf33c9e | ||
|
|
383885ef52 | ||
|
|
589e681bf1 | ||
|
|
41c5748799 | ||
|
|
539a10f233 | ||
|
|
85df683447 | ||
|
|
d801cf45ce | ||
|
|
9be7ec161b | ||
|
|
40e2a5b999 | ||
|
|
e997d7c152 | ||
|
|
d1784efc3e | ||
|
|
dab6b5eaad | ||
|
|
7b65d4b8b7 | ||
|
|
adf440e0b0 | ||
|
|
cc09f8a105 | ||
|
|
68d3c1030e | ||
|
|
cd44876e09 | ||
|
|
e909687d3e | ||
|
|
85c491fe32 | ||
|
|
8b9d2d1e59 | ||
|
|
46da123304 | ||
|
|
034a9b2606 | ||
|
|
e8a67d632f | ||
|
|
a511cb1953 | ||
|
|
23611c44ae | ||
|
|
9edf8d11a3 | ||
|
|
ef409c8a03 | ||
|
|
9a16c32fa3 | ||
|
|
ca16ae895b | ||
|
|
648aab4497 | ||
|
|
0e25067138 | ||
|
|
4da1d9d0b7 | ||
|
|
72e623be89 | ||
|
|
ca1f2de88b | ||
|
|
750260e05f | ||
|
|
bb6d4365e3 | ||
|
|
54186fb3ee | ||
|
|
9ef067c1aa | ||
|
|
849713e691 | ||
|
|
513ec328e4 | ||
|
|
b5d1ddbbe2 | ||
|
|
07f4d778d8 | ||
|
|
c49f850be0 | ||
|
|
29e944b897 | ||
|
|
83237bcb6c | ||
|
|
61485e9e3f | ||
|
|
93bec093c9 | ||
|
|
0750f30865 | ||
|
|
226b8495b6 | ||
|
|
3f433e2d2f | ||
|
|
b455610746 | ||
|
|
c2f269e19e | ||
|
|
2ed2b7639b | ||
|
|
952f0ca7f1 | ||
|
|
8fb36fbb16 | ||
|
|
f393bec0cc | ||
|
|
33ed56acca | ||
|
|
c86ef44695 | ||
|
|
cbc5144290 | ||
|
|
73d1ac1e43 | ||
|
|
5a7a17dc2b | ||
|
|
758814586e | ||
|
|
bb201eeb32 | ||
|
|
b79a632064 | ||
|
|
6173a6ccd9 | ||
|
|
d2f94c7368 | ||
|
|
75a29d365c | ||
|
|
d126d5bbfa | ||
|
|
40db93e32f | ||
|
|
645f76d350 | ||
|
|
4cf15d866d | ||
|
|
2dd37e345c | ||
|
|
23c4d47f1d | ||
|
|
e1bbb37f2d | ||
|
|
486e371fd4 | ||
|
|
e53856e09f | ||
|
|
76a68aa562 | ||
|
|
8798b73934 | ||
|
|
6bd6385a10 |
64 changed files with 2615 additions and 868 deletions
|
|
@ -1,13 +0,0 @@
|
|||
/.dev
|
||||
/.idea
|
||||
/*.iml
|
||||
|
||||
/.git
|
||||
/.res
|
||||
/examples
|
||||
/.editorconfig
|
||||
/.gitignore
|
||||
/.travis.yml
|
||||
/CHANGELOG.md
|
||||
/LICENSE
|
||||
/README.md
|
||||
|
|
@ -3,16 +3,13 @@ root = true
|
|||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[{Dockerfile,*.sh,*.yml}]
|
||||
indent_size = 2
|
||||
|
||||
[assets/**]
|
||||
[rootfs/**]
|
||||
insert_final_newline = false
|
||||
|
||||
[*.md]
|
||||
|
|
|
|||
2
.gitattributes
vendored
Normal file
2
.gitattributes
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
/*.sh linguist-detectable=false
|
||||
/rootfs/** linguist-detectable=false
|
||||
1
.github/CODEOWNERS
vendored
Normal file
1
.github/CODEOWNERS
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
* @crazy-max
|
||||
2
.github/FUNDING.yml
vendored
Normal file
2
.github/FUNDING.yml
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
github: crazy-max
|
||||
custom: https://www.paypal.me/crazyws
|
||||
91
.github/ISSUE_TEMPLATE/bug.yml
vendored
Normal file
91
.github/ISSUE_TEMPLATE/bug.yml
vendored
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema
|
||||
name: Bug Report
|
||||
description: Report a bug
|
||||
labels:
|
||||
- kind/bug
|
||||
- status/triage
|
||||
|
||||
body:
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Support guidelines
|
||||
description: Please read the support guidelines before proceeding.
|
||||
options:
|
||||
- label: I've read the [support guidelines](https://github.com/librenms/docker/blob/master/.github/SUPPORT.md)
|
||||
required: true
|
||||
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: I've found a bug and checked that ...
|
||||
description: |
|
||||
Make sure that your request fulfills all of the following requirements. If one requirement cannot be satisfied, explain in detail why.
|
||||
options:
|
||||
- label: ... the documentation does not mention anything about my problem
|
||||
- label: ... there are no open or closed issues that are related to my problem
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Description
|
||||
description: |
|
||||
Please provide a brief description of the bug in 1-2 sentences.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Expected behaviour
|
||||
description: |
|
||||
Please describe precisely what you'd expect to happen.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Actual behaviour
|
||||
description: |
|
||||
Please describe precisely what is actually happening.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Steps to reproduce
|
||||
description: |
|
||||
Please describe the steps to reproduce the bug.
|
||||
placeholder: |
|
||||
1. ...
|
||||
2. ...
|
||||
3. ...
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Docker info
|
||||
description: |
|
||||
Output of `docker info` command.
|
||||
render: text
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Docker Compose config
|
||||
description: |
|
||||
Output of `docker compose config` command.
|
||||
render: yaml
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Logs
|
||||
description: |
|
||||
Please provide the container logs (set `LOG_LEVEL=debug` if applicable).
|
||||
render: text
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Additional info
|
||||
description: |
|
||||
Please provide any additional information that seem useful.
|
||||
6
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
6
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#configuring-the-template-chooser
|
||||
blank_issues_enabled: true
|
||||
contact_links:
|
||||
- name: Questions and Discussions
|
||||
url: https://github.com/librenms/docker/discussions/new
|
||||
about: Use Github Discussions to ask questions and/or open discussion topics.
|
||||
15
.github/ISSUE_TEMPLATE/feature.yml
vendored
Normal file
15
.github/ISSUE_TEMPLATE/feature.yml
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema
|
||||
name: Feature request
|
||||
description: Missing functionality? Come tell us about it!
|
||||
labels:
|
||||
- kind/enhancement
|
||||
- status/triage
|
||||
|
||||
body:
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: Description
|
||||
description: What is the feature you want to see?
|
||||
validations:
|
||||
required: true
|
||||
29
.github/SUPPORT.md
vendored
Normal file
29
.github/SUPPORT.md
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
# Support [](https://isitmaintained.com/project/librenms/docker)
|
||||
|
||||
## Reporting an issue
|
||||
|
||||
Please do a search in [open issues](https://github.com/librenms/docker/issues?utf8=%E2%9C%93&q=) to see if the issue or feature request has already been filed.
|
||||
|
||||
If you find your issue already exists, make relevant comments and add your [reaction](https://github.com/blog/2119-add-reactions-to-pull-requests-issues-and-comments). Use a reaction in place of a "+1" comment.
|
||||
|
||||
:+1: - upvote
|
||||
|
||||
:-1: - downvote
|
||||
|
||||
If you cannot find an existing issue that describes your bug or feature, submit an issue using the guidelines below.
|
||||
|
||||
## Writing good bug reports and feature requests
|
||||
|
||||
File a single issue per problem and feature request.
|
||||
|
||||
* Do not enumerate multiple bugs or feature requests in the same issue.
|
||||
* Do not add your issue as a comment to an existing issue unless it's for the identical input. Many issues look similar, but have different causes.
|
||||
|
||||
The more information you can provide, the more likely someone will be successful reproducing the issue and finding a fix.
|
||||
|
||||
You are now ready to [create a new issue](https://github.com/librenms/docker/issues/new/choose)!
|
||||
|
||||
## Closure policy
|
||||
|
||||
* Issues that don't have the information requested above (when applicable) will be closed immediately and the poster directed to the support guidelines.
|
||||
* Issues that go a week without a response from original poster are subject to closure at my discretion.
|
||||
|
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 57 KiB |
73
.github/labels.yml
vendored
Normal file
73
.github/labels.yml
vendored
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
## more info https://github.com/crazy-max/ghaction-github-labeler
|
||||
-
|
||||
name: "bot"
|
||||
color: "69cde9"
|
||||
description: ""
|
||||
-
|
||||
name: "good first issue"
|
||||
color: "7057ff"
|
||||
description: ""
|
||||
-
|
||||
name: "help wanted"
|
||||
color: "4caf50"
|
||||
description: ""
|
||||
-
|
||||
name: "area/ci"
|
||||
color: "ed9ca9"
|
||||
description: ""
|
||||
-
|
||||
name: "area/dockerfile"
|
||||
color: "03a9f4"
|
||||
description: ""
|
||||
-
|
||||
name: "kind/bug"
|
||||
color: "b60205"
|
||||
description: ""
|
||||
-
|
||||
name: "kind/dependencies"
|
||||
color: "0366d6"
|
||||
description: ""
|
||||
-
|
||||
name: "kind/docs"
|
||||
color: "c5def5"
|
||||
description: ""
|
||||
-
|
||||
name: "kind/duplicate"
|
||||
color: "cccccc"
|
||||
description: ""
|
||||
-
|
||||
name: "kind/enhancement"
|
||||
color: "0054ca"
|
||||
description: ""
|
||||
-
|
||||
name: "kind/invalid"
|
||||
color: "e6e6e6"
|
||||
description: ""
|
||||
-
|
||||
name: "kind/upstream"
|
||||
color: "fbca04"
|
||||
description: ""
|
||||
-
|
||||
name: "kind/wontfix"
|
||||
color: "ffffff"
|
||||
description: ""
|
||||
-
|
||||
name: "status/automerge"
|
||||
color: "8f4fbc"
|
||||
description: ""
|
||||
-
|
||||
name: "status/needs-investigation"
|
||||
color: "e6625b"
|
||||
description: ""
|
||||
-
|
||||
name: "status/needs-more-info"
|
||||
color: "795548"
|
||||
description: ""
|
||||
-
|
||||
name: "status/stale"
|
||||
color: "237da0"
|
||||
description: ""
|
||||
-
|
||||
name: "status/triage"
|
||||
color: "dde4b7"
|
||||
description: ""
|
||||
16
.github/renovate.json
vendored
Normal file
16
.github/renovate.json
vendored
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"extends": [
|
||||
"config:recommended"
|
||||
],
|
||||
"customManagers": [
|
||||
{
|
||||
"customType": "regex",
|
||||
"description": "Update _VERSION variables in Dockerfiles",
|
||||
"fileMatch": ["(^|/|\\.)Dockerfile$", "(^|/)Dockerfile\\.[^/]*$"],
|
||||
"matchStrings": [
|
||||
"# renovate: datasource=(?<datasource>[a-z-]+?)(?: depName=(?<depName>.+?))? packageName=(?<packageName>.+?)(?: versioning=(?<versioning>[a-z-]+?))?\\s(?:ENV|ARG) .+?_VERSION=\"(?<currentValue>.+?)\"\\s"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
77
.github/workflows/build.yml
vendored
Normal file
77
.github/workflows/build.yml
vendored
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
name: build
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
tags:
|
||||
- '*'
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
|
||||
env:
|
||||
DOCKERHUB_SLUG: librenms/librenms
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Login to DockerHub
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
-
|
||||
name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: |
|
||||
${{ env.DOCKERHUB_SLUG }}
|
||||
tags: |
|
||||
type=match,pattern=(.*)-r,group=1
|
||||
type=ref,event=pr
|
||||
type=edge
|
||||
labels: |
|
||||
org.opencontainers.image.title=LibreNMS
|
||||
org.opencontainers.image.description=Fully featured network monitoring system
|
||||
org.opencontainers.image.vendor=LibreNMS
|
||||
-
|
||||
name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
-
|
||||
name: Build
|
||||
uses: docker/bake-action@v6
|
||||
with:
|
||||
files: |
|
||||
./docker-bake.hcl
|
||||
cwd://${{ steps.meta.outputs.bake-file }}
|
||||
targets: image-all
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
-
|
||||
name: Check manifest
|
||||
if: github.event_name != 'pull_request'
|
||||
run: |
|
||||
docker buildx imagetools inspect ${{ env.DOCKERHUB_SLUG }}:${{ steps.meta.outputs.version }}
|
||||
-
|
||||
name: Inspect
|
||||
if: github.event_name != 'pull_request'
|
||||
run: |
|
||||
docker pull ${{ env.DOCKERHUB_SLUG }}:${{ steps.meta.outputs.version }}
|
||||
docker image inspect ${{ env.DOCKERHUB_SLUG }}:${{ steps.meta.outputs.version }}
|
||||
39
.github/workflows/labels.yml
vendored
Normal file
39
.github/workflows/labels.yml
vendored
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
name: labels
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
paths:
|
||||
- '.github/labels.yml'
|
||||
- '.github/workflows/labels.yml'
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/labels.yml'
|
||||
- '.github/workflows/labels.yml'
|
||||
|
||||
jobs:
|
||||
labeler:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
# same as global permissions
|
||||
contents: read
|
||||
# required to update labels
|
||||
issues: write
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Run Labeler
|
||||
uses: crazy-max/ghaction-github-labeler@v5
|
||||
with:
|
||||
dry-run: ${{ github.event_name == 'pull_request' }}
|
||||
81
.github/workflows/test.yml
vendored
Normal file
81
.github/workflows/test.yml
vendored
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
name: test
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
|
||||
env:
|
||||
BUILD_TAG: librenms:test
|
||||
CONTAINER_NAME: librenms
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
continue-on-error: ${{ matrix.version == 'master' }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
version:
|
||||
- ''
|
||||
- master
|
||||
steps:
|
||||
-
|
||||
name: Prepare
|
||||
if: matrix.version != ''
|
||||
run: |
|
||||
echo "LIBRENMS_VERSION=${{ matrix.version }}" >> $GITHUB_ENV
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
-
|
||||
name: Build
|
||||
uses: docker/bake-action@v6
|
||||
with:
|
||||
source: .
|
||||
targets: image-local
|
||||
env:
|
||||
DEFAULT_TAG: ${{ env.BUILD_TAG }}
|
||||
-
|
||||
name: Start
|
||||
run: |
|
||||
docker compose up -d
|
||||
working-directory: test
|
||||
env:
|
||||
LIBRENMS_IMAGE: ${{ env.BUILD_TAG }}
|
||||
LIBRENMS_CONTAINER: ${{ env.CONTAINER_NAME }}
|
||||
-
|
||||
name: Check container logs
|
||||
uses: crazy-max/.github/.github/actions/container-logs-check@main
|
||||
with:
|
||||
container_name: ${{ env.CONTAINER_NAME }}
|
||||
log_check: "ready to handle connections"
|
||||
timeout: 120
|
||||
-
|
||||
name: Logs
|
||||
if: always()
|
||||
run: |
|
||||
docker compose logs
|
||||
working-directory: test
|
||||
env:
|
||||
LIBRENMS_IMAGE: ${{ env.BUILD_TAG }}
|
||||
LIBRENMS_CONTAINER: ${{ env.CONTAINER_NAME }}
|
||||
9
.gitignore
vendored
9
.gitignore
vendored
|
|
@ -1,9 +0,0 @@
|
|||
# Jetbrains
|
||||
/.idea
|
||||
/*.iml
|
||||
|
||||
# Visual Studio Code
|
||||
/.vscode
|
||||
|
||||
# App
|
||||
/.dev
|
||||
BIN
.res/paypal.png
BIN
.res/paypal.png
Binary file not shown.
|
Before Width: | Height: | Size: 7.5 KiB |
62
.travis.yml
62
.travis.yml
|
|
@ -1,62 +0,0 @@
|
|||
sudo: required
|
||||
|
||||
services:
|
||||
- docker
|
||||
|
||||
env:
|
||||
global:
|
||||
- VERSION=1.43
|
||||
- GITHUB_REPO=crazy-max/docker-librenms
|
||||
- DOCKER_USERNAME=crazymax
|
||||
- DOCKER_REPONAME=librenms
|
||||
- QUAY_USERNAME=crazymax
|
||||
- QUAY_REPONAME=librenms
|
||||
- MICROBADGER_HOOK=https://hooks.microbadger.com/images/crazymax/librenms/-iJon04e52FswWvLC-zkB6yi2vo=
|
||||
- secure: GMYFptO3rWVVITjC0Wz8g9uccBjSMBvVt3aFC3Y08/3Hw9CoA/SS51X/2lh0bRn+y49X0742QC7b2LtSWa3eERM1HbzlS1ODK75+P0lGYdtW2Ng5JutI+GRt8xTouY7+iP4qSAbOYMUdM5e61PkRepJvZWVeBkPtAtcGpxZO75h+snFxuzFVZXWLoSKjByKIqy9VXzT2P0Wx+zuUWpeo2qA62ONRJf5RjIKCDxHmWEwhXKmmDjeqo+Db/zsUwGYSwKpKRGBhyPVP0MnKFA2HQ/+dG1NyikXhae5dhjaZvgG9tSpbYdOWCHCunbxm6VWozt/kvkqkbizn+S3aoeeZyco40ZFIUinpypxw/nZpVvfDkwBIhw3nOS4giMKHLLBtnkSZw2szP6zfdLX6MLKWSjcDsBbtqj8aNe8Z1ViEKc2uW+yqJvd6GNnDL+AINe5rJ/cjeseh1ancOaGG8tlGsg/80dhOV3l+E4nINn+1uj354ncH/lv14e4giDNMGRw8gq7HFWxIE1X8SLetK9Hz5kLyMIPlSCO2fL73adrqfJFFluTQ0CbzsOEHSuScHT8i9UJWrqcu25BQ4pKidmDAt0gT7x6cz7zziuTY0hTO05txIP0FCop0qCFoLuAGM/bQg8r6FnfIZu4NbUxutjLiAN5aMB1D3znnymxKdeX/HOc= # DOCKER_PASSWORD
|
||||
- secure: XMkF9Nz6FjKVB52vv7rZ+fa7vDDRXG7/nDm5Wio4eljYU/+cIZwdbBv2hU2IEmherZBn2jO9V64LYR9yTLALOGMEjqE/0E8KNiibj7VRjeRmtQrTHbUj7XpBmqAVyNek2GxkmtS4meOIcUUxBOfCAiIu2b++iuR70rAHvr+dL8skX7FNG77ZgTRsP9VkCylyfw0qb+50pD+2ukOFHxZ4tSi89F8ZU4UQOiNTBre4NUPCN5DZmglSt4nUYt3iofKs9p4ZjPP0cTBpHhArn37VZJyo1tOcl1jP8x18PVvgxrHO8Z0FQCasnZ6O269FR8lF28yM4CwHxk6ufCuieCCj5f0ez6S8IEv82a8ljmw+a75Gb6+pAmYB8nY49VkrWmA6KoDY+F+Ob30QOOtLCGumGBLZ1++6MOtwFjN5BzAyVl3Qhl+9heUMM3ULkbEV0IGJHL1M3zEBqxkQO6urdgf6cPEf3uldd+T6Ochn2DZ42Ge+yiZiIrgF/p0R3l1vDbyBG6OcnmaEoQWdIgqa6DUV48MBkYHF9Sp0idUbsrOaoVNsZZ4h0P72fRci/rElvoDGJIAdFEEE1ZW/y3a6hJihxvYQM9+S+HvzluI+5SKzdFUJ4hRpaGfIvclKdyaCNSE1B0VrwGXn7pBt5tem0IZnE5BQ9d/6TgVFc+L2Eyf7Mck= # QUAY_PASSWORD
|
||||
- secure: mLY2C4Ggmg/VUdWoYc8vqYQb7lLSSB/YMvKUzY+z8VGAi5A8J1A6oTgeeThiKPWaNp9GgU1hdHA5WqoSCuOk2SzJoIEhnPU0j3GkDknuXmbhU1UXsuefMF++v2J9RarmC2CkyGiBDzJCrcs9srcS6RjmbK7hQv5EsbkjjyQHQwZlMG+q2aUwNcNxhAeD0+gn8j6eZ6myxt/SJ3LZRLCb+ZpP1NITc6aHjC9glc6ZO7bTy6WG6SVg0SREdxbht+cUrTNQvAcIkoEZQ4vOJBi3kAo6aZz6QYglofaYpTCdmiSSFGHseJ7k1Dl+khCL8OqeOnVCOkcu8SgPV7tI6WId8Dky/YPUsFtjivJqekjs/ctAekOHTzJW9UeOLkCOiqeLmQTDQ01JDLno1znzMOTC3T96I5d2LUnob3QOu32chdzqw0LfcawcuNnLwLdbK4AwPcDuIUl6b1FjU6I8DckHjtvL9Mr9xLhIkNrhdPW0vAj8yZkvGCxvGXh+qK6ejNDt/RdH6wWojh1yTbJSCAQLo1WnJ5YpqLxtu5++/4PfiTLkt7u8QMnau5m+8wZ4ju2RfFrwmEaKkrZSkq7ViQ+RsI/y0bNxUzk3Bb02Wgh9MfpPUXLA+4llYWIPnbgL17N5zhsROp9u0YSbzc3cWJm+0TQZZ0hAjyXBDoT2UCsDNqE= # GITHUB_TOKEN
|
||||
|
||||
before_install:
|
||||
- sudo apt-get update
|
||||
- docker --version
|
||||
- export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)
|
||||
- export DOCKER_TAG=$(if [ "$BRANCH" == "master" ]; then echo "latest"; else echo $BRANCH; fi)
|
||||
- echo "TRAVIS_BRANCH=$TRAVIS_BRANCH, PR=$PR, BRANCH=$BRANCH, DOCKER_TAG=$DOCKER_TAG"
|
||||
|
||||
install:
|
||||
- |
|
||||
docker build --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
|
||||
--build-arg VCS_REF=${TRAVIS_COMMIT::8} \
|
||||
--build-arg VERSION=${VERSION} \
|
||||
-t $DOCKER_USERNAME/$DOCKER_REPONAME .
|
||||
|
||||
before_script:
|
||||
- docker network create -d bridge $DOCKER_REPONAME
|
||||
- docker run -d --network=$DOCKER_REPONAME --name db mariadb:10.2
|
||||
- docker run -d --network=$DOCKER_REPONAME --link db -p 8000:80 -e "DB_HOST=db" -e "DB_PASSWORD=asupersecretpassword" --name $DOCKER_REPONAME $DOCKER_USERNAME/$DOCKER_REPONAME
|
||||
- sleep 20
|
||||
- docker logs $DOCKER_REPONAME
|
||||
|
||||
script:
|
||||
- docker ps | grep $DOCKER_REPONAME
|
||||
|
||||
after_success:
|
||||
- |
|
||||
test $TRAVIS_PULL_REQUEST = false \
|
||||
&& echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin \
|
||||
&& docker tag $DOCKER_USERNAME/$DOCKER_REPONAME $DOCKER_USERNAME/$DOCKER_REPONAME:$DOCKER_TAG \
|
||||
&& docker tag $DOCKER_USERNAME/$DOCKER_REPONAME $DOCKER_USERNAME/$DOCKER_REPONAME:$VERSION \
|
||||
&& docker push $DOCKER_USERNAME/$DOCKER_REPONAME \
|
||||
&& echo "$QUAY_PASSWORD" | docker login quay.io --username "$QUAY_USERNAME" --password-stdin \
|
||||
&& docker tag $DOCKER_USERNAME/$DOCKER_REPONAME quay.io/$DOCKER_USERNAME/$DOCKER_REPONAME:$DOCKER_TAG \
|
||||
&& docker tag $DOCKER_USERNAME/$DOCKER_REPONAME quay.io/$DOCKER_USERNAME/$DOCKER_REPONAME:$VERSION \
|
||||
&& docker push quay.io/$QUAY_USERNAME/$QUAY_REPONAME \
|
||||
&& curl -X POST $MICROBADGER_HOOK
|
||||
|
||||
branches:
|
||||
except:
|
||||
- /^[0-9]/
|
||||
|
||||
notifications:
|
||||
webhooks:
|
||||
secure: qy/lFOFGeP0IMvDTJZmPemOtHjkpnYq4sm734rTjBsKFNA8MU4TyWCnx24hljRd4YazAkH6j2Uav3XfmnR+UGfutXRsmktzZoDTlygiJLP/026gvD+VuT8GZIFXRpYhNlfPemFoN2/wO5sf91JGQL4cxVcF9r1A0aUQUtAzvl9UKwk+DRc9Y78oCKRmIaeoFrvKE1SCGPf/drNYeLKJiRiq7VV5jL+1tmZUjYKWVYnWU3yYSyg3OdAvXAVEDagzvAQ0ors9UJeXxAsAls0kTQc8c2+uWfEH411sRrPuqTYYkXIPQpJszLeDhG0ISU5xs5UCJSi7QzTRxD5lWgn8C2QfGS8x3eQK8fHEfN1Q0frqGdCYJcEC2izs91bwZDmFmDj9B0mkuOyHDjWmTIo+HPkb/ryATFD3Bk2pekHWBkuq+KKTQzvgtgokp4V7xRumDh7htyYzr88uk1EQFR7VY05aWFGFsoZ13oKa4UQ4uglH2xmWVW3X9cyf5NCj/t4mUt5223ZM7Q+LKDONSPz/VEDlSOkPapjC4rpn6mn/k6FNN3UyC4hL9+HXSFyCOJZDy3P6lagCWWlzLxt0R4DnptZG+cShW0+bzcecEaGPjyEidACctKl3hfDCiblg05Js0lvW454C4TPnzZ/tDAE6VE8mCFtU/K1ur+wneZuOv2pA=
|
||||
30
CHANGELOG.md
30
CHANGELOG.md
|
|
@ -1,30 +0,0 @@
|
|||
# Changelog
|
||||
|
||||
## 1.43-RC2 (2018/09/24)
|
||||
|
||||
* Add CAP_NET_RAW on nmap and fping
|
||||
* Fixes for `validate.php` nologin errors and missing setfacl binaries
|
||||
* Add fping6 support
|
||||
* Add `rrdtool_version`
|
||||
* Ability to configure distributed polling
|
||||
* Adding python-memcached module required for distributed poller setup
|
||||
* Configurable DB_TIMEOUT
|
||||
* Allow setting sensible variables through files
|
||||
* Ability to override Memcached and RRD ports
|
||||
|
||||
## 1.43-RC1 (2018/09/10)
|
||||
|
||||
* Upgrade to LibreNMS 1.43
|
||||
|
||||
## 1.42.01-RC1 (2018/08/05)
|
||||
|
||||
* Upgrade to LibreNMS 1.42.01
|
||||
|
||||
## 1.42-RC1 (2018/08/02)
|
||||
|
||||
* Upgrade to LibreNMS 1.42
|
||||
* Add syslog-ng support
|
||||
|
||||
## 1.41-RC1 (2018/07/07)
|
||||
|
||||
* Initial version based on LibreNMS 1.41
|
||||
196
Dockerfile
196
Dockerfile
|
|
@ -1,111 +1,147 @@
|
|||
FROM alpine:3.8
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
ARG BUILD_DATE
|
||||
ARG VCS_REF
|
||||
ARG VERSION
|
||||
|
||||
LABEL maintainer="CrazyMax" \
|
||||
org.label-schema.build-date=$BUILD_DATE \
|
||||
org.label-schema.name="librenms" \
|
||||
org.label-schema.description="LibreNMS based on Alpine Linux and Nginx" \
|
||||
org.label-schema.version=$VERSION \
|
||||
org.label-schema.url="https://github.com/crazy-max/docker-librenms" \
|
||||
org.label-schema.vcs-ref=$VCS_REF \
|
||||
org.label-schema.vcs-url="https://github.com/crazy-max/docker-librenms" \
|
||||
org.label-schema.vendor="CrazyMax" \
|
||||
org.label-schema.schema-version="1.0"
|
||||
# renovate: datasource=github-releases packageName=librenms/librenms versioning=semver
|
||||
ARG LIBRENMS_VERSION="26.1.1"
|
||||
ARG ALPINE_VERSION="3.22"
|
||||
ARG SYSLOGNG_VERSION="4.8.3-r1"
|
||||
|
||||
FROM crazymax/yasu:latest AS yasu
|
||||
FROM crazymax/alpine-s6:${ALPINE_VERSION}-2.2.0.3
|
||||
COPY --from=yasu / /
|
||||
RUN apk --update --no-cache add \
|
||||
busybox-extras \
|
||||
acl \
|
||||
bash \
|
||||
bind-tools \
|
||||
binutils \
|
||||
ca-certificates \
|
||||
coreutils \
|
||||
curl \
|
||||
file \
|
||||
fping \
|
||||
git \
|
||||
graphviz \
|
||||
imagemagick \
|
||||
ipmitool \
|
||||
iputils \
|
||||
libcap-utils \
|
||||
mariadb-client \
|
||||
monitoring-plugins \
|
||||
mtr \
|
||||
mysql-client \
|
||||
net-snmp \
|
||||
net-snmp-tools \
|
||||
nginx \
|
||||
nmap \
|
||||
openssl \
|
||||
php7 \
|
||||
php7-cli \
|
||||
php7-ctype \
|
||||
php7-curl \
|
||||
php7-fpm \
|
||||
php7-gd \
|
||||
php7-json \
|
||||
php7-mbstring \
|
||||
php7-mcrypt \
|
||||
php7-memcached \
|
||||
php7-mysqli \
|
||||
php7-opcache \
|
||||
php7-openssl \
|
||||
php7-pdo \
|
||||
php7-pdo_mysql \
|
||||
php7-phar \
|
||||
php7-posix \
|
||||
php7-session \
|
||||
php7-simplexml \
|
||||
php7-snmp \
|
||||
php7-tokenizer \
|
||||
php7-xml \
|
||||
php7-zip \
|
||||
py-mysqldb \
|
||||
py2-pip \
|
||||
python2 \
|
||||
openssh-client \
|
||||
perl \
|
||||
php83 \
|
||||
php83-cli \
|
||||
php83-ctype \
|
||||
php83-curl \
|
||||
php83-dom \
|
||||
php83-fileinfo \
|
||||
php83-fpm \
|
||||
php83-gd \
|
||||
php83-gmp \
|
||||
php83-iconv \
|
||||
php83-json \
|
||||
php83-ldap \
|
||||
php83-mbstring \
|
||||
php83-mysqlnd \
|
||||
php83-opcache \
|
||||
php83-openssl \
|
||||
php83-pdo \
|
||||
php83-pdo_mysql \
|
||||
php83-pecl-memcached \
|
||||
php83-pear \
|
||||
php83-phar \
|
||||
php83-posix \
|
||||
php83-session \
|
||||
php83-simplexml \
|
||||
php83-snmp \
|
||||
php83-sockets \
|
||||
php83-tokenizer \
|
||||
php83-xml \
|
||||
php83-xmlwriter \
|
||||
php83-zip \
|
||||
python3 \
|
||||
py3-pip \
|
||||
rrdtool \
|
||||
runit \
|
||||
sed \
|
||||
shadow \
|
||||
supervisor \
|
||||
syslog-ng \
|
||||
tzdata \
|
||||
ttf-dejavu \
|
||||
tzdata \
|
||||
util-linux \
|
||||
whois \
|
||||
&& pip install python-memcached \
|
||||
&& sed -i -e "s/;date\.timezone.*/date\.timezone = UTC/" /etc/php7/php.ini \
|
||||
&& rm -rf /var/cache/apk/* /var/www/* /tmp/* \
|
||||
&& apk --update --no-cache add -t build-dependencies \
|
||||
build-base \
|
||||
make \
|
||||
mariadb-dev \
|
||||
musl-dev \
|
||||
python3-dev \
|
||||
&& pip3 install --upgrade --break-system-packages pip \
|
||||
&& pip3 install python-memcached mysqlclient --upgrade --break-system-packages \
|
||||
&& curl -sSL https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer \
|
||||
&& apk del build-dependencies \
|
||||
&& rm -rf /var/www/* /tmp/* \
|
||||
&& echo "/usr/sbin/fping -6 \$@" > /usr/sbin/fping6 \
|
||||
&& chmod +x /usr/sbin/fping6 \
|
||||
&& chmod u+s,g+s \
|
||||
/bin/ping \
|
||||
/bin/ping6 \
|
||||
/usr/lib/monitoring-plugins/check_icmp \
|
||||
&& setcap cap_net_raw+ep /usr/bin/nmap \
|
||||
&& setcap cap_net_raw+ep /usr/sbin/fping
|
||||
&& setcap cap_net_raw+ep /usr/sbin/fping \
|
||||
&& setcap cap_net_raw+ep /usr/sbin/fping6 \
|
||||
&& setcap cap_net_raw+ep /usr/lib/monitoring-plugins/check_icmp \
|
||||
&& setcap cap_net_raw+ep /usr/lib/monitoring-plugins/check_ping
|
||||
|
||||
ENV LIBRENMS_VERSION="1.43" \
|
||||
ARG SYSLOGNG_VERSION
|
||||
RUN apk --update --no-cache add syslog-ng=${SYSLOGNG_VERSION}
|
||||
|
||||
ENV S6_BEHAVIOUR_IF_STAGE2_FAILS="2" \
|
||||
LIBRENMS_PATH="/opt/librenms" \
|
||||
DATA_PATH="/data" \
|
||||
CRONTAB_PATH="/var/spool/cron/crontabs"
|
||||
LIBRENMS_DOCKER="1" \
|
||||
TZ="UTC" \
|
||||
PUID="1000" \
|
||||
PGID="1000"
|
||||
|
||||
RUN mkdir -p /opt \
|
||||
&& addgroup -g 1000 librenms \
|
||||
&& adduser -u 1000 -G librenms -h ${LIBRENMS_PATH} -s /bin/sh -D librenms \
|
||||
&& passwd -l librenms \
|
||||
&& usermod -a -G librenms nginx \
|
||||
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer \
|
||||
&& git clone --branch ${LIBRENMS_VERSION} https://github.com/librenms/librenms.git ${LIBRENMS_PATH} \
|
||||
&& chown -R librenms. ${LIBRENMS_PATH} \
|
||||
&& su - librenms -c "composer install --no-dev --no-interaction --no-ansi --working-dir=${LIBRENMS_PATH}" \
|
||||
&& wget -q https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/distro -O /usr/bin/distro \
|
||||
&& chmod +x /usr/bin/distro \
|
||||
&& rm -rf /tmp/*
|
||||
RUN addgroup -g ${PGID} librenms \
|
||||
&& adduser -D -h /home/librenms -u ${PUID} -G librenms -s /bin/sh -D librenms \
|
||||
&& curl -sSLk -q https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/distro -o /usr/bin/distro \
|
||||
&& chmod +x /usr/bin/distro
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
COPY assets /
|
||||
|
||||
RUN mkdir -p /data ${LIBRENMS_PATH}/config.d /var/log/supervisord \
|
||||
&& chmod a+x /entrypoint.sh /usr/local/bin/* \
|
||||
&& cp ${LIBRENMS_PATH}/snmpd.conf.example /etc/snmp/snmpd.conf \
|
||||
&& cp ${LIBRENMS_PATH}/config.php.default ${LIBRENMS_PATH}/config.php \
|
||||
&& echo "foreach (glob(\"${DATA_PATH}/config/*.php\") as \$filename) include \$filename;" >> ${LIBRENMS_PATH}/config.php \
|
||||
&& echo "foreach (glob(\"${LIBRENMS_PATH}/config.d/*.php\") as \$filename) include \$filename;" >> ${LIBRENMS_PATH}/config.php \
|
||||
&& chown -R librenms. ${DATA_PATH} ${LIBRENMS_PATH} \
|
||||
&& chown -R nginx. /var/lib/nginx /var/log/nginx /var/log/php7 /var/tmp/nginx
|
||||
|
||||
EXPOSE 80 514 514/udp
|
||||
WORKDIR ${LIBRENMS_PATH}
|
||||
VOLUME [ "${DATA_PATH}" ]
|
||||
ARG LIBRENMS_VERSION
|
||||
ARG WEATHERMAP_PLUGIN_COMMIT
|
||||
RUN apk --update --no-cache add -t build-dependencies \
|
||||
build-base \
|
||||
linux-headers \
|
||||
musl-dev \
|
||||
python3-dev \
|
||||
&& echo "Installing LibreNMS https://github.com/librenms/librenms.git#${LIBRENMS_VERSION}..." \
|
||||
&& git clone --depth=1 --branch ${LIBRENMS_VERSION} https://github.com/librenms/librenms.git . \
|
||||
&& pip3 install --ignore-installed -r requirements.txt --upgrade --break-system-packages \
|
||||
&& mkdir config.d \
|
||||
&& cp config.php.default config.php \
|
||||
&& cp snmpd.conf.example /etc/snmp/snmpd.conf \
|
||||
&& sed -i '/runningUser/d' lnms \
|
||||
&& echo "foreach (glob(\"/data/config/*.php\") as \$filename) include \$filename;" >> config.php \
|
||||
&& echo "foreach (glob(\"${LIBRENMS_PATH}/config.d/*.php\") as \$filename) include \$filename;" >> config.php \
|
||||
&& chown -R librenms:librenms ${LIBRENMS_PATH} \
|
||||
&& su librenms -s /bin/sh -c "COMPOSER_CACHE_DIR=/tmp composer install --no-dev --no-interaction --no-ansi" \
|
||||
&& apk del build-dependencies \
|
||||
&& rm -rf .git \
|
||||
html/plugins/Test \
|
||||
doc/ \
|
||||
tests/ \
|
||||
/tmp/*
|
||||
|
||||
ENTRYPOINT [ "/entrypoint.sh" ]
|
||||
CMD [ "/usr/bin/supervisord", "-c", "/etc/supervisord.conf" ]
|
||||
COPY rootfs /
|
||||
|
||||
EXPOSE 8000 514 514/udp 162 162/udp
|
||||
VOLUME [ "/data" ]
|
||||
|
||||
ENTRYPOINT [ "/init" ]
|
||||
|
|
|
|||
2
LICENSE
2
LICENSE
|
|
@ -1,6 +1,6 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2018 CrazyMax
|
||||
Copyright (c) 2018-2025 CrazyMax
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
|
|||
488
README.md
488
README.md
|
|
@ -1,114 +1,294 @@
|
|||
<p align="center"><a href="https://github.com/crazy-max/docker-librenms" target="_blank"><img height="128"src="https://raw.githubusercontent.com/crazy-max/docker-librenms/master/.res/docker-librenms.jpg"></a></p>
|
||||
<p align="center"><a href="https://github.com/librenms/docker" target="_blank"><img height="128" src="https://raw.githubusercontent.com/librenms/docker/master/.github/docker-librenms.jpg"></a></p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://microbadger.com/images/crazymax/librenms"><img src="https://images.microbadger.com/badges/version/crazymax/librenms.svg?style=flat-square" alt="Version"></a>
|
||||
<a href="https://travis-ci.org/crazy-max/docker-librenms"><img src="https://img.shields.io/travis/crazy-max/docker-librenms/master.svg?style=flat-square" alt="Build Status"></a>
|
||||
<a href="https://hub.docker.com/r/crazymax/librenms/"><img src="https://img.shields.io/docker/stars/crazymax/librenms.svg?style=flat-square" alt="Docker Stars"></a>
|
||||
<a href="https://hub.docker.com/r/crazymax/librenms/"><img src="https://img.shields.io/docker/pulls/crazymax/librenms.svg?style=flat-square" alt="Docker Pulls"></a>
|
||||
<a href="https://quay.io/repository/crazymax/librenms"><img src="https://quay.io/repository/crazymax/librenms/status?style=flat-square" alt="Docker Repository on Quay"></a>
|
||||
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=962TPYQKMQ2UE"><img src="https://img.shields.io/badge/donate-paypal-7057ff.svg?style=flat-square" alt="Donate Paypal"></a>
|
||||
<a href="https://hub.docker.com/r/librenms/librenms/tags?page=1&ordering=last_updated"><img src="https://img.shields.io/github/v/tag/librenms/docker?label=version&style=flat-square" alt="Latest Version"></a>
|
||||
<a href="https://github.com/librenms/docker/actions?workflow=build"><img src="https://img.shields.io/github/actions/workflow/status/librenms/docker/build.yml?branch=master&label=build&logo=github&style=flat-square" alt="Build Status"></a>
|
||||
<a href="https://hub.docker.com/r/librenms/librenms/"><img src="https://img.shields.io/docker/stars/librenms/librenms.svg?style=flat-square&logo=docker" alt="Docker Stars"></a>
|
||||
<a href="https://hub.docker.com/r/librenms/librenms/"><img src="https://img.shields.io/docker/pulls/librenms/librenms.svg?style=flat-square&logo=docker" alt="Docker Pulls"></a>
|
||||
<br /><a href="https://github.com/sponsors/crazy-max"><img src="https://img.shields.io/badge/sponsor-crazy--max-181717.svg?logo=github&style=flat-square" alt="Become a sponsor"></a>
|
||||
<a href="https://www.paypal.me/crazyws"><img src="https://img.shields.io/badge/donate-paypal-00457c.svg?logo=paypal&style=flat-square" alt="Donate Paypal"></a>
|
||||
</p>
|
||||
|
||||
## About
|
||||
|
||||
🐳 [LibreNMS](https://www.librenms.org/) Docker image based on Alpine Linux and Nginx.<br />
|
||||
If you are interested, [check out](https://hub.docker.com/r/crazymax/) my other 🐳 Docker images!
|
||||
Docker image for [LibreNMS](https://www.librenms.org/), a fully featured network
|
||||
monitoring system that provides a wealth of features and device support.
|
||||
|
||||
> [!TIP]
|
||||
> Want to be notified of new releases? Check out 🔔 [Diun (Docker Image Update Notifier)](https://github.com/crazy-max/diun)
|
||||
> project!
|
||||
|
||||
___
|
||||
|
||||
* [Features](#features)
|
||||
* [Demo](#demo)
|
||||
* [Build locally](#build-locally)
|
||||
* [Image](#image)
|
||||
* [Environment variables](#environment-variables)
|
||||
* [General](#general)
|
||||
* [Redis](#redis)
|
||||
* [Dispatcher service](#dispatcher-service)
|
||||
* [Syslog-ng](#syslog-ng)
|
||||
* [Snmptrapd](#snmptrapd)
|
||||
* [Database](#database)
|
||||
* [Misc](#misc)
|
||||
* [Volumes](#volumes)
|
||||
* [Ports](#ports)
|
||||
* [Usage](#usage)
|
||||
* [Docker Compose](#docker-compose)
|
||||
* [Command line](#command-line)
|
||||
* [First launch](#first-launch)
|
||||
* [Upgrade](#upgrade)
|
||||
* [Configuration Management](#configuration-management)
|
||||
* [Initial Configuration](#initial-configuration)
|
||||
* [Live Configuration](#live-configuration)
|
||||
* [Re-Apply YAML Config](#re-apply-yaml-config)
|
||||
* [Live Config](#live-config)
|
||||
* [Notes](#notes)
|
||||
* [LNMS command](#lnms-command)
|
||||
* [Validate](#validate)
|
||||
* [Dispatcher service container](#dispatcher-service-container)
|
||||
* [Syslog-ng container](#syslog-ng-container)
|
||||
* [Snmptrapd container](#snmptrapd-container)
|
||||
* [Add a LibreNMS plugin](#add-a-librenms-plugin)
|
||||
* [Additional Monitoring plugins](#additional-monitoring-plugins)
|
||||
* [Custom alert templates](#custom-alert-templates)
|
||||
* [Contributing](#contributing)
|
||||
* [License](#license)
|
||||
|
||||
## Features
|
||||
|
||||
### Included
|
||||
|
||||
* Alpine Linux 3.8, Nginx, PHP 7.2
|
||||
* Cron tasks as a ["sidecar" container](#cron)
|
||||
* Run as non-root user
|
||||
* Multi-platform image
|
||||
* [Dispatcher service](#dispatcher-service) as "sidecar" container
|
||||
* Syslog-ng support through a ["sidecar" container](#syslog-ng)
|
||||
* Snmp-trap support through a ["sidecar" container](#snmptrapd)
|
||||
* Ability to add custom Monitoring plugins
|
||||
* Ability to add custom alert templates
|
||||
* OPCache enabled to store precompiled script bytecode in shared memory
|
||||
|
||||
### From docker-compose
|
||||
|
||||
* [Traefik](https://github.com/containous/traefik-library-image) as reverse proxy and creation/renewal of Let's Encrypt certificates
|
||||
* [Memcached](https://github.com/docker-library/memcached) image ready to use for better scalability
|
||||
* [RRDcached](https://github.com/crazy-max/docker-rrdcached) image ready to use for better scalability
|
||||
* [Postfix SMTP relay](https://github.com/juanluisbaptiste/docker-postfix) image to send emails
|
||||
* [s6-overlay](https://github.com/just-containers/s6-overlay/) as process supervisor
|
||||
* [Traefik](https://github.com/containous/traefik-library-image) as reverse proxy and creation/renewal of Let's Encrypt certificates (see [this template](examples/traefik))
|
||||
* [Redis](https://github.com/docker-library/redis) image ready to use for better scalability
|
||||
* [RRDcached](https://github.com/crazy-max/docker-rrdcached) image ready to use for data caching and graphs
|
||||
* [msmtpd SMTP relay](https://github.com/crazy-max/docker-msmtpd) image to send emails
|
||||
* [MariaDB](https://github.com/docker-library/mariadb) image as database instance
|
||||
* Cron jobs as a ["sidecar" container](#cron)
|
||||
* Syslog-ng support through a ["sidecar" container](#syslog-ng)
|
||||
|
||||
## Docker
|
||||
## Demo
|
||||
|
||||
### Environment variables
|
||||
[](https://labs.play-with-docker.com/?stack=https://raw.githubusercontent.com/librenms/docker/master/examples/pwd/librenms.yml)
|
||||
|
||||
* `TZ` : The timezone assigned to the container (default `UTC`)
|
||||
* `PUID` : LibreNMS user id (default `1000`)
|
||||
## Build locally
|
||||
|
||||
```console
|
||||
$ git clone https://github.com/librenms/docker.git docker-librenms
|
||||
$ cd docker-librenms
|
||||
|
||||
# Build image and output to docker (default)
|
||||
$ docker buildx bake
|
||||
|
||||
# Build multi-platform image
|
||||
$ docker buildx bake image-all
|
||||
```
|
||||
|
||||
## Image
|
||||
|
||||
Following platforms for this image are available:
|
||||
|
||||
```
|
||||
$ docker buildx imagetools inspect librenms/librenms --format "{{json .Manifest}}" | \
|
||||
jq -r '.manifests[] | select(.platform.os != null and .platform.os != "unknown") | .platform | "\(.os)/\(.architecture)\(if .variant then "/" + .variant else "" end)"'
|
||||
|
||||
linux/386
|
||||
linux/amd64
|
||||
linux/arm/v7
|
||||
linux/arm64
|
||||
linux/ppc64le
|
||||
linux/s390x
|
||||
```
|
||||
|
||||
## Environment variables
|
||||
|
||||
### General
|
||||
|
||||
* `TZ`: The timezone assigned to the container (default `UTC`)
|
||||
* `PUID`: LibreNMS user id (default `1000`)
|
||||
* `PGID`: LibreNMS group id (default `1000`)
|
||||
* `MEMORY_LIMIT` : PHP memory limit (default `256M`)
|
||||
* `UPLOAD_MAX_SIZE` : Upload max size (default `16M`)
|
||||
* `OPCACHE_MEM_SIZE` : PHP OpCache memory consumption (default `128`)
|
||||
* `LIBRENMS_POLLER_THREADS` : Threads that `poller-wrapper.py` runs (default `16`)
|
||||
* `LIBRENMS_POLLER_INTERVAL` : Interval in minutes at which `poller-wrapper.py` runs (defaults to `5`) [docs](https://docs.librenms.org/#Support/1-Minute-Polling/)
|
||||
* `LIBRENMS_DISTRIBUTED_POLLER_ENABLE` : Enable distributed poller functionality
|
||||
* `LIBRENMS_DISTRIBUTED_POLLER_NAME` : Optional name of poller (defaults to hostname)
|
||||
* `LIBRENMS_DISTRIBUTED_POLLER_GROUP` : By default, all hosts are shared and have the poller_group = 0. To pin a device to a poller, set it to a value greater than 0 and set the same value here. One can also specify a comma separated string of poller groups. The poller will then poll devices from any of the groups listed. [docs](https://docs.librenms.org/#Extensions/Distributed-Poller/#distributed-poller)
|
||||
* `LIBRENMS_DISTRIBUTED_POLLER_MEMCACHED_HOST` : Memcached server for poller synchronization (Defaults to `$MEMCACHED_HOST`)
|
||||
* `LIBRENMS_DISTRIBUTED_POLLER_MEMCACHED_PORT` : Port of memcached server (Defaults to `$MEMCACHED_PORT`)
|
||||
* `LIBRENMS_CRON_DISCOVERY_ENABLE` : Enable LibreNMS discovery for this container cronjobs (default `true`)
|
||||
* `LIBRENMS_CRON_DAILY_ENABLE` : Enable LibreNMS daily script for this container cronjobs (default `true`)
|
||||
* `LIBRENMS_CRON_ALERTS_ENABLE` : Enable LibreNMS alerts generation for this container cronjobs (default `true`)
|
||||
* `LIBRENMS_CRON_BILLING_ENABLE` : Enable LibreNMS billing polling for this container cronjobs (default `true`)
|
||||
* `LIBRENMS_CRON_BILLING_CALCULATE_ENABLE` : Enable LibreNMS billing for this container cronjobs (default `true`)
|
||||
* `LIBRENMS_CRON_CHECK_SERVICES_ENABLE` : Enable LibreNMS service checks for this container cronjobs (default `true`)
|
||||
* `LIBRENMS_CRON_POLLER_ENABLE` : Enable LibreNMS polling for this container cronjobs (default `true`)
|
||||
* `LIBRENMS_SNMP_COMMUNITY` : This container's SNMP v2c community string (default `librenmsdocker`)
|
||||
* `DB_HOST` : MySQL database hostname / IP address
|
||||
* `DB_PORT` : MySQL database port (default `3306`)
|
||||
* `DB_NAME` : MySQL database name (default `librenms`)
|
||||
* `DB_USER` : MySQL user (default `librenms`)
|
||||
* `DB_PASSWORD` : MySQL password (default `librenms`)
|
||||
* `DB_TIMEOUT` : Time in seconds after which we stop trying to reach the MySQL server (useful for clusters, default `30`)
|
||||
* `MEMCACHED_HOST` : Hostname / IP address of a Memcached server
|
||||
* `MEMCACHED_PORT` : Port of the Memcached server
|
||||
* `RRDCACHED_HOST` : Hostname / IP address of a RRDcached server
|
||||
* `RRDCACHED_PORT` : Port of the RRDcached server
|
||||
* `MEMORY_LIMIT`: PHP memory limit (default `256M`)
|
||||
* `MAX_INPUT_VARS`: PHP max input vars (default `1000`)
|
||||
* `UPLOAD_MAX_SIZE`: Upload max size (default `16M`)
|
||||
* `CLEAR_ENV`: Clear environment in FPM workers (default `yes`)
|
||||
* `FPM_PM_MAX_CHILDREN`: FPM max Children (default: `15`)
|
||||
* `FPM_PM_START_SERVERS`: FPM start servers (default: `2`)
|
||||
* `FPM_PM_MIN_SPARE_SERVERS`: FPM min spare servers (default: `1`)
|
||||
* `FPM_PM_MAX_SPARE_SERVERS`: FPM max spare servers (default: `6`)
|
||||
* `OPCACHE_MEM_SIZE`: PHP OpCache memory consumption (default `128`)
|
||||
* `LISTEN_IPV6`: Enable IPv6 for Nginx (default `true`)
|
||||
* `REAL_IP_FROM`: Trusted addresses that are known to send correct replacement addresses (default `0.0.0.0/32`)
|
||||
* `REAL_IP_HEADER`: Request header field whose value will be used to replace the client address (default `X-Forwarded-For`)
|
||||
* `LOG_IP_VAR`: Use another variable to retrieve the remote IP address for access [log_format](http://nginx.org/en/docs/http/ngx_http_log_module.html#log_format) on Nginx. (default `remote_addr`)
|
||||
* `SESSION_DRIVER`: [Driver to use for session storage](https://github.com/librenms/librenms/blob/master/config/session.php) (default `file`)
|
||||
* `CACHE_DRIVER`: [Driver to use for cache and locks](https://github.com/librenms/librenms/blob/master/config/cache.php) (default `database`)
|
||||
|
||||
### Volumes
|
||||
### Redis
|
||||
|
||||
* `/data` : Contains configuration, rrd database, logs, additional syslog-ng config files
|
||||
> [!NOTE]
|
||||
> Redis variables should be set on all containers and are required when running
|
||||
> more than one dispatcher.
|
||||
|
||||
### Ports
|
||||
* `REDIS_HOST`: Redis host for poller synchronization
|
||||
* `REDIS_SENTINEL`: Redis Sentinel host for high availability Redis cluster
|
||||
* `REDIS_SENTINEL_SERVICE`: Redis Sentinel service name (default `librenms`)
|
||||
* `REDIS_SCHEME`: Redis scheme (default `tcp`)
|
||||
* `REDIS_PORT`: Redis port (default `6379`)
|
||||
* `REDIS_PASSWORD`: Redis password
|
||||
* `REDIS_DB`: Redis database (default `0`)
|
||||
* `REDIS_CACHE_DB`: Redis cache database (default `1`)
|
||||
|
||||
* `80` : HTTP port
|
||||
### Dispatcher service
|
||||
|
||||
## Use this image
|
||||
> [!WARNING]
|
||||
> You need at least one dispatcher sidecar, otherwise poller will not run [sidecar dispatcher container](#dispatcher-service-container).
|
||||
|
||||
* `SIDECAR_DISPATCHER`: Set to `1` to enable sidecar dispatcher mode for this container (default `0`)
|
||||
* `DISPATCHER_NODE_ID`: Unique node ID for your dispatcher service
|
||||
* `DISPATCHER_ARGS`: Additional args to pass to the [dispatcher service](https://github.com/librenms/librenms/blob/master/librenms-service.py)
|
||||
|
||||
### Syslog-ng
|
||||
|
||||
> [!WARNING]
|
||||
> Only used if you enable and run a [sidecar syslog-ng container](#syslog-ng-container).
|
||||
|
||||
* `SIDECAR_SYSLOGNG`: Set to `1` to enable sidecar syslog-ng mode for this container (default `0`)
|
||||
|
||||
### Snmptrapd
|
||||
|
||||
> [!WARNING]
|
||||
> Only used if you enable and run a [sidecar snmptrapd container](#snmptrapd-container).
|
||||
|
||||
* `SIDECAR_SNMPTRAPD`: Set to `1` to enable sidecar snmptrapd mode for this container (default `0`)
|
||||
* `SNMP_PROCESSING_TYPE`: Sets which type of processing (`log`, `execute`, and/or `net`) to use with the SNMP trap (default `log,execute,net`)
|
||||
* `SNMP_USER`: Defines what username to authenticate with (default `librenms_user`)
|
||||
* `SNMP_AUTH`: Defines what password to authenticate with (default `auth_pass` should not be used, but will work)
|
||||
* `SNMP_PRIV`: Defines what password to encrypt packages with (default `priv_pass` should not be used, but will work)
|
||||
* `SNMP_AUTH_PROTO`: Sets what protocol (`MD5`|`SHA`) to use for authentication (default `SHA`)
|
||||
* `SNMP_PRIV_PROTO`: Sets what protocol (`DES`|`AES`) to use for encryption of packages (default `AES`)
|
||||
* `SNMP_SECURITY_LEVEL`: Sets what security level (`noauth`|`priv`) to use (default `priv`)
|
||||
* `SNMP_ENGINEID`: Defines what SNMP EngineID to use (default `1234567890`)
|
||||
* `SNMP_DISABLE_AUTHORIZATION`: Will disable the above access control checks, and revert to the previous behaviour of accepting all incoming notifications. (default `yes`)
|
||||
* `SNMP_EXTRA_MIB_DIRS`: [Additional directories where MIB files are for SNMP Traps](https://docs.librenms.org/Extensions/SNMP-Trap-Handler/#option-2) (example `/opt/librenms/mibs/veeam`)
|
||||
|
||||
### Database
|
||||
|
||||
* `DB_HOST`: MySQL database hostname / IP address
|
||||
* `DB_PORT`: MySQL database port (default `3306`)
|
||||
* `DB_NAME`: MySQL database name (default `librenms`)
|
||||
* `DB_USER`: MySQL user (default `librenms`)
|
||||
* `DB_PASSWORD`: MySQL password (default `librenms`)
|
||||
* `DB_TIMEOUT`: Time in seconds after which we stop trying to reach the MySQL server (useful for clusters, default `60`)
|
||||
|
||||
### Misc
|
||||
|
||||
* `LIBRENMS_BASE_URL`: URL of your LibreNMS instance (default `/`)
|
||||
* `LIBRENMS_SNMP_COMMUNITY`: This container's SNMP v2c community string (default `librenmsdocker`)
|
||||
* `MEMCACHED_HOST`: Hostname / IP address of a Memcached server
|
||||
* `MEMCACHED_PORT`: Port of the Memcached server (default `11211`)
|
||||
* `RRDCACHED_SERVER`: RRDcached server (eg. `rrdcached:42217`)
|
||||
|
||||
## Volumes
|
||||
|
||||
* `/data`: Contains configuration, plugins, rrd database, logs, additional Monitoring plugins, additional syslog-ng config files
|
||||
|
||||
> [!WARNING]
|
||||
> Note that the volume should be owned by the user/group with the specified
|
||||
> `PUID` and `PGID`. If you don't give the volume correct permissions, the
|
||||
> container may not start.
|
||||
|
||||
## Ports
|
||||
|
||||
* `8000`: HTTP port
|
||||
* `514 514/udp`: Syslog ports (only used if you enable and run a [sidecar syslog-ng container](#syslog-ng-container))
|
||||
* `162 162/udp`: Snmptrapd ports (only used if you enable and run a [sidecar snmptrapd container](#snmptrapd-container))
|
||||
|
||||
## Usage
|
||||
|
||||
### Docker Compose
|
||||
|
||||
Docker compose is the recommended way to run this image. Copy the content of folder [examples/compose](examples/compose) in `/var/librenms/` on your host for example. Edit the compose and env files with your preferences and run the following commands :
|
||||
Docker compose is the recommended way to run this image. Copy the content of
|
||||
folder [examples/compose](examples/compose) in `/var/librenms/` on your host
|
||||
for example. Edit the compose and env files with your preferences and run the
|
||||
following commands:
|
||||
|
||||
```bash
|
||||
touch acme.json
|
||||
chmod 600 acme.json
|
||||
docker-compose up -d
|
||||
docker-compose logs -f
|
||||
```console
|
||||
$ docker compose up -d
|
||||
$ docker compose logs -f
|
||||
```
|
||||
|
||||
### Command line
|
||||
|
||||
You can also use the following minimal command :
|
||||
You can also use the following minimal command:
|
||||
|
||||
```bash
|
||||
docker run -d -p 80:80 --name librenms \
|
||||
```console
|
||||
$ docker run -d -p 8000:8000 --name librenms \
|
||||
-v $(pwd)/data:/data \
|
||||
-e "DB_HOST=db" \
|
||||
crazymax/librenms:latest
|
||||
librenms/librenms:latest
|
||||
```
|
||||
|
||||
> `-e "DB_HOST=db"`<br />
|
||||
> :warning: `db` must be a running MySQL instance
|
||||
> [!WARNING]
|
||||
> `db` must be a running MySQL instance.
|
||||
|
||||
## Notes
|
||||
### First launch
|
||||
|
||||
### Edit configuration
|
||||
When you first access the webui, you will be prompted to create an admin user.
|
||||
|
||||
You can edit configuration of LibreNMS by placing `*.php` files inside `/data/config` folder. Let's say you want to edit the [WebUI config](https://docs.librenms.org/#Support/Configuration/#webui-settings). Create a file called for example `/data/config/webui.php` with this content :
|
||||
> [!NOTE]
|
||||
> If you lose access, you can create another one using the [`lnms` command](#lnms-command).
|
||||
|
||||
## Upgrade
|
||||
|
||||
To upgrade to the latest version of LibreNMS, pull the newer image and launch
|
||||
the container. LibreNMS will upgrade automatically:
|
||||
|
||||
```console
|
||||
$ docker compose down
|
||||
$ docker compose pull
|
||||
$ docker compose up -d
|
||||
```
|
||||
|
||||
## Configuration Management
|
||||
|
||||
### Initial Configuration
|
||||
|
||||
You can set the initial configuration of LibreNMS by placing `*.yaml` files inside `/data/config` folder. Let's say you want to edit the [WebUI config](https://docs.librenms.org/Support/Configuration/#webui-settings).
|
||||
Create a file called for example `/data/config/webui.yaml` with this content :
|
||||
|
||||
```yaml
|
||||
page_refresh: 300
|
||||
webui.default_dashboard_id: 0
|
||||
```
|
||||
|
||||
This configuration will be seeded into the LibreNMS database when it is first deployed
|
||||
and will override the default values.
|
||||
|
||||
### Live Configuration
|
||||
|
||||
You can edit the running configuration via the LibreNMS web UI or `lnms config:set`
|
||||
|
||||
```bash
|
||||
docker compose exec librenms lnms config:set page_refresh 300
|
||||
```
|
||||
|
||||
### Re-Apply YAML Config
|
||||
|
||||
Set `REAPPLY_YAML_CONFIG=1` to overwrite any settings that are set during initial config
|
||||
or via user config back to their initial values every time the container is deployed.
|
||||
|
||||
### Live Config
|
||||
|
||||
Using this config method, configuration changes will be reflected live on the containers, BUT
|
||||
you will be unable to edit the configured settings from within the LibreNMS web UI or lnms config:set.
|
||||
|
||||
The same example using PHP `/data/config/webui.php`
|
||||
|
||||
```php
|
||||
<?php
|
||||
|
|
@ -116,112 +296,140 @@ $config['page_refresh'] = "300";
|
|||
$config['webui']['default_dashboard_id'] = 0;
|
||||
```
|
||||
|
||||
This configuration will be included in LibreNMS and will override the default values.
|
||||
## Notes
|
||||
|
||||
### Add user
|
||||
### LNMS command
|
||||
|
||||
On first launch, an initial administrator user will be created :
|
||||
If you want to use the `lnms` command to perform common server operations like
|
||||
manage users, database migration, and more, type:
|
||||
|
||||
| Login | Password |
|
||||
|------------|------------|
|
||||
| `librenms` | `librenms` |
|
||||
|
||||
You can create an other user using the commande line :
|
||||
|
||||
```text
|
||||
$ docker exec -it --user librenms librenms php adduser.php <name> <pass> 10 <email>
|
||||
```console
|
||||
$ docker compose exec librenms lnms
|
||||
```
|
||||
|
||||
> :warning: Substitute your desired username `<name>`, password `<pass>` and email address `<email>`
|
||||
|
||||
### Validate
|
||||
|
||||
If you want to validate your installation from the CLI, type the following command :
|
||||
If you want to validate your installation from the CLI, type the following
|
||||
command:
|
||||
|
||||
```text
|
||||
$ docker exec -it --user librenms librenms php validate.php
|
||||
```console
|
||||
$ docker compose exec --user librenms librenms php validate.php
|
||||
====================================
|
||||
Component | Version
|
||||
--------- | -------
|
||||
LibreNMS | 1.41
|
||||
DB Schema | 253
|
||||
PHP | 7.2.7
|
||||
MySQL | 10.2.16-MariaDB-10.2.16+maria~jessie
|
||||
RRDTool | 1.7.0
|
||||
SNMP | NET-SNMP 5.7.3
|
||||
LibreNMS | 1.64
|
||||
DB Schema | 2020_04_19_010532_eventlog_sensor_reference_cleanup (165)
|
||||
PHP | 7.3.18
|
||||
Python | 3.8.2
|
||||
MySQL | 10.4.13-MariaDB-1:10.4.13+maria~bionic
|
||||
RRDTool | 1.7.2
|
||||
SNMP | NET-SNMP 5.8
|
||||
====================================
|
||||
|
||||
[OK] Composer Version: 1.6.5
|
||||
[OK] Dependencies up-to-date.
|
||||
[OK] Installed from the official Docker image; no Composer required
|
||||
[OK] Database connection successful
|
||||
[OK] Database schema correct
|
||||
[WARN] You have not added any devices yet.
|
||||
[FIX] You can add a device in the webui or with ./addhost.php
|
||||
[FAIL] fping6 location is incorrect or bin not installed.
|
||||
[FIX] Install fping6 or manually set the path to fping6 by placing the following in config.php: $config['fping6'] = '/path/to/fping6';
|
||||
[WARN] Your install is over 24 hours out of date, last update: Sat, 30 Jun 2018 21:37:37 +0000
|
||||
[FIX] Make sure your daily.sh cron is running and run ./daily.sh by hand to see if there are any errors.
|
||||
[WARN] Your local git branch is not master, this will prevent automatic updates.
|
||||
[FIX] You can switch back to master with git checkout master
|
||||
[WARN] IPv6 is disabled on your server, you will not be able to add IPv6 devices.
|
||||
[WARN] Updates are managed through the official Docker image
|
||||
```
|
||||
|
||||
### Update database
|
||||
### Dispatcher service container
|
||||
|
||||
To update the database manually, type the following command :
|
||||
If you want to enable the new [Dispatcher service](https://docs.librenms.org/Extensions/Dispatcher-Service/),
|
||||
you have to run a "sidecar" container (see dispatcher service in
|
||||
[compose.yml](examples/compose/compose.yml) example) or run a simple container
|
||||
like this:
|
||||
|
||||
```bash
|
||||
$ docker exec -it --user librenms librenms php build-base.php
|
||||
```
|
||||
|
||||
### Cron
|
||||
|
||||
If you want to enable the cron job, you have to run a "sidecar" container like in the [docker-compose file](examples/compose/docker-compose.yml) or run a simple container like this :
|
||||
|
||||
```bash
|
||||
docker run -d --name librenms-cron \
|
||||
```console
|
||||
$ docker run -d --name librenms_dispatcher \
|
||||
--env-file $(pwd)/librenms.env \
|
||||
-e SIDECAR_DISPATCHER=1 \
|
||||
-e DISPATCHER_NODE_ID=dispatcher1 \
|
||||
-v librenms:/data \
|
||||
crazymax/librenms:latest /usr/local/bin/cron
|
||||
librenms/librenms:latest
|
||||
```
|
||||
|
||||
> `-v librenms:/data`<br />
|
||||
> :warning: `librenms` must be a valid volume already attached to a LibreNMS container
|
||||
> [!WARNING]
|
||||
> `librenms` must be a valid volume already attached to a LibreNMS container.
|
||||
|
||||
### Syslog-ng
|
||||
### Syslog-ng container
|
||||
|
||||
If you want to enable syslog-ng, you have to run a "sidecar" container like in the [docker-compose file](examples/compose/docker-compose.yml) or run a simple container like this :
|
||||
If you want to enable syslog-ng, you have to run a "sidecar" container (see
|
||||
syslog-ng service in [compose.yml](examples/compose/compose.yml) example) or
|
||||
run a simple container like this:
|
||||
|
||||
```bash
|
||||
docker run -d --name librenms-syslog-ng \
|
||||
```console
|
||||
$ docker run -d --name librenms_syslog \
|
||||
--env-file $(pwd)/librenms.env \
|
||||
-e SIDECAR_SYSLOGNG=1 \
|
||||
-p 514 -p 514/udp \
|
||||
-v librenms:/data \
|
||||
crazymax/librenms:latest /usr/sbin/syslog-ng -F
|
||||
librenms/librenms:latest
|
||||
```
|
||||
|
||||
You have to create a configuration file to enable syslog in LibreNMS too. Create a file called for example `/data/config/syslog.php` with this content :
|
||||
> [!WARNING]
|
||||
> `librenms` must be a valid volume already attached to a LibreNMS container.
|
||||
|
||||
```php
|
||||
<?php
|
||||
$config['enable_syslog'] = 1;
|
||||
You have to create a configuration file to enable syslog in LibreNMS too. Create
|
||||
a file called for example `/data/config/syslog.yaml` with this content :
|
||||
|
||||
```yaml
|
||||
enable_syslog: true
|
||||
```
|
||||
|
||||
## Upgrade
|
||||
### Snmptrapd container
|
||||
|
||||
To upgrade to the latest version of LibreNMS, pull the newer image and launch the container. LibreNMS will upgrade automatically :
|
||||
If you want to enable snmptrapd, you have to run a "sidecar" container (see
|
||||
snmptrapd service in [compose.yml](examples/compose/compose.yml) example) or
|
||||
run a simple container like this:
|
||||
|
||||
```bash
|
||||
docker-compose pull
|
||||
docker-compose up -d
|
||||
```console
|
||||
$ docker run -d --name librenms_snmptrapd \
|
||||
--env-file $(pwd)/librenms.env \
|
||||
-e SIDECAR_SNMPTRAPD=1 \
|
||||
-p 162 -p 162/udp \
|
||||
-v librenms:/data \
|
||||
librenms/librenms:latest
|
||||
```
|
||||
|
||||
## How can I help ?
|
||||
> [!WARNING]
|
||||
> `librenms` must be a valid volume already attached to a LibreNMS container.
|
||||
|
||||
All kinds of contributions are welcome :raised_hands:!<br />
|
||||
The most basic way to show your support is to star :star2: the project, or to raise issues :speech_balloon:<br />
|
||||
But we're not gonna lie to each other, I'd rather you buy me a beer or two :beers:!
|
||||
### Add a LibreNMS plugin
|
||||
|
||||
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=962TPYQKMQ2UE)
|
||||
You can add [plugins for LibreNMS](https://docs.librenms.org/Extensions/Plugin-System/)
|
||||
in `/data/plugins/`. If you add a plugin that already exists in LibreNMS, it
|
||||
will be removed and yours will be used.
|
||||
|
||||
> [!WARNING]
|
||||
> Container has to be restarted to propagate changes.
|
||||
|
||||
### Additional Monitoring plugins
|
||||
|
||||
You can add a custom Monitoring plugin in `/data/monitoring-plugins/`.
|
||||
|
||||
Some plugins can be found in the [Monitoring Plugins](https://github.com/monitoring-plugins/monitoring-plugins#readme)
|
||||
repo, or in the [unofficial fork for Nagios](https://github.com/nagios-plugins/nagios-plugins#readme).
|
||||
|
||||
> [!WARNING]
|
||||
> Container has to be restarted to propagate changes.
|
||||
|
||||
### Custom alert templates
|
||||
|
||||
You can add [Laravel alert templates](https://docs.librenms.org/Alerting/Templates/#base-templates)
|
||||
in `/data/alert-templates/`.
|
||||
|
||||
> [!WARNING]
|
||||
> Container has to be restarted to propagate changes.
|
||||
|
||||
## Contributing
|
||||
|
||||
Want to contribute? Awesome! The most basic way to show your support is to star
|
||||
the project, or to raise issues. You can also support this project by [**becoming a sponsor on GitHub**](https://github.com/sponsors/crazy-max)
|
||||
or by making a [PayPal donation](https://www.paypal.me/crazyws) to ensure this
|
||||
journey continues indefinitely!
|
||||
|
||||
Thanks again for your support, it is much appreciated! :pray:
|
||||
|
||||
## License
|
||||
|
||||
|
|
|
|||
|
|
@ -1,21 +0,0 @@
|
|||
[supervisord]
|
||||
nodaemon = true
|
||||
user = root
|
||||
logfile = /var/log/supervisord/supervisord.log
|
||||
pidfile = /var/run/supervisord.pid
|
||||
childlogdir = /var/log/supervisord/
|
||||
logfile_maxbytes = 50MB
|
||||
logfile_backups = 10
|
||||
loglevel = info
|
||||
|
||||
[supervisorctl]
|
||||
serverurl = unix:///var/run/supervisor.sock
|
||||
|
||||
[unix_http_server]
|
||||
file = /var/run/supervisor.sock
|
||||
|
||||
[rpcinterface:supervisor]
|
||||
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
|
||||
|
||||
[include]
|
||||
files = /etc/supervisord/*.conf
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
[program:nginx]
|
||||
command = /usr/sbin/nginx
|
||||
stdout_logfile = /dev/stdout
|
||||
stdout_logfile_maxbytes = 0
|
||||
stderr_logfile = /dev/stderr
|
||||
stderr_logfile_maxbytes = 0
|
||||
autorestart = false
|
||||
startentries = 0
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
[program:php]
|
||||
command = /usr/sbin/php-fpm7
|
||||
stdout_logfile = /dev/stdout
|
||||
stdout_logfile_maxbytes = 0
|
||||
stderr_logfile = /dev/stderr
|
||||
stderr_logfile_maxbytes = 0
|
||||
autorestart = false
|
||||
startentries = 0
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
[program:snmpd]
|
||||
command = /usr/sbin/snmpd -f -c /etc/snmpd.conf
|
||||
startentries = 0
|
||||
stdout_logfile = /proc/1/fd/1
|
||||
stdout_logfile_maxbytes = 0
|
||||
stderr_logfile = /proc/1/fd/2
|
||||
stderr_logfile_maxbytes = 0
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
[global]
|
||||
daemonize = no
|
||||
error_log = /proc/self/fd/2
|
||||
|
||||
[www]
|
||||
user = librenms
|
||||
group = librenms
|
||||
|
||||
listen = /run/php-fpm7.sock
|
||||
listen.owner = librenms
|
||||
listen.group = librenms
|
||||
|
||||
pm = dynamic
|
||||
pm.max_children = 15
|
||||
pm.start_servers = 2
|
||||
pm.min_spare_servers = 1
|
||||
pm.max_spare_servers = 6
|
||||
request_terminate_timeout = 0
|
||||
|
||||
; if we send this to /proc/self/fd/1, it never appears
|
||||
access.log = /proc/self/fd/2
|
||||
|
||||
php_admin_value[post_max_size] = @UPLOAD_MAX_SIZE@
|
||||
php_admin_value[upload_max_filesize] = @UPLOAD_MAX_SIZE@
|
||||
php_admin_value[max_execution_time] = 10800
|
||||
php_admin_value[max_input_time] = 3600
|
||||
php_admin_value[expose_php] = Off
|
||||
php_admin_value[memory_limit] = @MEMORY_LIMIT@
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
exec busybox crond -f -L /dev/stdout
|
||||
40
docker-bake.hcl
Normal file
40
docker-bake.hcl
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
variable "DEFAULT_TAG" {
|
||||
default = "librenms:local"
|
||||
}
|
||||
|
||||
variable "LIBRENMS_VERSION" {
|
||||
default = null
|
||||
}
|
||||
|
||||
// Special target: https://github.com/docker/metadata-action#bake-definition
|
||||
target "docker-metadata-action" {
|
||||
tags = ["${DEFAULT_TAG}"]
|
||||
args = {
|
||||
LIBRENMS_VERSION = LIBRENMS_VERSION
|
||||
}
|
||||
}
|
||||
|
||||
// Default target if none specified
|
||||
group "default" {
|
||||
targets = ["image-local"]
|
||||
}
|
||||
|
||||
target "image" {
|
||||
inherits = ["docker-metadata-action"]
|
||||
}
|
||||
|
||||
target "image-local" {
|
||||
inherits = ["image"]
|
||||
output = ["type=docker"]
|
||||
}
|
||||
|
||||
target "image-all" {
|
||||
inherits = ["image"]
|
||||
platforms = [
|
||||
"linux/amd64",
|
||||
"linux/arm/v7",
|
||||
"linux/arm64",
|
||||
"linux/386",
|
||||
"linux/s390x"
|
||||
]
|
||||
}
|
||||
287
entrypoint.sh
287
entrypoint.sh
|
|
@ -1,287 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
function runas_librenms() {
|
||||
su - librenms -s /bin/sh -c "$1"
|
||||
}
|
||||
|
||||
TZ=${TZ:-"UTC"}
|
||||
PUID=${PUID:-1000}
|
||||
PGID=${PGID:-1000}
|
||||
|
||||
MEMORY_LIMIT=${MEMORY_LIMIT:-"256M"}
|
||||
UPLOAD_MAX_SIZE=${UPLOAD_MAX_SIZE:-"16M"}
|
||||
OPCACHE_MEM_SIZE=${OPCACHE_MEM_SIZE:-"128"}
|
||||
|
||||
MEMCACHED_PORT=${MEMCACHED_PORT:-"11211"}
|
||||
RRDCACHED_PORT=${RRDCACHED_PORT:-"42217"}
|
||||
|
||||
LIBRENMS_POLLER_THREADS=${LIBRENMS_POLLER_THREADS:-"16"}
|
||||
LIBRENMS_POLLER_INTERVAL=${LIBRENMS_POLLER_INTERVAL:-"5"}
|
||||
|
||||
LIBRENMS_DISTRIBUTED_POLLER_ENABLE=${LIBRENMS_DISTRIBUTED_POLLER_ENABLE:-false}
|
||||
LIBRENMS_DISTRIBUTED_POLLER_NAME=${LIBRENMS_DISTRIBUTED_POLLER_NAME:-$(hostname -f)}
|
||||
LIBRENMS_DISTRIBUTED_POLLER_GROUP=${LIBRENMS_DISTRIBUTED_POLLER_GROUP:-'0'}
|
||||
LIBRENMS_DISTRIBUTED_POLLER_MEMCACHED_HOST=${LIBRENMS_DISTRIBUTED_POLLER_MEMCACHED_HOST:-"${MEMCACHED_HOST}"}
|
||||
LIBRENMS_DISTRIBUTED_POLLER_MEMCACHED_PORT=${LIBRENMS_DISTRIBUTED_POLLER_MEMCACHED_PORT:-"${MEMCACHED_PORT}"}
|
||||
|
||||
LIBRENMS_CRON_DISCOVERY_ENABLE=${LIBRENMS_CRON_DISCOVERY_ENABLE:-true}
|
||||
LIBRENMS_CRON_DAILY_ENABLE=${LIBRENMS_CRON_DAILY_ENABLE:-true}
|
||||
LIBRENMS_CRON_ALERTS_ENABLE=${LIBRENMS_CRON_ALERTS_ENABLE:-true}
|
||||
LIBRENMS_CRON_BILLING_ENABLE=${LIBRENMS_CRON_BILLING_ENABLE:-true}
|
||||
LIBRENMS_CRON_BILLING_CALCULATE_ENABLE=${LIBRENMS_CRON_BILLING_CALCULATE_ENABLE:-true}
|
||||
LIBRENMS_CRON_CHECK_SERVICES_ENABLE=${LIBRENMS_CRON_CHECK_SERVICES_ENABLE:-true}
|
||||
LIBRENMS_CRON_POLLER_ENABLE=${LIBRENMS_CRON_POLLER_ENABLE:-true}
|
||||
|
||||
DB_PORT=${DB_PORT:-"3306"}
|
||||
DB_NAME=${DB_NAME:-"librenms"}
|
||||
DB_USER=${DB_USER:-"librenms"}
|
||||
DB_TIMEOUT=${DB_TIMEOUT:-"30"}
|
||||
|
||||
# From https://github.com/docker-library/mariadb/blob/master/docker-entrypoint.sh#L21-L41
|
||||
# usage: file_env VAR [DEFAULT]
|
||||
# ie: file_env 'XYZ_DB_PASSWORD' 'example'
|
||||
# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of
|
||||
# "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature)
|
||||
file_env() {
|
||||
local var="$1"
|
||||
local fileVar="${var}_FILE"
|
||||
local def="${2:-}"
|
||||
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
|
||||
echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
|
||||
exit 1
|
||||
fi
|
||||
local val="$def"
|
||||
if [ "${!var:-}" ]; then
|
||||
val="${!var}"
|
||||
elif [ "${!fileVar:-}" ]; then
|
||||
val="$(< "${!fileVar}")"
|
||||
fi
|
||||
export "$var"="$val"
|
||||
unset "$fileVar"
|
||||
}
|
||||
|
||||
# Timezone
|
||||
echo "Setting timezone to ${TZ}..."
|
||||
ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime
|
||||
echo ${TZ} > /etc/timezone
|
||||
sed -i -e "s|date\.timezone.*|date\.timezone = ${TZ}|" /etc/php7/php.ini \
|
||||
|
||||
# Change librenms UID / GID
|
||||
echo "Checking if librenms UID / GID has changed..."
|
||||
if [ $(id -u librenms) != ${PUID} ]; then
|
||||
usermod -u ${PUID} librenms
|
||||
fi
|
||||
if [ $(id -g librenms) != ${PGID} ]; then
|
||||
groupmod -g ${PGID} librenms
|
||||
fi
|
||||
|
||||
# PHP
|
||||
echo "Setting PHP-FPM configuration..."
|
||||
sed -e "s/@MEMORY_LIMIT@/$MEMORY_LIMIT/g" \
|
||||
-e "s/@UPLOAD_MAX_SIZE@/$UPLOAD_MAX_SIZE/g" \
|
||||
/tpls/etc/php7/php-fpm.d/www.conf > /etc/php7/php-fpm.d/www.conf
|
||||
|
||||
# OpCache
|
||||
echo "Setting OpCache configuration..."
|
||||
sed -e "s/@OPCACHE_MEM_SIZE@/$OPCACHE_MEM_SIZE/g" \
|
||||
/tpls/etc/php7/conf.d/opcache.ini > /etc/php7/conf.d/opcache.ini
|
||||
|
||||
# Nginx
|
||||
echo "Setting Nginx configuration..."
|
||||
sed -e "s/@UPLOAD_MAX_SIZE@/$UPLOAD_MAX_SIZE/g" \
|
||||
/tpls/etc/nginx/nginx.conf > /etc/nginx/nginx.conf
|
||||
|
||||
# SNMP
|
||||
echo "Updating SNMP community..."
|
||||
file_env 'LIBRENMS_SNMP_COMMUNITY' 'librenmsdocker'
|
||||
sed -i -e "s/RANDOMSTRINGGOESHERE/${LIBRENMS_SNMP_COMMUNITY}/" /etc/snmp/snmpd.conf
|
||||
|
||||
# Init files and folders
|
||||
echo "Initializing LibreNMS files / folders..."
|
||||
mkdir -p ${DATA_PATH}/config \
|
||||
${DATA_PATH}/logs \
|
||||
${DATA_PATH}/rrd
|
||||
rm -f ${LIBRENMS_PATH}/config.d/*
|
||||
|
||||
echo "Setting LibreNMS configuration..."
|
||||
|
||||
# Config : Directories
|
||||
cat > ${LIBRENMS_PATH}/config.d/directories.php <<EOL
|
||||
<?php
|
||||
\$config['install_dir'] = '${LIBRENMS_PATH}';
|
||||
\$config['log_dir'] = '${DATA_PATH}/logs';
|
||||
\$config['rrd_dir'] = '${DATA_PATH}/rrd';
|
||||
EOL
|
||||
|
||||
# Config : Database
|
||||
if [ -z "$DB_HOST" ]; then
|
||||
>&2 echo "ERROR: DB_HOST must be defined"
|
||||
exit 1
|
||||
fi
|
||||
file_env 'DB_PASSWORD'
|
||||
if [ -z "$DB_PASSWORD" ]; then
|
||||
>&2 echo "ERROR: Either DB_PASSWORD or DB_PASSWORD_FILE must be defined"
|
||||
exit 1
|
||||
fi
|
||||
cat > ${LIBRENMS_PATH}/config.d/database.php <<EOL
|
||||
<?php
|
||||
\$config['db_host'] = '${DB_HOST}';
|
||||
\$config['db_port'] = ${DB_PORT};
|
||||
\$config['db_user'] = '${DB_USER}';
|
||||
\$config['db_pass'] = '${DB_PASSWORD}';
|
||||
\$config['db_name'] = '${DB_NAME}';
|
||||
EOL
|
||||
dbcmd="mysql -h ${DB_HOST} -P ${DB_PORT} -u "${DB_USER}" "-p${DB_PASSWORD}""
|
||||
unset DB_PASSWORD
|
||||
|
||||
# Config : User
|
||||
cat > ${LIBRENMS_PATH}/config.d/user.php <<EOL
|
||||
<?php
|
||||
\$config['user'] = "librenms";
|
||||
EOL
|
||||
|
||||
# Config : Fping
|
||||
echo "/usr/sbin/fping -6 \$@" > /usr/sbin/fping6
|
||||
chmod +x /usr/sbin/fping6
|
||||
cat > ${LIBRENMS_PATH}/config.d/fping.php <<EOL
|
||||
<?php
|
||||
\$config['fping'] = "/usr/sbin/fping";
|
||||
\$config['fping6'] = "/usr/sbin/fping6";
|
||||
EOL
|
||||
|
||||
# Config : Disable autoupdate
|
||||
cat > ${LIBRENMS_PATH}/config.d/autoupdate.php <<EOL
|
||||
<?php
|
||||
\$config['update'] = 0;
|
||||
EOL
|
||||
|
||||
# Config : Memcached
|
||||
if [ ! -z "${MEMCACHED_HOST}" ]; then
|
||||
cat > ${LIBRENMS_PATH}/config.d/memcached.php <<EOL
|
||||
<?php
|
||||
\$config['memcached']['enable'] = true;
|
||||
\$config['memcached']['host'] = '$MEMCACHED_HOST';
|
||||
\$config['memcached']['port'] = $MEMCACHED_PORT;
|
||||
EOL
|
||||
fi
|
||||
|
||||
# Config : RRDcached
|
||||
if [ ! -z "${RRDCACHED_HOST}" ]; then
|
||||
cat > ${LIBRENMS_PATH}/config.d/rrdcached.php <<EOL
|
||||
<?php
|
||||
\$config['rrdcached'] = "${RRDCACHED_HOST}:${RRDCACHED_PORT}";
|
||||
\$config['rrdtool_version'] = '1.7.0';
|
||||
EOL
|
||||
fi
|
||||
|
||||
# Config : Ditributed poller
|
||||
if [ ! -z "${LIBRENMS_DISTRIBUTED_POLLER_MEMCACHED_HOST}" -a ! -z "${RRDCACHED_HOST}" -a $LIBRENMS_DISTRIBUTED_POLLER_ENABLE = true ]; then
|
||||
cat > ${LIBRENMS_PATH}/config.d/distributed_poller.php <<EOL
|
||||
<?php
|
||||
\$config['distributed_poller'] = true;
|
||||
\$config['distributed_poller_name'] = '$LIBRENMS_DISTRIBUTED_POLLER_NAME';
|
||||
\$config['distributed_poller_group'] = '$LIBRENMS_DISTRIBUTED_POLLER_GROUP';
|
||||
\$config['distributed_poller_memcached_host'] = '$LIBRENMS_DISTRIBUTED_POLLER_MEMCACHED_HOST';
|
||||
\$config['distributed_poller_memcached_port'] = $LIBRENMS_DISTRIBUTED_POLLER_MEMCACHED_PORT;
|
||||
EOL
|
||||
fi
|
||||
|
||||
# Fix perms
|
||||
echo "Fixing permissions..."
|
||||
chown -R librenms. ${DATA_PATH} \
|
||||
${LIBRENMS_PATH}/config.d \
|
||||
${LIBRENMS_PATH}/bootstrap \
|
||||
${LIBRENMS_PATH}/storage
|
||||
chmod ug+rw ${DATA_PATH}/logs \
|
||||
${DATA_PATH}/rrd \
|
||||
${LIBRENMS_PATH}/bootstrap/cache \
|
||||
${LIBRENMS_PATH}/storage \
|
||||
${LIBRENMS_PATH}/storage/framework/*
|
||||
|
||||
# Sidecar cron container ?
|
||||
if [ "$1" == "/usr/local/bin/cron" ]; then
|
||||
echo ">>"
|
||||
echo ">> Sidecar cron container detected"
|
||||
echo ">>"
|
||||
|
||||
# Init
|
||||
if [ -z "$CRONTAB_PATH" ]; then
|
||||
>&2 echo "ERROR: CRONTAB_PATH must be defined"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rm -rf ${CRONTAB_PATH}
|
||||
mkdir -m 0644 -p ${CRONTAB_PATH}
|
||||
touch ${CRONTAB_PATH}/librenms
|
||||
|
||||
# Add crontab
|
||||
cat ${LIBRENMS_PATH}/librenms.nonroot.cron > ${CRONTAB_PATH}/librenms
|
||||
sed -i -e "s/ librenms //" ${CRONTAB_PATH}/librenms
|
||||
|
||||
if [ $LIBRENMS_CRON_DISCOVERY_ENABLE != true ]; then
|
||||
sed -i "/discovery.php/d" ${CRONTAB_PATH}/librenms
|
||||
fi
|
||||
|
||||
if [ $LIBRENMS_CRON_DAILY_ENABLE != true ]; then
|
||||
sed -i "/daily.sh/d" ${CRONTAB_PATH}/librenms
|
||||
fi
|
||||
|
||||
if [ $LIBRENMS_CRON_ALERTS_ENABLE != true ]; then
|
||||
sed -i "/alerts.php/d" ${CRONTAB_PATH}/librenms
|
||||
fi
|
||||
|
||||
if [ $LIBRENMS_CRON_BILLING_ENABLE != true ]; then
|
||||
sed -i "/poll-billing.php/d" ${CRONTAB_PATH}/librenms
|
||||
fi
|
||||
|
||||
if [ $LIBRENMS_CRON_BILLING_CALCULATE_ENABLE != true ]; then
|
||||
sed -i "/billing-calculate.php/d" ${CRONTAB_PATH}/librenms
|
||||
fi
|
||||
|
||||
if [ $LIBRENMS_CRON_CHECK_SERVICES_ENABLE != true ]; then
|
||||
sed -i "/check-services.php/d" ${CRONTAB_PATH}/librenms
|
||||
fi
|
||||
|
||||
sed -i "/poller-wrapper.py/d" ${CRONTAB_PATH}/librenms
|
||||
if [ $LIBRENMS_CRON_POLLER_ENABLE = true ]; then
|
||||
cat >> ${CRONTAB_PATH}/librenms <<EOL
|
||||
*/${LIBRENMS_POLLER_INTERVAL} * * * * /opt/librenms/cronic /opt/librenms/poller-wrapper.py ${LIBRENMS_POLLER_THREADS}
|
||||
EOL
|
||||
fi
|
||||
|
||||
# Fix crontab perms
|
||||
echo "Fixing crontab permissions..."
|
||||
chmod -R 0644 ${CRONTAB_PATH}
|
||||
elif [ "$1" == "/usr/sbin/syslog-ng" ]; then
|
||||
echo ">>"
|
||||
echo ">> Sidecar syslog-ng container detected"
|
||||
echo ">>"
|
||||
|
||||
# Init
|
||||
mkdir -p ${DATA_PATH}/syslog-ng /run/syslog-ng
|
||||
chown -R librenms. ${DATA_PATH}/syslog-ng /run/syslog-ng
|
||||
else
|
||||
echo "Waiting ${DB_TIMEOUT}s for database to be ready..."
|
||||
counter=1
|
||||
while ! ${dbcmd} -e "show databases;" > /dev/null 2>&1; do
|
||||
sleep 1
|
||||
counter=`expr $counter + 1`
|
||||
if [ ${counter} -gt ${DB_TIMEOUT} ]; then
|
||||
>&2 echo "ERROR: Failed to connect to database on $DB_HOST"
|
||||
exit 1
|
||||
fi;
|
||||
done
|
||||
echo "Database ready!"
|
||||
|
||||
counttables=$(echo 'SHOW TABLES' | ${dbcmd} "$DB_NAME" | wc -l)
|
||||
|
||||
echo "Updating database schema..."
|
||||
runas_librenms "php build-base.php"
|
||||
|
||||
if [ "${counttables}" -eq "0" ]; then
|
||||
echo "Creating admin user..."
|
||||
runas_librenms "php adduser.php librenms librenms 10 librenms@librenms.docker"
|
||||
fi
|
||||
fi
|
||||
|
||||
exec "$@"
|
||||
7
examples/compose/.env
Normal file
7
examples/compose/.env
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
TZ=Europe/Paris
|
||||
PUID=1000
|
||||
PGID=1000
|
||||
|
||||
MYSQL_DATABASE=librenms
|
||||
MYSQL_USER=librenms
|
||||
MYSQL_PASSWORD=asupersecretpassword
|
||||
158
examples/compose/compose.yml
Normal file
158
examples/compose/compose.yml
Normal file
|
|
@ -0,0 +1,158 @@
|
|||
name: librenms
|
||||
|
||||
services:
|
||||
db:
|
||||
image: mariadb:10
|
||||
container_name: librenms_db
|
||||
command:
|
||||
- "mysqld"
|
||||
- "--innodb-file-per-table=1"
|
||||
- "--lower-case-table-names=0"
|
||||
- "--character-set-server=utf8mb4"
|
||||
- "--collation-server=utf8mb4_unicode_ci"
|
||||
volumes:
|
||||
- "./db:/var/lib/mysql"
|
||||
environment:
|
||||
- "TZ=${TZ}"
|
||||
- "MARIADB_RANDOM_ROOT_PASSWORD=yes"
|
||||
- "MYSQL_DATABASE=${MYSQL_DATABASE}"
|
||||
- "MYSQL_USER=${MYSQL_USER}"
|
||||
- "MYSQL_PASSWORD=${MYSQL_PASSWORD}"
|
||||
restart: always
|
||||
|
||||
redis:
|
||||
image: redis:7.2-alpine
|
||||
container_name: librenms_redis
|
||||
environment:
|
||||
- "TZ=${TZ}"
|
||||
restart: always
|
||||
|
||||
msmtpd:
|
||||
image: crazymax/msmtpd:latest
|
||||
container_name: librenms_msmtpd
|
||||
env_file:
|
||||
- "./msmtpd.env"
|
||||
restart: always
|
||||
|
||||
librenms:
|
||||
image: librenms/librenms:latest
|
||||
container_name: librenms
|
||||
hostname: librenms
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
- NET_RAW
|
||||
ports:
|
||||
- target: 8000
|
||||
published: 8000
|
||||
protocol: tcp
|
||||
depends_on:
|
||||
- db
|
||||
- redis
|
||||
- msmtpd
|
||||
volumes:
|
||||
- "./librenms:/data"
|
||||
env_file:
|
||||
- "./librenms.env"
|
||||
environment:
|
||||
- "TZ=${TZ}"
|
||||
- "PUID=${PUID}"
|
||||
- "PGID=${PGID}"
|
||||
- "DB_HOST=db"
|
||||
- "DB_NAME=${MYSQL_DATABASE}"
|
||||
- "DB_USER=${MYSQL_USER}"
|
||||
- "DB_PASSWORD=${MYSQL_PASSWORD}"
|
||||
- "DB_TIMEOUT=60"
|
||||
restart: always
|
||||
|
||||
dispatcher:
|
||||
image: librenms/librenms:latest
|
||||
container_name: librenms_dispatcher
|
||||
hostname: librenms-dispatcher
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
- NET_RAW
|
||||
depends_on:
|
||||
- librenms
|
||||
- redis
|
||||
volumes:
|
||||
- "./librenms:/data"
|
||||
env_file:
|
||||
- "./librenms.env"
|
||||
environment:
|
||||
- "TZ=${TZ}"
|
||||
- "PUID=${PUID}"
|
||||
- "PGID=${PGID}"
|
||||
- "DB_HOST=db"
|
||||
- "DB_NAME=${MYSQL_DATABASE}"
|
||||
- "DB_USER=${MYSQL_USER}"
|
||||
- "DB_PASSWORD=${MYSQL_PASSWORD}"
|
||||
- "DB_TIMEOUT=60"
|
||||
- "DISPATCHER_NODE_ID=dispatcher1"
|
||||
- "SIDECAR_DISPATCHER=1"
|
||||
restart: always
|
||||
|
||||
syslogng:
|
||||
image: librenms/librenms:latest
|
||||
container_name: librenms_syslogng
|
||||
hostname: librenms-syslogng
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
- NET_RAW
|
||||
depends_on:
|
||||
- librenms
|
||||
- redis
|
||||
ports:
|
||||
- target: 514
|
||||
published: 514
|
||||
protocol: tcp
|
||||
- target: 514
|
||||
published: 514
|
||||
protocol: udp
|
||||
volumes:
|
||||
- "./librenms:/data"
|
||||
env_file:
|
||||
- "./librenms.env"
|
||||
environment:
|
||||
- "TZ=${TZ}"
|
||||
- "PUID=${PUID}"
|
||||
- "PGID=${PGID}"
|
||||
- "DB_HOST=db"
|
||||
- "DB_NAME=${MYSQL_DATABASE}"
|
||||
- "DB_USER=${MYSQL_USER}"
|
||||
- "DB_PASSWORD=${MYSQL_PASSWORD}"
|
||||
- "DB_TIMEOUT=60"
|
||||
- "SIDECAR_SYSLOGNG=1"
|
||||
restart: always
|
||||
|
||||
snmptrapd:
|
||||
image: librenms/librenms:latest
|
||||
container_name: librenms_snmptrapd
|
||||
hostname: librenms-snmptrapd
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
- NET_RAW
|
||||
depends_on:
|
||||
- librenms
|
||||
- redis
|
||||
ports:
|
||||
- target: 162
|
||||
published: 162
|
||||
protocol: tcp
|
||||
- target: 162
|
||||
published: 162
|
||||
protocol: udp
|
||||
volumes:
|
||||
- "./librenms:/data"
|
||||
env_file:
|
||||
- "./librenms.env"
|
||||
environment:
|
||||
- "TZ=${TZ}"
|
||||
- "PUID=${PUID}"
|
||||
- "PGID=${PGID}"
|
||||
- "DB_HOST=db"
|
||||
- "DB_NAME=${MYSQL_DATABASE}"
|
||||
- "DB_USER=${MYSQL_USER}"
|
||||
- "DB_PASSWORD=${MYSQL_PASSWORD}"
|
||||
- "DB_TIMEOUT=60"
|
||||
- "SIDECAR_SNMPTRAPD=1"
|
||||
restart: always
|
||||
|
|
@ -1,134 +0,0 @@
|
|||
version: "3.2"
|
||||
|
||||
services:
|
||||
traefik:
|
||||
image: traefik:1.6-alpine
|
||||
command:
|
||||
- "--logLevel=INFO"
|
||||
- "--defaultentrypoints=http,https"
|
||||
- "--entryPoints=Name:http Address::80 Redirect.EntryPoint:https"
|
||||
- "--entryPoints=Name:https Address::443 TLS"
|
||||
- "--docker"
|
||||
- "--docker.exposedbydefault=false"
|
||||
- "--docker.domain=example.com"
|
||||
- "--acme=true"
|
||||
- "--acme.acmelogging=true"
|
||||
- "--acme.email=webmaster@example.com"
|
||||
- "--acme.storage=acme.json"
|
||||
- "--acme.entryPoint=https"
|
||||
- "--acme.onhostrule=true"
|
||||
- "--acme.httpchallenge=true"
|
||||
- "--acme.httpchallenge.entrypoint=http"
|
||||
ports:
|
||||
- target: 80
|
||||
published: 80
|
||||
protocol: tcp
|
||||
- target: 443
|
||||
published: 443
|
||||
protocol: tcp
|
||||
volumes:
|
||||
- "./acme.json:/acme.json"
|
||||
- "/var/run/docker.sock:/var/run/docker.sock"
|
||||
restart: always
|
||||
|
||||
db:
|
||||
image: mariadb:10.2
|
||||
command:
|
||||
- "mysqld"
|
||||
- "--sql-mode="
|
||||
- "--innodb-file-per-table=1"
|
||||
- "--lower-case-table-names=0"
|
||||
volumes:
|
||||
- "./db:/var/lib/mysql"
|
||||
environment:
|
||||
- "TZ=Europe/Paris"
|
||||
- "MYSQL_ALLOW_EMPTY_PASSWORD=yes"
|
||||
- "MYSQL_DATABASE=librenms"
|
||||
- "MYSQL_USER=librenms"
|
||||
- "MYSQL_PASSWORD=asupersecretpassword"
|
||||
restart: always
|
||||
|
||||
memcached:
|
||||
image: memcached:alpine
|
||||
environment:
|
||||
- "TZ=Europe/Paris"
|
||||
restart: always
|
||||
|
||||
rrdcached:
|
||||
image: crazymax/rrdcached
|
||||
volumes:
|
||||
- "./librenms/rrd:/data/db"
|
||||
- "./rrd-journal:/data/journal"
|
||||
environment:
|
||||
- "TZ=Europe/Paris"
|
||||
- "PUID=1000"
|
||||
- "PGID=1000"
|
||||
- "LOG_LEVEL=LOG_INFO"
|
||||
- "WRITE_TIMEOUT=1800"
|
||||
- "WRITE_JITTER=1800"
|
||||
- "WRITE_THREADS=4"
|
||||
- "FLUSH_DEAD_DATA_INTERVAL=3600"
|
||||
restart: always
|
||||
|
||||
smtp:
|
||||
image: juanluisbaptiste/postfix
|
||||
volumes:
|
||||
- "/etc/localtime:/etc/localtime:ro"
|
||||
environment:
|
||||
- "SERVER_HOSTNAME=librenms.example.com"
|
||||
- "SMTP_SERVER=smtp.example.com"
|
||||
- "SMTP_USERNAME=smtp@example.com"
|
||||
- "SMTP_PASSWORD="
|
||||
restart: always
|
||||
|
||||
app:
|
||||
image: crazymax/librenms:latest
|
||||
domainname: example.com
|
||||
hostname: librenms
|
||||
depends_on:
|
||||
- db
|
||||
- memcached
|
||||
- rrdcached
|
||||
- smtp
|
||||
volumes:
|
||||
- "./librenms:/data"
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.backend=librenms"
|
||||
- "traefik.port=80"
|
||||
- "traefik.frontend.rule=Host:librenms.example.com"
|
||||
env_file:
|
||||
- "./librenms.env"
|
||||
restart: always
|
||||
|
||||
cron:
|
||||
image: crazymax/librenms:latest
|
||||
command:
|
||||
- "/usr/local/bin/cron"
|
||||
depends_on:
|
||||
- app
|
||||
volumes:
|
||||
- "./librenms:/data"
|
||||
env_file:
|
||||
- "./librenms.env"
|
||||
restart: always
|
||||
|
||||
syslog-ng:
|
||||
image: crazymax/librenms:latest
|
||||
command:
|
||||
- "/usr/sbin/syslog-ng"
|
||||
- "-F"
|
||||
depends_on:
|
||||
- app
|
||||
ports:
|
||||
- target: 514
|
||||
published: 514
|
||||
protocol: tcp
|
||||
- target: 514
|
||||
published: 514
|
||||
protocol: udp
|
||||
volumes:
|
||||
- "./librenms:/data"
|
||||
env_file:
|
||||
- "./librenms.env"
|
||||
restart: always
|
||||
|
|
@ -1,16 +1,16 @@
|
|||
TZ=Europe/Paris
|
||||
|
||||
MEMORY_LIMIT=256M
|
||||
MAX_INPUT_VARS=1000
|
||||
UPLOAD_MAX_SIZE=16M
|
||||
OPCACHE_MEM_SIZE=128
|
||||
REAL_IP_FROM=0.0.0.0/32
|
||||
REAL_IP_HEADER=X-Forwarded-For
|
||||
LOG_IP_VAR=remote_addr
|
||||
|
||||
CACHE_DRIVER=redis
|
||||
SESSION_DRIVER=redis
|
||||
REDIS_HOST=redis
|
||||
|
||||
LIBRENMS_POLLER_THREADS=16
|
||||
LIBRENMS_SNMP_COMMUNITY=librenmsdocker
|
||||
|
||||
DB_HOST=db
|
||||
DB_NAME=librenms
|
||||
DB_USER=librenms
|
||||
DB_PASSWORD=asupersecretpassword
|
||||
|
||||
MEMCACHED_HOST=memcached
|
||||
RRDCACHED_HOST=rrdcached
|
||||
LIBRENMS_WEATHERMAP=false
|
||||
LIBRENMS_WEATHERMAP_SCHEDULE=*/5 * * * *
|
||||
|
|
|
|||
10
examples/compose/msmtpd.env
Normal file
10
examples/compose/msmtpd.env
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
# https://github.com/crazy-max/docker-msmtpd
|
||||
SMTP_HOST=smtp.gmail.com
|
||||
SMTP_PORT=587
|
||||
SMTP_TLS=on
|
||||
SMTP_STARTTLS=on
|
||||
SMTP_TLS_CHECKCERT=on
|
||||
SMTP_AUTH=on
|
||||
SMTP_USER=foo
|
||||
SMTP_PASSWORD=bar
|
||||
SMTP_FROM=foo@gmail.com
|
||||
152
examples/pwd/librenms.yml
Normal file
152
examples/pwd/librenms.yml
Normal file
|
|
@ -0,0 +1,152 @@
|
|||
version: "3.5"
|
||||
|
||||
x-env-global: &env-global
|
||||
- &MYSQL_DATABASE "librenms"
|
||||
- &MYSQL_USER "librenms"
|
||||
- &MYSQL_PASSWORD "asupersecretpassword"
|
||||
- &TZ "UTC"
|
||||
- &PUID "1000"
|
||||
- &PGID "1000"
|
||||
|
||||
x-envlibrenms: &envlibrenms
|
||||
MEMORY_LIMIT: "256M"
|
||||
MAX_INPUT_VARS: "1000"
|
||||
UPLOAD_MAX_SIZE: "16M"
|
||||
OPCACHE_MEM_SIZE: "128"
|
||||
REAL_IP_FROM: "0.0.0.0/32"
|
||||
REAL_IP_HEADER: "X-Forwarded-For"
|
||||
LOG_IP_VAR: "remote_addr"
|
||||
CACHE_DRIVER: "redis"
|
||||
SESSION_DRIVER: "redis"
|
||||
REDIS_HOST: "redis"
|
||||
LIBRENMS_SNMP_COMMUNITY: "librenmsdocker"
|
||||
LIBRENMS_WEATHERMAP: "true"
|
||||
LIBRENMS_WEATHERMAP_SCHEDULE: "*/5 * * * *"
|
||||
|
||||
services:
|
||||
db:
|
||||
image: mariadb:10.11
|
||||
command:
|
||||
- "mysqld"
|
||||
- "--innodb-file-per-table=1"
|
||||
- "--lower-case-table-names=0"
|
||||
- "--character-set-server=utf8mb4"
|
||||
- "--collation-server=utf8mb4_unicode_ci"
|
||||
volumes:
|
||||
- "db:/var/lib/mysql"
|
||||
environment:
|
||||
TZ: *TZ
|
||||
MARIADB_RANDOM_ROOT_PASSWORD: "yes"
|
||||
MYSQL_DATABASE: *MYSQL_DATABASE
|
||||
MYSQL_USER: *MYSQL_USER
|
||||
MYSQL_PASSWORD: *MYSQL_PASSWORD
|
||||
restart: always
|
||||
|
||||
redis:
|
||||
image: redis:7.2-alpine
|
||||
environment:
|
||||
TZ: *TZ
|
||||
restart: always
|
||||
|
||||
librenms:
|
||||
image: librenms/librenms:edge
|
||||
hostname: librenms
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
- NET_RAW
|
||||
ports:
|
||||
- "8000:8000"
|
||||
depends_on:
|
||||
- db
|
||||
- redis
|
||||
volumes:
|
||||
- "librenms:/data"
|
||||
environment:
|
||||
<<: *envlibrenms
|
||||
TZ: *TZ
|
||||
PUID: *PUID
|
||||
PGID: *PGID
|
||||
DB_HOST: "db"
|
||||
DB_NAME: *MYSQL_DATABASE
|
||||
DB_USER: *MYSQL_USER
|
||||
DB_PASSWORD: *MYSQL_PASSWORD
|
||||
DB_TIMEOUT: "60"
|
||||
restart: always
|
||||
|
||||
dispatcher:
|
||||
image: librenms/librenms:edge
|
||||
hostname: librenms-dispatcher-1234
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
- NET_RAW
|
||||
depends_on:
|
||||
- librenms
|
||||
- redis
|
||||
volumes:
|
||||
- "librenms:/data"
|
||||
environment:
|
||||
<<: *envlibrenms
|
||||
TZ: *TZ
|
||||
PUID: *PUID
|
||||
PGID: *PGID
|
||||
DB_HOST: "db"
|
||||
DB_NAME: *MYSQL_DATABASE
|
||||
DB_USER: *MYSQL_USER
|
||||
DB_PASSWORD: *MYSQL_PASSWORD
|
||||
DB_TIMEOUT: "60"
|
||||
DISPATCHER_NODE_ID: "dispatcher1234"
|
||||
SIDECAR_DISPATCHER: "1"
|
||||
restart: always
|
||||
|
||||
dispatcher2:
|
||||
image: librenms/librenms:edge
|
||||
hostname: librenms-dispatcher-5678
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
- NET_RAW
|
||||
depends_on:
|
||||
- librenms
|
||||
- redis
|
||||
volumes:
|
||||
- "librenms:/data"
|
||||
environment:
|
||||
<<: *envlibrenms
|
||||
TZ: *TZ
|
||||
PUID: *PUID
|
||||
PGID: *PGID
|
||||
DB_HOST: "db"
|
||||
DB_NAME: *MYSQL_DATABASE
|
||||
DB_USER: *MYSQL_USER
|
||||
DB_PASSWORD: *MYSQL_PASSWORD
|
||||
DB_TIMEOUT: "60"
|
||||
DISPATCHER_NODE_ID: "dispatcher5678"
|
||||
SIDECAR_DISPATCHER: "1"
|
||||
restart: always
|
||||
|
||||
syslogng:
|
||||
image: librenms/librenms:edge
|
||||
hostname: librenms-syslogng
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
- NET_RAW
|
||||
depends_on:
|
||||
- librenms
|
||||
- redis
|
||||
volumes:
|
||||
- "librenms:/data"
|
||||
environment:
|
||||
<<: *envlibrenms
|
||||
TZ: *TZ
|
||||
PUID: *PUID
|
||||
PGID: *PGID
|
||||
DB_HOST: "db"
|
||||
DB_NAME: *MYSQL_DATABASE
|
||||
DB_USER: *MYSQL_USER
|
||||
DB_PASSWORD: *MYSQL_PASSWORD
|
||||
DB_TIMEOUT: "60"
|
||||
SIDECAR_SYSLOGNG: "1"
|
||||
restart: always
|
||||
|
||||
volumes:
|
||||
db:
|
||||
librenms:
|
||||
7
examples/rrdcached-server/.env
Normal file
7
examples/rrdcached-server/.env
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
TZ=Europe/Paris
|
||||
PUID=1000
|
||||
PGID=1000
|
||||
|
||||
MYSQL_DATABASE=librenms
|
||||
MYSQL_USER=librenms
|
||||
MYSQL_PASSWORD=asupersecretpassword
|
||||
176
examples/rrdcached-server/compose.yml
Normal file
176
examples/rrdcached-server/compose.yml
Normal file
|
|
@ -0,0 +1,176 @@
|
|||
name: librenms
|
||||
|
||||
services:
|
||||
db:
|
||||
image: mariadb:10
|
||||
container_name: librenms_db
|
||||
command:
|
||||
- "mysqld"
|
||||
- "--innodb-file-per-table=1"
|
||||
- "--lower-case-table-names=0"
|
||||
- "--character-set-server=utf8mb4"
|
||||
- "--collation-server=utf8mb4_unicode_ci"
|
||||
volumes:
|
||||
- "./db:/var/lib/mysql"
|
||||
environment:
|
||||
- "TZ=${TZ}"
|
||||
- "MARIADB_RANDOM_ROOT_PASSWORD=yes"
|
||||
- "MYSQL_DATABASE=${MYSQL_DATABASE}"
|
||||
- "MYSQL_USER=${MYSQL_USER}"
|
||||
- "MYSQL_PASSWORD=${MYSQL_PASSWORD}"
|
||||
restart: always
|
||||
|
||||
redis:
|
||||
image: redis:7.2-alpine
|
||||
container_name: librenms_redis
|
||||
environment:
|
||||
- "TZ=${TZ}"
|
||||
restart: always
|
||||
|
||||
rrdcached:
|
||||
image: crazymax/rrdcached
|
||||
container_name: librenms_rrdcached
|
||||
volumes:
|
||||
- "./rrd/db:/data/db"
|
||||
- "./rrd/journal:/data/journal"
|
||||
environment:
|
||||
- "TZ=${TZ}"
|
||||
- "PUID=${PUID}"
|
||||
- "PGID=${PGID}"
|
||||
- "LOG_LEVEL=LOG_INFO"
|
||||
- "WRITE_TIMEOUT=1800"
|
||||
- "WRITE_JITTER=1800"
|
||||
- "WRITE_THREADS=4"
|
||||
- "FLUSH_DEAD_DATA_INTERVAL=3600"
|
||||
restart: always
|
||||
|
||||
msmtpd:
|
||||
image: crazymax/msmtpd:latest
|
||||
container_name: librenms_msmtpd
|
||||
env_file:
|
||||
- "./msmtpd.env"
|
||||
restart: always
|
||||
|
||||
librenms:
|
||||
image: librenms/librenms:latest
|
||||
container_name: librenms
|
||||
hostname: librenms
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
- NET_RAW
|
||||
ports:
|
||||
- target: 8000
|
||||
published: 8000
|
||||
protocol: tcp
|
||||
depends_on:
|
||||
- db
|
||||
- redis
|
||||
- rrdcached
|
||||
- msmtpd
|
||||
volumes:
|
||||
- "./librenms:/data"
|
||||
env_file:
|
||||
- "./librenms.env"
|
||||
environment:
|
||||
- "TZ=${TZ}"
|
||||
- "PUID=${PUID}"
|
||||
- "PGID=${PGID}"
|
||||
- "DB_HOST=db"
|
||||
- "DB_NAME=${MYSQL_DATABASE}"
|
||||
- "DB_USER=${MYSQL_USER}"
|
||||
- "DB_PASSWORD=${MYSQL_PASSWORD}"
|
||||
- "DB_TIMEOUT=60"
|
||||
restart: always
|
||||
|
||||
dispatcher:
|
||||
image: librenms/librenms:latest
|
||||
container_name: librenms_dispatcher
|
||||
hostname: librenms-dispatcher
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
- NET_RAW
|
||||
depends_on:
|
||||
- librenms
|
||||
- redis
|
||||
volumes:
|
||||
- "./librenms:/data"
|
||||
env_file:
|
||||
- "./librenms.env"
|
||||
environment:
|
||||
- "TZ=${TZ}"
|
||||
- "PUID=${PUID}"
|
||||
- "PGID=${PGID}"
|
||||
- "DB_HOST=db"
|
||||
- "DB_NAME=${MYSQL_DATABASE}"
|
||||
- "DB_USER=${MYSQL_USER}"
|
||||
- "DB_PASSWORD=${MYSQL_PASSWORD}"
|
||||
- "DB_TIMEOUT=60"
|
||||
- "DISPATCHER_NODE_ID=dispatcher1"
|
||||
- "SIDECAR_DISPATCHER=1"
|
||||
restart: always
|
||||
|
||||
syslogng:
|
||||
image: librenms/librenms:latest
|
||||
container_name: librenms_syslogng
|
||||
hostname: librenms-syslogng
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
- NET_RAW
|
||||
depends_on:
|
||||
- librenms
|
||||
- redis
|
||||
ports:
|
||||
- target: 514
|
||||
published: 514
|
||||
protocol: tcp
|
||||
- target: 514
|
||||
published: 514
|
||||
protocol: udp
|
||||
volumes:
|
||||
- "./librenms:/data"
|
||||
env_file:
|
||||
- "./librenms.env"
|
||||
environment:
|
||||
- "TZ=${TZ}"
|
||||
- "PUID=${PUID}"
|
||||
- "PGID=${PGID}"
|
||||
- "DB_HOST=db"
|
||||
- "DB_NAME=${MYSQL_DATABASE}"
|
||||
- "DB_USER=${MYSQL_USER}"
|
||||
- "DB_PASSWORD=${MYSQL_PASSWORD}"
|
||||
- "DB_TIMEOUT=60"
|
||||
- "SIDECAR_SYSLOGNG=1"
|
||||
restart: always
|
||||
|
||||
snmptrapd:
|
||||
image: librenms/librenms:latest
|
||||
container_name: librenms_snmptrapd
|
||||
hostname: librenms-snmptrapd
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
- NET_RAW
|
||||
depends_on:
|
||||
- librenms
|
||||
- redis
|
||||
ports:
|
||||
- target: 162
|
||||
published: 162
|
||||
protocol: tcp
|
||||
- target: 162
|
||||
published: 162
|
||||
protocol: udp
|
||||
volumes:
|
||||
- "./librenms:/data"
|
||||
env_file:
|
||||
- "./librenms.env"
|
||||
environment:
|
||||
- "TZ=${TZ}"
|
||||
- "PUID=${PUID}"
|
||||
- "PGID=${PGID}"
|
||||
- "DB_HOST=db"
|
||||
- "DB_NAME=${MYSQL_DATABASE}"
|
||||
- "DB_USER=${MYSQL_USER}"
|
||||
- "DB_PASSWORD=${MYSQL_PASSWORD}"
|
||||
- "DB_TIMEOUT=60"
|
||||
- "SIDECAR_SNMPTRAPD=1"
|
||||
restart: always
|
||||
17
examples/rrdcached-server/librenms.env
Normal file
17
examples/rrdcached-server/librenms.env
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
MEMORY_LIMIT=256M
|
||||
MAX_INPUT_VARS=1000
|
||||
UPLOAD_MAX_SIZE=16M
|
||||
OPCACHE_MEM_SIZE=128
|
||||
REAL_IP_FROM=0.0.0.0/32
|
||||
REAL_IP_HEADER=X-Forwarded-For
|
||||
LOG_IP_VAR=remote_addr
|
||||
|
||||
CACHE_DRIVER=redis
|
||||
SESSION_DRIVER=redis
|
||||
REDIS_HOST=redis
|
||||
|
||||
LIBRENMS_SNMP_COMMUNITY=librenmsdocker
|
||||
RRDCACHED_SERVER=rrdcached:42217
|
||||
|
||||
LIBRENMS_WEATHERMAP=false
|
||||
LIBRENMS_WEATHERMAP_SCHEDULE=*/5 * * * *
|
||||
10
examples/rrdcached-server/msmtpd.env
Normal file
10
examples/rrdcached-server/msmtpd.env
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
# https://github.com/crazy-max/docker-msmtpd
|
||||
SMTP_HOST=smtp.gmail.com
|
||||
SMTP_PORT=587
|
||||
SMTP_TLS=on
|
||||
SMTP_STARTTLS=on
|
||||
SMTP_TLS_CHECKCERT=on
|
||||
SMTP_AUTH=on
|
||||
SMTP_USER=foo
|
||||
SMTP_PASSWORD=bar
|
||||
SMTP_FROM=foo@gmail.com
|
||||
7
examples/traefik/.env
Normal file
7
examples/traefik/.env
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
TZ=Europe/Paris
|
||||
PUID=1000
|
||||
PGID=1000
|
||||
|
||||
MYSQL_DATABASE=librenms
|
||||
MYSQL_USER=librenms
|
||||
MYSQL_PASSWORD=asupersecretpassword
|
||||
184
examples/traefik/compose.yml
Normal file
184
examples/traefik/compose.yml
Normal file
|
|
@ -0,0 +1,184 @@
|
|||
name: librenms
|
||||
|
||||
services:
|
||||
traefik:
|
||||
image: traefik:2.5
|
||||
container_name: traefik
|
||||
command:
|
||||
- "--global.checknewversion=false"
|
||||
- "--global.sendanonymoususage=false"
|
||||
- "--log=true"
|
||||
- "--log.level=INFO"
|
||||
- "--entrypoints.http=true"
|
||||
- "--entrypoints.http.address=:80"
|
||||
- "--entrypoints.http.http.redirections.entrypoint.to=https"
|
||||
- "--entrypoints.http.http.redirections.entrypoint.scheme=https"
|
||||
- "--entrypoints.https=true"
|
||||
- "--entrypoints.https.address=:443"
|
||||
- "--certificatesresolvers.letsencrypt"
|
||||
- "--certificatesresolvers.letsencrypt.acme.storage=acme.json"
|
||||
- "--certificatesresolvers.letsencrypt.acme.email=webmaster@example.com"
|
||||
- "--certificatesresolvers.letsencrypt.acme.httpchallenge"
|
||||
- "--certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=http"
|
||||
- "--providers.docker"
|
||||
- "--providers.docker.watch=true"
|
||||
- "--providers.docker.exposedbydefault=false"
|
||||
ports:
|
||||
- target: 80
|
||||
published: 80
|
||||
protocol: tcp
|
||||
- target: 443
|
||||
published: 443
|
||||
protocol: tcp
|
||||
volumes:
|
||||
- "./acme.json:/acme.json"
|
||||
- "/var/run/docker.sock:/var/run/docker.sock"
|
||||
restart: always
|
||||
|
||||
db:
|
||||
image: mariadb:10
|
||||
container_name: librenms_db
|
||||
command:
|
||||
- "mysqld"
|
||||
- "--innodb-file-per-table=1"
|
||||
- "--lower-case-table-names=0"
|
||||
- "--character-set-server=utf8mb4"
|
||||
- "--collation-server=utf8mb4_unicode_ci"
|
||||
volumes:
|
||||
- "./db:/var/lib/mysql"
|
||||
environment:
|
||||
- "TZ=${TZ}"
|
||||
- "MARIADB_RANDOM_ROOT_PASSWORD=yes"
|
||||
- "MYSQL_DATABASE=${MYSQL_DATABASE}"
|
||||
- "MYSQL_USER=${MYSQL_USER}"
|
||||
- "MYSQL_PASSWORD=${MYSQL_PASSWORD}"
|
||||
restart: always
|
||||
|
||||
redis:
|
||||
image: redis:7.2-alpine
|
||||
container_name: librenms_redis
|
||||
environment:
|
||||
- "TZ=${TZ}"
|
||||
restart: always
|
||||
|
||||
msmtpd:
|
||||
image: crazymax/msmtpd:latest
|
||||
container_name: librenms_msmtpd
|
||||
env_file:
|
||||
- "./msmtpd.env"
|
||||
restart: always
|
||||
|
||||
librenms:
|
||||
image: librenms/librenms:latest
|
||||
container_name: librenms
|
||||
hostname: librenms
|
||||
depends_on:
|
||||
- db
|
||||
- redis
|
||||
- msmtpd
|
||||
volumes:
|
||||
- "./librenms:/data"
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.librenms.entrypoints=https"
|
||||
- "traefik.http.routers.librenms.rule=Host(`librenms.example.com`)"
|
||||
- "traefik.http.routers.librenms.tls=true"
|
||||
- "traefik.http.routers.librenms.tls.certresolver=letsencrypt"
|
||||
- "traefik.http.routers.librenms.tls.domains[0].main=librenms.example.com"
|
||||
- "traefik.http.services.librenms.loadbalancer.server.port=8000"
|
||||
env_file:
|
||||
- "./librenms.env"
|
||||
environment:
|
||||
- "TZ=${TZ}"
|
||||
- "PUID=${PUID}"
|
||||
- "PGID=${PGID}"
|
||||
- "DB_HOST=db"
|
||||
- "DB_NAME=${MYSQL_DATABASE}"
|
||||
- "DB_USER=${MYSQL_USER}"
|
||||
- "DB_PASSWORD=${MYSQL_PASSWORD}"
|
||||
- "DB_TIMEOUT=60"
|
||||
restart: always
|
||||
|
||||
dispatcher:
|
||||
image: librenms/librenms:latest
|
||||
container_name: librenms_dispatcher
|
||||
hostname: librenms-dispatcher
|
||||
depends_on:
|
||||
- librenms
|
||||
- redis
|
||||
volumes:
|
||||
- "./librenms:/data"
|
||||
env_file:
|
||||
- "./librenms.env"
|
||||
environment:
|
||||
- "TZ=${TZ}"
|
||||
- "PUID=${PUID}"
|
||||
- "PGID=${PGID}"
|
||||
- "DB_HOST=db"
|
||||
- "DB_NAME=${MYSQL_DATABASE}"
|
||||
- "DB_USER=${MYSQL_USER}"
|
||||
- "DB_PASSWORD=${MYSQL_PASSWORD}"
|
||||
- "DB_TIMEOUT=60"
|
||||
- "DISPATCHER_NODE_ID=dispatcher1"
|
||||
- "SIDECAR_DISPATCHER=1"
|
||||
restart: always
|
||||
|
||||
syslogng:
|
||||
image: librenms/librenms:latest
|
||||
container_name: librenms_syslog
|
||||
hostname: librenms-syslogng
|
||||
depends_on:
|
||||
- librenms
|
||||
- redis
|
||||
ports:
|
||||
- target: 514
|
||||
published: 514
|
||||
protocol: tcp
|
||||
- target: 514
|
||||
published: 514
|
||||
protocol: udp
|
||||
volumes:
|
||||
- "./librenms:/data"
|
||||
env_file:
|
||||
- "./librenms.env"
|
||||
environment:
|
||||
- "TZ=${TZ}"
|
||||
- "PUID=${PUID}"
|
||||
- "PGID=${PGID}"
|
||||
- "DB_HOST=db"
|
||||
- "DB_NAME=${MYSQL_DATABASE}"
|
||||
- "DB_USER=${MYSQL_USER}"
|
||||
- "DB_PASSWORD=${MYSQL_PASSWORD}"
|
||||
- "DB_TIMEOUT=60"
|
||||
- "SIDECAR_SYSLOGNG=1"
|
||||
restart: always
|
||||
|
||||
snmptrapd:
|
||||
image: librenms/librenms:latest
|
||||
container_name: librenms_snmptrapd
|
||||
hostname: librenms-snmptrapd
|
||||
depends_on:
|
||||
- librenms
|
||||
- redis
|
||||
ports:
|
||||
- target: 162
|
||||
published: 162
|
||||
protocol: tcp
|
||||
- target: 162
|
||||
published: 162
|
||||
protocol: udp
|
||||
volumes:
|
||||
- "./librenms:/data"
|
||||
env_file:
|
||||
- "./librenms.env"
|
||||
environment:
|
||||
- "TZ=${TZ}"
|
||||
- "PUID=${PUID}"
|
||||
- "PGID=${PGID}"
|
||||
- "DB_HOST=db"
|
||||
- "DB_NAME=${MYSQL_DATABASE}"
|
||||
- "DB_USER=${MYSQL_USER}"
|
||||
- "DB_PASSWORD=${MYSQL_PASSWORD}"
|
||||
- "DB_TIMEOUT=60"
|
||||
- "SIDECAR_SNMPTRAPD=1"
|
||||
restart: always
|
||||
16
examples/traefik/librenms.env
Normal file
16
examples/traefik/librenms.env
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
MEMORY_LIMIT=256M
|
||||
MAX_INPUT_VARS=1000
|
||||
UPLOAD_MAX_SIZE=16M
|
||||
OPCACHE_MEM_SIZE=128
|
||||
REAL_IP_FROM=0.0.0.0/32
|
||||
REAL_IP_HEADER=X-Forwarded-For
|
||||
LOG_IP_VAR=http_x_forwarded_for
|
||||
|
||||
CACHE_DRIVER=redis
|
||||
SESSION_DRIVER=redis
|
||||
REDIS_HOST=redis
|
||||
|
||||
LIBRENMS_SNMP_COMMUNITY=librenmsdocker
|
||||
|
||||
LIBRENMS_WEATHERMAP=false
|
||||
LIBRENMS_WEATHERMAP_SCHEDULE=*/5 * * * *
|
||||
10
examples/traefik/msmtpd.env
Normal file
10
examples/traefik/msmtpd.env
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
# https://github.com/crazy-max/docker-msmtpd
|
||||
SMTP_HOST=smtp.gmail.com
|
||||
SMTP_PORT=587
|
||||
SMTP_TLS=on
|
||||
SMTP_STARTTLS=on
|
||||
SMTP_TLS_CHECKCERT=on
|
||||
SMTP_AUTH=on
|
||||
SMTP_USER=foo
|
||||
SMTP_PASSWORD=bar
|
||||
SMTP_FROM=foo@gmail.com
|
||||
5
rootfs/etc/cont-init.d/00-fix-logs.sh
Normal file
5
rootfs/etc/cont-init.d/00-fix-logs.sh
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#!/usr/bin/with-contenv sh
|
||||
# shellcheck shell=sh
|
||||
|
||||
# Fix access rights to stdout and stderr
|
||||
chown ${PUID}:${PGID} /proc/self/fd/1 /proc/self/fd/2 || true
|
||||
13
rootfs/etc/cont-init.d/01-fix-uidgid.sh
Normal file
13
rootfs/etc/cont-init.d/01-fix-uidgid.sh
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#!/usr/bin/with-contenv sh
|
||||
# shellcheck shell=sh
|
||||
set -e
|
||||
|
||||
if [ -n "${PGID}" ] && [ "${PGID}" != "$(id -g librenms)" ]; then
|
||||
echo "Switching to PGID ${PGID}..."
|
||||
sed -i -e "s/^librenms:\([^:]*\):[0-9]*/librenms:\1:${PGID}/" /etc/group
|
||||
sed -i -e "s/^librenms:\([^:]*\):\([0-9]*\):[0-9]*/librenms:\1:\2:${PGID}/" /etc/passwd
|
||||
fi
|
||||
if [ -n "${PUID}" ] && [ "${PUID}" != "$(id -u librenms)" ]; then
|
||||
echo "Switching to PUID ${PUID}..."
|
||||
sed -i -e "s/^librenms:\([^:]*\):[0-9]*:\([0-9]*\)/librenms:\1:${PUID}:\2/" /etc/passwd
|
||||
fi
|
||||
22
rootfs/etc/cont-init.d/02-fix-perms.sh
Normal file
22
rootfs/etc/cont-init.d/02-fix-perms.sh
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#!/usr/bin/with-contenv sh
|
||||
# shellcheck shell=sh
|
||||
set -e
|
||||
|
||||
echo "Fixing perms..."
|
||||
mkdir -p /data \
|
||||
/var/run/nginx \
|
||||
/var/run/php-fpm
|
||||
chown librenms:librenms \
|
||||
/data \
|
||||
"${LIBRENMS_PATH}" \
|
||||
"${LIBRENMS_PATH}/.env" \
|
||||
"${LIBRENMS_PATH}/cache" \
|
||||
"${LIBRENMS_PATH}/rrd"
|
||||
chown -R librenms:librenms \
|
||||
/home/librenms \
|
||||
/tpls \
|
||||
/var/lib/nginx \
|
||||
/var/log/nginx \
|
||||
/var/log/php83 \
|
||||
/var/run/nginx \
|
||||
/var/run/php-fpm
|
||||
259
rootfs/etc/cont-init.d/03-config.sh
Normal file
259
rootfs/etc/cont-init.d/03-config.sh
Normal file
|
|
@ -0,0 +1,259 @@
|
|||
#!/usr/bin/with-contenv bash
|
||||
# shellcheck shell=bash
|
||||
set -e
|
||||
|
||||
# From https://github.com/docker-library/mariadb/blob/master/docker-entrypoint.sh#L21-L41
|
||||
# usage: file_env VAR [DEFAULT]
|
||||
# ie: file_env 'XYZ_DB_PASSWORD' 'example'
|
||||
# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of
|
||||
# "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature)
|
||||
file_env() {
|
||||
local var="$1"
|
||||
local fileVar="${var}_FILE"
|
||||
local def="${2:-}"
|
||||
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
|
||||
echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
|
||||
exit 1
|
||||
fi
|
||||
local val="$def"
|
||||
if [ "${!var:-}" ]; then
|
||||
val="${!var}"
|
||||
elif [ "${!fileVar:-}" ]; then
|
||||
val="$(<"${!fileVar}")"
|
||||
fi
|
||||
export "$var"="$val"
|
||||
unset "$fileVar"
|
||||
}
|
||||
|
||||
TZ=${TZ:-UTC}
|
||||
|
||||
MEMORY_LIMIT=${MEMORY_LIMIT:-256M}
|
||||
UPLOAD_MAX_SIZE=${UPLOAD_MAX_SIZE:-16M}
|
||||
CLEAR_ENV=${CLEAR_ENV:-yes}
|
||||
FPM_PM_MAX_CHILDREN=${FPM_PM_MAX_CHILDREN:-15}
|
||||
FPM_PM_START_SERVERS=${FPM_PM_START_SERVERS:-2}
|
||||
FPM_PM_MIN_SPARE_SERVERS=${FPM_PM_MIN_SPARE_SERVERS:-1}
|
||||
FPM_PM_MAX_SPARE_SERVERS=${FPM_PM_MAX_SPARE_SERVERS:-6}
|
||||
OPCACHE_MEM_SIZE=${OPCACHE_MEM_SIZE:-128}
|
||||
LISTEN_IPV6=${LISTEN_IPV6:-true}
|
||||
REAL_IP_FROM=${REAL_IP_FROM:-"0.0.0.0/32"}
|
||||
REAL_IP_HEADER=${REAL_IP_HEADER:-"X-Forwarded-For"}
|
||||
LOG_IP_VAR=${LOG_IP_VAR:-remote_addr}
|
||||
MAX_INPUT_VARS=${MAX_INPUT_VARS:-1000}
|
||||
|
||||
MEMCACHED_PORT=${MEMCACHED_PORT:-11211}
|
||||
|
||||
DB_PORT=${DB_PORT:-3306}
|
||||
DB_NAME=${DB_NAME:-librenms}
|
||||
DB_USER=${DB_USER:-librenms}
|
||||
DB_TIMEOUT=${DB_TIMEOUT:-30}
|
||||
|
||||
LIBRENMS_BASE_URL=${LIBRENMS_BASE_URL:-/}
|
||||
|
||||
# Timezone
|
||||
echo "Setting timezone to ${TZ}..."
|
||||
ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime
|
||||
echo ${TZ} >/etc/timezone
|
||||
|
||||
# PHP
|
||||
echo "Setting PHP-FPM configuration..."
|
||||
sed -e "s/@MEMORY_LIMIT@/$MEMORY_LIMIT/g" \
|
||||
-e "s/@UPLOAD_MAX_SIZE@/$UPLOAD_MAX_SIZE/g" \
|
||||
-e "s/@CLEAR_ENV@/$CLEAR_ENV/g" \
|
||||
-e "s/@FPM_PM_MAX_CHILDREN@/$FPM_PM_MAX_CHILDREN/g" \
|
||||
-e "s/@FPM_PM_START_SERVERS@/$FPM_PM_START_SERVERS/g" \
|
||||
-e "s/@FPM_PM_MIN_SPARE_SERVERS@/$FPM_PM_MIN_SPARE_SERVERS/g" \
|
||||
-e "s/@FPM_PM_MAX_SPARE_SERVERS@/$FPM_PM_MAX_SPARE_SERVERS/g" \
|
||||
/tpls/etc/php83/php-fpm.d/www.conf >/etc/php83/php-fpm.d/www.conf
|
||||
|
||||
echo "Setting PHP INI configuration..."
|
||||
sed -i "s|memory_limit.*|memory_limit = ${MEMORY_LIMIT}|g" /etc/php83/php.ini
|
||||
sed -i "s|;date\.timezone.*|date\.timezone = ${TZ}|g" /etc/php83/php.ini
|
||||
sed -i "s|;max_input_vars.*|max_input_vars = ${MAX_INPUT_VARS}|g" /etc/php83/php.ini
|
||||
|
||||
# OpCache
|
||||
echo "Setting OpCache configuration..."
|
||||
sed -e "s/@OPCACHE_MEM_SIZE@/$OPCACHE_MEM_SIZE/g" \
|
||||
/tpls/etc/php83/conf.d/opcache.ini >/etc/php83/conf.d/opcache.ini
|
||||
|
||||
# Nginx
|
||||
echo "Setting Nginx configuration..."
|
||||
sed -e "s#@UPLOAD_MAX_SIZE@#$UPLOAD_MAX_SIZE#g" \
|
||||
-e "s#@REAL_IP_FROM@#$REAL_IP_FROM#g" \
|
||||
-e "s#@REAL_IP_HEADER@#$REAL_IP_HEADER#g" \
|
||||
-e "s#@LOG_IP_VAR@#$LOG_IP_VAR#g" \
|
||||
/tpls/etc/nginx/nginx.conf >/etc/nginx/nginx.conf
|
||||
|
||||
if [ "$LISTEN_IPV6" != "true" ]; then
|
||||
sed -e '/listen \[::\]:/d' -i /etc/nginx/nginx.conf
|
||||
fi
|
||||
|
||||
# SNMP
|
||||
echo "Updating SNMP community..."
|
||||
file_env 'LIBRENMS_SNMP_COMMUNITY' 'librenmsdocker'
|
||||
sed -i -e "s/RANDOMSTRINGGOESHERE/${LIBRENMS_SNMP_COMMUNITY}/" /etc/snmp/snmpd.conf
|
||||
|
||||
# Init files and folders
|
||||
echo "Initializing LibreNMS files / folders..."
|
||||
mkdir -p /data/config /data/logs /data/monitoring-plugins /data/plugins /data/rrd /data/weathermap /data/alert-templates
|
||||
|
||||
if [ -d "${LIBRENMS_PATH}/html/plugins/Weathermap" ]; then
|
||||
if [ -d "${LIBRENMS_PATH}/html/plugins/Weathermap/configs" ] && [ ! -L "${LIBRENMS_PATH}/html/plugins/Weathermap/configs" ]; then
|
||||
rm -rf ${LIBRENMS_PATH}/html/plugins/Weathermap/configs
|
||||
fi
|
||||
if [ ! -L "${LIBRENMS_PATH}/html/plugins/Weathermap/configs" ]; then
|
||||
ln -sf /data/weathermap ${LIBRENMS_PATH}/html/plugins/Weathermap/configs
|
||||
fi
|
||||
chown -h librenms:librenms ${LIBRENMS_PATH}/html/plugins/Weathermap/configs
|
||||
find /data/weathermap ${LIBRENMS_PATH}/html/plugins/Weathermap/output \( ! -user librenms -o ! -group librenms \) -exec chown librenms:librenms {} +
|
||||
fi
|
||||
|
||||
# cleanup bad symlink: https://github.com/librenms/docker/issues/294#issuecomment-1190389960
|
||||
if [ -L "/data/weathermap/weathermap" ]; then
|
||||
rm /data/weathermap/weathermap
|
||||
fi
|
||||
|
||||
touch /data/logs/librenms.log
|
||||
rm -rf ${LIBRENMS_PATH}/logs
|
||||
rm -f ${LIBRENMS_PATH}/config.d/*
|
||||
mkdir -p /etc/logrotate.d
|
||||
touch /etc/logrotate.d/librenms
|
||||
|
||||
echo "Setting LibreNMS configuration..."
|
||||
|
||||
# Env file
|
||||
if [ -z "$DB_HOST" ]; then
|
||||
echo >&2 "ERROR: DB_HOST must be defined"
|
||||
exit 1
|
||||
fi
|
||||
file_env 'DB_PASSWORD'
|
||||
if [ -z "$DB_PASSWORD" ]; then
|
||||
echo >&2 "ERROR: Either DB_PASSWORD or DB_PASSWORD_FILE must be defined"
|
||||
exit 1
|
||||
fi
|
||||
cat >${LIBRENMS_PATH}/.env <<EOL
|
||||
APP_URL=${LIBRENMS_BASE_URL}
|
||||
DB_HOST=${DB_HOST}
|
||||
DB_PORT=${DB_PORT}
|
||||
DB_DATABASE=${DB_NAME}
|
||||
DB_USERNAME=${DB_USER}
|
||||
DB_PASSWORD="${DB_PASSWORD}"
|
||||
EOL
|
||||
|
||||
# Config : Directories
|
||||
cat >${LIBRENMS_PATH}/database/seeders/config/directories.yaml <<EOL
|
||||
install_dir: '${LIBRENMS_PATH}'
|
||||
log_dir: /data/logs
|
||||
rrd_dir: /data/rrd
|
||||
EOL
|
||||
ln -sf /data/logs ${LIBRENMS_PATH}/logs
|
||||
|
||||
# Config : Server
|
||||
cat >${LIBRENMS_PATH}/database/seeders/config/server.yaml <<EOL
|
||||
own_hostname: '$(hostname)'
|
||||
base_url: '${LIBRENMS_BASE_URL}'
|
||||
EOL
|
||||
|
||||
# Config : User
|
||||
cat >${LIBRENMS_PATH}/database/seeders/config/user.yaml <<EOL
|
||||
user: librenms
|
||||
group: librenms
|
||||
EOL
|
||||
|
||||
# Config : Fping
|
||||
cat >${LIBRENMS_PATH}/database/seeders/config/fping.yaml <<EOL
|
||||
fping: /usr/sbin/fping
|
||||
fping6: /usr/sbin/fping6
|
||||
EOL
|
||||
|
||||
# Config : ipmitool
|
||||
cat >${LIBRENMS_PATH}/database/seeders/config/ipmitool.yaml <<EOL
|
||||
ipmitool: /usr/sbin/ipmitool
|
||||
EOL
|
||||
|
||||
# Config : Disable autoupdate (set in config.php so it cannot be overridden in the webui)
|
||||
cat >${LIBRENMS_PATH}/config.d/autoupdate.php <<EOL
|
||||
<?php
|
||||
\$config['update'] = 0;
|
||||
EOL
|
||||
|
||||
# Config : Services
|
||||
cat >${LIBRENMS_PATH}/database/seeders/config/services.yaml <<EOL
|
||||
show_services: true
|
||||
nagios_plugins: /usr/lib/monitoring-plugins
|
||||
EOL
|
||||
|
||||
# Config : RRDCached, apply RRDCACHED_SERVER as php as it would be expected to change with the variable
|
||||
if [ -n "${RRDCACHED_SERVER}" ]; then
|
||||
cat >${LIBRENMS_PATH}/config.d/rrdcached.php <<EOL
|
||||
<?php
|
||||
\$config['rrdcached'] = "${RRDCACHED_SERVER}";
|
||||
EOL
|
||||
fi
|
||||
cat >${LIBRENMS_PATH}/database/seeders/config/rrdtool.yaml <<EOL
|
||||
rrdtool_version: "1.7.2"
|
||||
EOL
|
||||
|
||||
# Config : Dispatcher
|
||||
cat >${LIBRENMS_PATH}/database/seeders/config/dispatcher.yaml <<EOL
|
||||
service_update_enabled: false
|
||||
service_watchdog_enabled: false
|
||||
EOL
|
||||
|
||||
# Check plugins
|
||||
echo "Checking LibreNMS plugins..."
|
||||
plugins=$(ls -l /data/plugins | egrep '^d' | awk '{print $9}')
|
||||
for plugin in ${plugins}; do
|
||||
if [ "${plugin}" == "Weathermap" ]; then
|
||||
echo " WARNING: Plugin Weathermap cannot be overriden. Skipping..."
|
||||
continue
|
||||
fi
|
||||
echo " Linking plugin ${plugin}..."
|
||||
if [ -d "${LIBRENMS_PATH}/html/plugins/${plugin}" ]; then
|
||||
rm -rf "${LIBRENMS_PATH}/html/plugins/${plugin}"
|
||||
fi
|
||||
ln -sf "/data/plugins/${plugin}" "${LIBRENMS_PATH}/html/plugins/${plugin}"
|
||||
chown -h librenms:librenms "${LIBRENMS_PATH}/html/plugins/${plugin}"
|
||||
done
|
||||
|
||||
# Fix perms
|
||||
echo "Fixing perms..."
|
||||
chown librenms:librenms /data/config /data/monitoring-plugins /data/plugins /data/rrd /data/weathermap /data/alert-templates
|
||||
find /data/logs ${LIBRENMS_PATH}/composer* ${LIBRENMS_PATH}/config.d ${LIBRENMS_PATH}/bootstrap ${LIBRENMS_PATH}/logs ${LIBRENMS_PATH}/storage ${LIBRENMS_PATH}/vendor \( ! -user librenms -o ! -group librenms \) -exec chown librenms:librenms {} +
|
||||
chmod ug+rw /data/logs /data/rrd ${LIBRENMS_PATH}/bootstrap/cache ${LIBRENMS_PATH}/storage ${LIBRENMS_PATH}/storage/framework/*
|
||||
|
||||
# Check additional Monitoring plugins
|
||||
echo "Checking additional Monitoring plugins..."
|
||||
mon_plugins=$(ls -l /data/monitoring-plugins | egrep '^-' | awk '{print $9}')
|
||||
for mon_plugin in ${mon_plugins}; do
|
||||
if [ -f "/usr/lib/monitoring-plugins/${mon_plugin}" ]; then
|
||||
echo " WARNING: Official Monitoring plugin ${mon_plugin} cannot be overriden. Skipping..."
|
||||
continue
|
||||
fi
|
||||
if [[ ${mon_plugin} != check_* ]]; then
|
||||
echo " WARNING: Monitoring plugin filename ${mon_plugin} invalid. It must start with 'check_'. Skipping..."
|
||||
continue
|
||||
fi
|
||||
if [[ ! -x "/data/monitoring-plugins/${mon_plugin}" ]]; then
|
||||
echo " WARNING: Monitoring plugin file ${mon_plugin} has to be executable. Skipping..."
|
||||
continue
|
||||
fi
|
||||
echo " Adding ${mon_plugin} Monitoring plugin"
|
||||
ln -sf /data/monitoring-plugins/${mon_plugin} /usr/lib/monitoring-plugins/${mon_plugin}
|
||||
done
|
||||
|
||||
# Check alert templates
|
||||
echo "Checking alert templates..."
|
||||
templates=$(ls -l /data/alert-templates | egrep '^-' | awk '{print $9}')
|
||||
for template in ${templates}; do
|
||||
if [ -f "${LIBRENMS_PATH}/resources/views/alerts/templates/${template}" ]; then
|
||||
echo " WARNING: Default alert template ${template} cannot be overriden. Skipping..."
|
||||
continue
|
||||
fi
|
||||
if [[ ${template} != *.php ]]; then
|
||||
echo " WARNING: Alert template filename ${template} invalid. It must end with '.php'. Skipping..."
|
||||
continue
|
||||
fi
|
||||
echo " Adding ${template} alert template"
|
||||
ln -sf /data/alert-templates/${template} ${LIBRENMS_PATH}/resources/views/alerts/templates/${template}
|
||||
done
|
||||
112
rootfs/etc/cont-init.d/04-svc-main.sh
Normal file
112
rootfs/etc/cont-init.d/04-svc-main.sh
Normal file
|
|
@ -0,0 +1,112 @@
|
|||
#!/usr/bin/with-contenv bash
|
||||
# shellcheck shell=bash
|
||||
set -e
|
||||
|
||||
# From https://github.com/docker-library/mariadb/blob/master/docker-entrypoint.sh#L21-L41
|
||||
# usage: file_env VAR [DEFAULT]
|
||||
# ie: file_env 'XYZ_DB_PASSWORD' 'example'
|
||||
# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of
|
||||
# "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature)
|
||||
file_env() {
|
||||
local var="$1"
|
||||
local fileVar="${var}_FILE"
|
||||
local def="${2:-}"
|
||||
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
|
||||
echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
|
||||
exit 1
|
||||
fi
|
||||
local val="$def"
|
||||
if [ "${!var:-}" ]; then
|
||||
val="${!var}"
|
||||
elif [ "${!fileVar:-}" ]; then
|
||||
val="$(<"${!fileVar}")"
|
||||
fi
|
||||
export "$var"="$val"
|
||||
unset "$fileVar"
|
||||
}
|
||||
|
||||
DB_PORT=${DB_PORT:-3306}
|
||||
DB_NAME=${DB_NAME:-librenms}
|
||||
DB_USER=${DB_USER:-librenms}
|
||||
DB_TIMEOUT=${DB_TIMEOUT:-60}
|
||||
|
||||
SIDECAR_DISPATCHER=${SIDECAR_DISPATCHER:-0}
|
||||
SIDECAR_SYSLOGNG=${SIDECAR_SYSLOGNG:-0}
|
||||
SIDECAR_SNMPTRAPD=${SIDECAR_SNMPTRAPD:-0}
|
||||
|
||||
if [ "$SIDECAR_DISPATCHER" = "1" ] || [ "$SIDECAR_SYSLOGNG" = "1" ] || [ "$SIDECAR_SNMPTRAPD" = "1" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Handle .env
|
||||
if [ ! -f "/data/.env" ]; then
|
||||
echo "Generating APP_KEY and unique NODE_ID"
|
||||
cat >"/data/.env" <<EOL
|
||||
APP_KEY=$(artisan key:generate --no-interaction --force --show)
|
||||
NODE_ID=$(php -r "echo uniqid();")
|
||||
EOL
|
||||
fi
|
||||
cat "/data/.env" >>"${LIBRENMS_PATH}/.env"
|
||||
chown librenms:librenms /data/.env "${LIBRENMS_PATH}/.env"
|
||||
|
||||
file_env 'DB_PASSWORD'
|
||||
if [ -z "$DB_PASSWORD" ]; then
|
||||
echo >&2 "ERROR: Either DB_PASSWORD or DB_PASSWORD_FILE must be defined"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dbcmd="mariadb -h ${DB_HOST} -P ${DB_PORT} -u "${DB_USER}" "-p${DB_PASSWORD}""
|
||||
unset DB_PASSWORD
|
||||
|
||||
echo "Waiting ${DB_TIMEOUT}s for database to be ready..."
|
||||
counter=1
|
||||
while ! ${dbcmd} -e "show databases;" >/dev/null 2>&1; do
|
||||
sleep 1
|
||||
counter=$((counter + 1))
|
||||
if [ ${counter} -gt ${DB_TIMEOUT} ]; then
|
||||
echo >&2 "ERROR: Failed to connect to database on $DB_HOST"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
echo "Database ready!"
|
||||
|
||||
# Enable first run wizard if db is empty
|
||||
counttables=$(echo 'SHOW TABLES' | ${dbcmd} "$DB_NAME" | wc -l)
|
||||
if [ "${counttables}" -eq "0" ]; then
|
||||
echo "Enabling First Run Wizard..."
|
||||
echo "INSTALL=user,finish" >>${LIBRENMS_PATH}/.env
|
||||
fi
|
||||
|
||||
echo "Updating database schema..."
|
||||
lnms migrate --force --no-ansi --no-interaction
|
||||
artisan db:seed --force --no-ansi --no-interaction
|
||||
|
||||
echo "Clear cache"
|
||||
artisan cache:clear --no-interaction
|
||||
artisan config:cache --no-interaction
|
||||
|
||||
mkdir -p /etc/services.d/nginx
|
||||
cat >/etc/services.d/nginx/run <<EOL
|
||||
#!/usr/bin/execlineb -P
|
||||
with-contenv
|
||||
s6-setuidgid ${PUID}:${PGID}
|
||||
nginx -g "daemon off;"
|
||||
EOL
|
||||
chmod +x /etc/services.d/nginx/run
|
||||
|
||||
mkdir -p /etc/services.d/php-fpm
|
||||
cat >/etc/services.d/php-fpm/run <<EOL
|
||||
#!/usr/bin/execlineb -P
|
||||
with-contenv
|
||||
s6-setuidgid ${PUID}:${PGID}
|
||||
php-fpm83 -F
|
||||
EOL
|
||||
chmod +x /etc/services.d/php-fpm/run
|
||||
|
||||
mkdir -p /etc/services.d/snmpd
|
||||
cat >/etc/services.d/snmpd/run <<EOL
|
||||
#!/usr/bin/execlineb -P
|
||||
with-contenv
|
||||
/usr/sbin/snmpd -f -c /etc/snmp/snmpd.conf
|
||||
EOL
|
||||
chmod +x /etc/services.d/snmpd/run
|
||||
127
rootfs/etc/cont-init.d/05-svc-dispatcher.sh
Normal file
127
rootfs/etc/cont-init.d/05-svc-dispatcher.sh
Normal file
|
|
@ -0,0 +1,127 @@
|
|||
#!/usr/bin/with-contenv bash
|
||||
# shellcheck shell=bash
|
||||
set -e
|
||||
|
||||
# From https://github.com/docker-library/mariadb/blob/master/docker-entrypoint.sh#L21-L41
|
||||
# usage: file_env VAR [DEFAULT]
|
||||
# ie: file_env 'XYZ_DB_PASSWORD' 'example'
|
||||
# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of
|
||||
# "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature)
|
||||
file_env() {
|
||||
local var="$1"
|
||||
local fileVar="${var}_FILE"
|
||||
local def="${2:-}"
|
||||
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
|
||||
echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
|
||||
exit 1
|
||||
fi
|
||||
local val="$def"
|
||||
if [ "${!var:-}" ]; then
|
||||
val="${!var}"
|
||||
elif [ "${!fileVar:-}" ]; then
|
||||
val="$(<"${!fileVar}")"
|
||||
fi
|
||||
export "$var"="$val"
|
||||
unset "$fileVar"
|
||||
}
|
||||
|
||||
DB_PORT=${DB_PORT:-3306}
|
||||
DB_NAME=${DB_NAME:-librenms}
|
||||
DB_USER=${DB_USER:-librenms}
|
||||
DB_TIMEOUT=${DB_TIMEOUT:-60}
|
||||
|
||||
SIDECAR_DISPATCHER=${SIDECAR_DISPATCHER:-0}
|
||||
#DISPATCHER_NODE_ID=${DISPATCHER_NODE_ID:-dispatcher1}
|
||||
|
||||
#REDIS_HOST=${REDIS_HOST:-localhost}
|
||||
REDIS_SCHEME=${REDIS_SCHEME:-tcp}
|
||||
REDIS_PORT=${REDIS_PORT:-6379}
|
||||
#REDIS_SENTINEL=${REDIS_SENTINEL:-localhost}
|
||||
REDIS_SENTINEL_SERVICE=${REDIS_SENTINEL_SERVICE:-librenms}
|
||||
file_env 'REDIS_PASSWORD'
|
||||
REDIS_DB=${REDIS_DB:-0}
|
||||
|
||||
# Continue only if sidecar dispatcher container
|
||||
if [ "$SIDECAR_DISPATCHER" != "1" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo ">>"
|
||||
echo ">> Sidecar dispatcher container detected"
|
||||
echo ">>"
|
||||
|
||||
file_env 'DB_PASSWORD'
|
||||
if [ -z "$DB_PASSWORD" ]; then
|
||||
echo >&2 "ERROR: Either DB_PASSWORD or DB_PASSWORD_FILE must be defined"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dbcmd="mariadb -h ${DB_HOST} -P ${DB_PORT} -u "${DB_USER}" "-p${DB_PASSWORD}""
|
||||
unset DB_PASSWORD
|
||||
|
||||
echo "Waiting ${DB_TIMEOUT}s for database to be ready..."
|
||||
counter=1
|
||||
while ! ${dbcmd} -e "show databases;" >/dev/null 2>&1; do
|
||||
sleep 1
|
||||
counter=$((counter + 1))
|
||||
if [ ${counter} -gt ${DB_TIMEOUT} ]; then
|
||||
echo >&2 "ERROR: Failed to connect to database on $DB_HOST"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
echo "Database ready!"
|
||||
while ! ${dbcmd} -e "desc $DB_NAME.poller_cluster;" >/dev/null 2>&1; do
|
||||
sleep 1
|
||||
counter=$((counter + 1))
|
||||
if [ ${counter} -gt ${DB_TIMEOUT} ]; then
|
||||
echo >&2 "ERROR: Table $DB_NAME.poller_cluster does not exist on $DB_HOST"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
# Node ID
|
||||
if [ ! -f "/data/.env" ]; then
|
||||
echo >&2 "ERROR: /data/.env file does not exist. Please run the main container first"
|
||||
exit 1
|
||||
fi
|
||||
cat "/data/.env" >>"${LIBRENMS_PATH}/.env"
|
||||
if [ -n "$DISPATCHER_NODE_ID" ]; then
|
||||
echo "NODE_ID: $DISPATCHER_NODE_ID"
|
||||
sed -i "s|^NODE_ID=.*|NODE_ID=$DISPATCHER_NODE_ID|g" "${LIBRENMS_PATH}/.env"
|
||||
fi
|
||||
|
||||
# Redis
|
||||
if [ -z "$REDIS_HOST" ] && [ -z "$REDIS_SENTINEL" ]; then
|
||||
echo >&2 "ERROR: REDIS_HOST or REDIS_SENTINEL must be defined"
|
||||
exit 1
|
||||
elif [ -n "$REDIS_SENTINEL" ]; then
|
||||
echo "Setting Redis Sentinel"
|
||||
cat >>${LIBRENMS_PATH}/.env <<EOL
|
||||
REDIS_SENTINEL=${REDIS_SENTINEL}
|
||||
REDIS_SENTINEL_SERVICE=${REDIS_SENTINEL_SERVICE}
|
||||
REDIS_SCHEME=${REDIS_SCHEME}
|
||||
REDIS_PORT=${REDIS_PORT}
|
||||
REDIS_PASSWORD=${REDIS_PASSWORD}
|
||||
REDIS_DB=${REDIS_DB}
|
||||
EOL
|
||||
elif [ -n "$REDIS_HOST" ]; then
|
||||
echo "Setting Redis"
|
||||
cat >>${LIBRENMS_PATH}/.env <<EOL
|
||||
REDIS_HOST=${REDIS_HOST}
|
||||
REDIS_SCHEME=${REDIS_SCHEME}
|
||||
REDIS_PORT=${REDIS_PORT}
|
||||
REDIS_PASSWORD=${REDIS_PASSWORD}
|
||||
REDIS_DB=${REDIS_DB}
|
||||
EOL
|
||||
fi
|
||||
|
||||
# Create service
|
||||
mkdir -p /etc/services.d/dispatcher
|
||||
cat >/etc/services.d/dispatcher/run <<EOL
|
||||
#!/usr/bin/execlineb -P
|
||||
with-contenv
|
||||
s6-setuidgid ${PUID}:${PGID}
|
||||
cd /opt/librenms
|
||||
./librenms-service.py ${DISPATCHER_ARGS}
|
||||
EOL
|
||||
chmod +x /etc/services.d/dispatcher/run
|
||||
27
rootfs/etc/cont-init.d/06-svc-syslogng.sh
Normal file
27
rootfs/etc/cont-init.d/06-svc-syslogng.sh
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#!/usr/bin/with-contenv sh
|
||||
# shellcheck shell=sh
|
||||
set -e
|
||||
|
||||
SIDECAR_SYSLOGNG=${SIDECAR_SYSLOGNG:-0}
|
||||
|
||||
# Continue only if sidecar syslogng container
|
||||
if [ "$SIDECAR_SYSLOGNG" != "1" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo ">>"
|
||||
echo ">> Sidecar syslog-ng container detected"
|
||||
echo ">>"
|
||||
|
||||
mkdir -p /data/syslog-ng /run/syslog-ng
|
||||
chown librenms:librenms /data/syslog-ng
|
||||
chown -R librenms:librenms /run/syslog-ng
|
||||
|
||||
# Create service
|
||||
mkdir -p /etc/services.d/syslogng
|
||||
cat >/etc/services.d/syslogng/run <<EOL
|
||||
#!/usr/bin/execlineb -P
|
||||
with-contenv
|
||||
/usr/sbin/syslog-ng -F
|
||||
EOL
|
||||
chmod +x /etc/services.d/syslogng/run
|
||||
47
rootfs/etc/cont-init.d/07-svc-cron.sh
Normal file
47
rootfs/etc/cont-init.d/07-svc-cron.sh
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
#!/usr/bin/with-contenv bash
|
||||
# shellcheck shell=bash
|
||||
set -e
|
||||
|
||||
CRONTAB_PATH="/var/spool/cron/crontabs"
|
||||
|
||||
LIBRENMS_WEATHERMAP=${LIBRENMS_WEATHERMAP:-false}
|
||||
LIBRENMS_WEATHERMAP_SCHEDULE=${LIBRENMS_WEATHERMAP_SCHEDULE:-*/5 * * * *}
|
||||
LIBRENMS_DAILY_SCHEDULE="15 0 * * *"
|
||||
|
||||
SIDECAR_DISPATCHER=${SIDECAR_DISPATCHER:-0}
|
||||
SIDECAR_SYSLOGNG=${SIDECAR_SYSLOGNG:-0}
|
||||
SIDECAR_SNMPTRAPD=${SIDECAR_SNMPTRAPD:-0}
|
||||
|
||||
if [ "$SIDECAR_DISPATCHER" = "1" ] || [ "$SIDECAR_SYSLOGNG" = "1" ] || [ "$SIDECAR_SNMPTRAPD" = "1" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Init
|
||||
rm -rf ${CRONTAB_PATH}
|
||||
mkdir -m 0644 -p ${CRONTAB_PATH}
|
||||
touch ${CRONTAB_PATH}/librenms
|
||||
|
||||
# Cron
|
||||
echo "Creating LibreNMS daily.sh cron task with the following period fields: $LIBRENMS_DAILY_SCHEDULE"
|
||||
echo "${LIBRENMS_DAILY_SCHEDULE} cd /opt/librenms/ && bash daily.sh" >>${CRONTAB_PATH}/librenms
|
||||
|
||||
if [ "$LIBRENMS_WEATHERMAP" = "true" ] && [ -n "$LIBRENMS_WEATHERMAP_SCHEDULE" ]; then
|
||||
echo "Creating LibreNMS Weathermap cron task with the following period fields: $LIBRENMS_WEATHERMAP_SCHEDULE"
|
||||
echo "${LIBRENMS_WEATHERMAP_SCHEDULE} php -f /opt/librenms/html/plugins/Weathermap/map-poller.php" >>${CRONTAB_PATH}/librenms
|
||||
fi
|
||||
|
||||
echo "Creating LibreNMS cron artisan schedule:run"
|
||||
echo "* * * * * php /opt/librenms/artisan schedule:run --no-ansi --no-interaction > /dev/null 2>&1" >>${CRONTAB_PATH}/librenms
|
||||
|
||||
# Fix perms
|
||||
echo "Fixing crontabs permissions..."
|
||||
chmod -R 0644 ${CRONTAB_PATH}
|
||||
|
||||
# Create service
|
||||
mkdir -p /etc/services.d/cron
|
||||
cat >/etc/services.d/cron/run <<EOL
|
||||
#!/usr/bin/execlineb -P
|
||||
with-contenv
|
||||
exec busybox crond -f -L /dev/stdout
|
||||
EOL
|
||||
chmod +x /etc/services.d/cron/run
|
||||
47
rootfs/etc/cont-init.d/08-svc-snmptrapd.sh
Normal file
47
rootfs/etc/cont-init.d/08-svc-snmptrapd.sh
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
#!/usr/bin/with-contenv sh
|
||||
# shellcheck shell=sh
|
||||
set -e
|
||||
|
||||
SIDECAR_SNMPTRAPD=${SIDECAR_SNMPTRAPD:-0}
|
||||
LIBRENMS_SNMP_COMMUNITY=${LIBRENMS_SNMP_COMMUNITY:-librenmsdocker}
|
||||
SNMP_PROCESSING_TYPE=${SNMP_PROCESSING_TYPE:-log,execute,net}
|
||||
SNMP_USER=${SNMP_USER:-librenms_user}
|
||||
SNMP_AUTH=${SNMP_AUTH:-auth_pass}
|
||||
SNMP_PRIV=${SNMP_PRIV:-priv_pass}
|
||||
SNMP_AUTH_PROTO=${SNMP_AUTH_PROTO:-SHA}
|
||||
SNMP_PRIV_PROTO=${SNMP_PRIV_PROTO:-AES}
|
||||
SNMP_SECURITY_LEVEL=${SNMP_SECURITY_LEVEL:-priv}
|
||||
SNMP_ENGINEID=${SNMP_ENGINEID:-1234567890}
|
||||
SNMP_DISABLE_AUTHORIZATION=${SNMP_DISABLE_AUTHORIZATION:-yes}
|
||||
|
||||
# Continue only if sidecar snmptrapd container
|
||||
if [ "$SIDECAR_SNMPTRAPD" != "1" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo ">>"
|
||||
echo ">> Sidecar snmptrapd container detected"
|
||||
echo ">>"
|
||||
|
||||
mkdir -p /run/snmptrapd
|
||||
chown -R librenms:librenms /run/snmptrapd
|
||||
|
||||
sed -ie "s/@LIBRENMS_SNMP_COMMUNITY@/${LIBRENMS_SNMP_COMMUNITY}/" /etc/snmp/snmptrapd.conf
|
||||
sed -ie "s/@SNMP_PROCESSING_TYPE@/${SNMP_PROCESSING_TYPE}/" /etc/snmp/snmptrapd.conf
|
||||
sed -ie "s/@SNMP_USER@/${SNMP_USER}/" /etc/snmp/snmptrapd.conf
|
||||
sed -ie "s/@SNMP_AUTH@/${SNMP_AUTH}/" /etc/snmp/snmptrapd.conf
|
||||
sed -ie "s/@SNMP_PRIV@/${SNMP_PRIV}/" /etc/snmp/snmptrapd.conf
|
||||
sed -ie "s/@SNMP_AUTH_PROTO@/${SNMP_AUTH_PROTO}/" /etc/snmp/snmptrapd.conf
|
||||
sed -ie "s/@SNMP_PRIV_PROTO@/${SNMP_PRIV_PROTO}/" /etc/snmp/snmptrapd.conf
|
||||
sed -ie "s/@SNMP_SECURITY_LEVEL@/${SNMP_SECURITY_LEVEL}/" /etc/snmp/snmptrapd.conf
|
||||
sed -ie "s/@SNMP_ENGINEID@/${SNMP_ENGINEID}/" /etc/snmp/snmptrapd.conf
|
||||
sed -ie "s/@SNMP_DISABLE_AUTHORIZATION@/${SNMP_DISABLE_AUTHORIZATION}/" /etc/snmp/snmptrapd.conf
|
||||
|
||||
# Create service
|
||||
mkdir -p /etc/services.d/snmptrapd
|
||||
cat >/etc/services.d/snmptrapd/run <<EOL
|
||||
#!/usr/bin/execlineb -P
|
||||
with-contenv
|
||||
/usr/sbin/snmptrapd -f -m ALL -M /opt/librenms/mibs:/opt/librenms/mibs/cisco:${SNMP_EXTRA_MIB_DIRS} udp:162 tcp:162
|
||||
EOL
|
||||
chmod +x /etc/services.d/snmptrapd/run
|
||||
2
rootfs/etc/my.cnf.d/skip-ssl.cnf
Normal file
2
rootfs/etc/my.cnf.d/skip-ssl.cnf
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
[client]
|
||||
skip-ssl = true
|
||||
5
rootfs/etc/snmp/snmptrapd.conf
Normal file
5
rootfs/etc/snmp/snmptrapd.conf
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
disableAuthorization @SNMP_DISABLE_AUTHORIZATION@
|
||||
createUser -e 0x@SNMP_ENGINEID@ @SNMP_USER@ @SNMP_AUTH_PROTO@ @SNMP_AUTH@ @SNMP_PRIV_PROTO@ @SNMP_PRIV@
|
||||
authUser @SNMP_PROCESSING_TYPE@ @SNMP_USER@ @SNMP_SECURITY_LEVEL@
|
||||
authCommunity @SNMP_PROCESSING_TYPE@ @LIBRENMS_SNMP_COMMUNITY@
|
||||
traphandle default /opt/librenms/snmptrap.php
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
@version:3.13
|
||||
@version:4.8
|
||||
|
||||
options {
|
||||
chain_hostnames(off);
|
||||
|
|
@ -18,7 +18,7 @@ source s_sys {
|
|||
};
|
||||
|
||||
source s_net {
|
||||
tcp(ip(0.0.0.0), port(514));
|
||||
tcp(ip(0.0.0.0), port(514), max-connections(300));
|
||||
udp(ip(0.0.0.0), port(514));
|
||||
unix-stream("/run/syslog-ng/syslog-ng.sock");
|
||||
};
|
||||
|
|
@ -1,8 +1,6 @@
|
|||
daemon off;
|
||||
user nginx;
|
||||
pid /run/nginx.pid;
|
||||
pid /var/run/nginx/nginx.pid;
|
||||
worker_processes auto;
|
||||
error_log /proc/1/fd/2 info;
|
||||
error_log /proc/self/fd/2 info;
|
||||
worker_rlimit_nofile 8192;
|
||||
|
||||
events {
|
||||
|
|
@ -14,10 +12,17 @@ events {
|
|||
http {
|
||||
include mime.types;
|
||||
default_type application/octet-stream;
|
||||
access_log /proc/1/fd/1;
|
||||
|
||||
aio threads;
|
||||
sendfile on;
|
||||
large_client_header_buffers 4 16k;
|
||||
|
||||
## Temp folders
|
||||
client_body_temp_path /tmp/nginx 1 2;
|
||||
proxy_temp_path /tmp/nginx-proxy;
|
||||
fastcgi_temp_path /tmp/nginx-fastcgi;
|
||||
uwsgi_temp_path /tmp/nginx-uwsgi;
|
||||
scgi_temp_path /tmp/nginx-scgi;
|
||||
|
||||
## Timeouts
|
||||
client_body_timeout 60;
|
||||
|
|
@ -30,8 +35,14 @@ http {
|
|||
tcp_nodelay on;
|
||||
|
||||
## Handling of IPs in proxied and load balancing situations
|
||||
set_real_ip_from 0.0.0.0/32;
|
||||
real_ip_header X-Forwarded-For;
|
||||
set_real_ip_from @REAL_IP_FROM@;
|
||||
real_ip_header @REAL_IP_HEADER@;
|
||||
|
||||
# Log
|
||||
log_format main '$@LOG_IP_VAR@ - $remote_user [$time_local] '
|
||||
'"$request" $status $body_bytes_sent '
|
||||
'"$http_referer" "$http_user_agent"';
|
||||
access_log /proc/self/fd/1 main;
|
||||
|
||||
## Hide the Nginx version number
|
||||
server_tokens off;
|
||||
|
|
@ -54,17 +65,9 @@ http {
|
|||
## Serve already compressed files directly, bypassing on-the-fly compression
|
||||
gzip_static on;
|
||||
|
||||
## FastCGI
|
||||
fastcgi_index index.php;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
include fastcgi_params;
|
||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||
fastcgi_buffers 256 4k;
|
||||
fastcgi_intercept_errors on;
|
||||
fastcgi_read_timeout 14400;
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
listen 8000;
|
||||
listen [::]:8000;
|
||||
|
||||
root /opt/librenms/html;
|
||||
index index.php;
|
||||
|
|
@ -78,7 +81,19 @@ http {
|
|||
}
|
||||
|
||||
location ~ \.php$ {
|
||||
fastcgi_pass unix:/var/run/php-fpm7.sock;
|
||||
fastcgi_split_path_info ^(.+\.php)(/.*)$;
|
||||
set $path_info $fastcgi_path_info;
|
||||
try_files $fastcgi_script_name =404;
|
||||
include fastcgi_params;
|
||||
fastcgi_param SERVER_SOFTWARE "";
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
fastcgi_param PATH_INFO $path_info;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
|
||||
fastcgi_buffers 256 4k;
|
||||
fastcgi_buffer_size 32k;
|
||||
fastcgi_intercept_errors on;
|
||||
fastcgi_read_timeout 14400;
|
||||
}
|
||||
|
||||
location ~ /\.ht {
|
||||
23
rootfs/tpls/etc/php83/php-fpm.d/www.conf
Normal file
23
rootfs/tpls/etc/php83/php-fpm.d/www.conf
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
[global]
|
||||
pid = /var/run/php-fpm/php-fpm.pid
|
||||
daemonize = no
|
||||
error_log = /proc/self/fd/2
|
||||
|
||||
[www]
|
||||
listen = /var/run/php-fpm/php-fpm.sock
|
||||
access.log = /dev/null
|
||||
|
||||
pm = dynamic
|
||||
pm.max_children = @FPM_PM_MAX_CHILDREN@
|
||||
pm.start_servers = @FPM_PM_START_SERVERS@
|
||||
pm.min_spare_servers = @FPM_PM_MIN_SPARE_SERVERS@
|
||||
pm.max_spare_servers = @FPM_PM_MAX_SPARE_SERVERS@
|
||||
request_terminate_timeout = 0
|
||||
clear_env = @CLEAR_ENV@
|
||||
|
||||
php_admin_value[post_max_size] = @UPLOAD_MAX_SIZE@
|
||||
php_admin_value[upload_max_filesize] = @UPLOAD_MAX_SIZE@
|
||||
php_admin_value[max_execution_time] = 10800
|
||||
php_admin_value[max_input_time] = 3600
|
||||
php_admin_value[expose_php] = Off
|
||||
php_admin_value[memory_limit] = @MEMORY_LIMIT@
|
||||
7
rootfs/usr/bin/lnms
Executable file
7
rootfs/usr/bin/lnms
Executable file
|
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
if [ "$(id -u -n)" = "librenms" -a "$(id -g -n)" = "librenms" ]; then
|
||||
php -f /opt/librenms/lnms "$@"
|
||||
else
|
||||
yasu librenms:librenms php -f /opt/librenms/lnms "$@"
|
||||
fi
|
||||
4
rootfs/usr/local/bin/artisan
Executable file
4
rootfs/usr/local/bin/artisan
Executable file
|
|
@ -0,0 +1,4 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
cd /opt/librenms || exit 1
|
||||
yasu librenms:librenms php artisan "$@"
|
||||
7
test/.env
Normal file
7
test/.env
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
TZ=Europe/Paris
|
||||
PUID=1000
|
||||
PGID=1000
|
||||
|
||||
MYSQL_DATABASE=librenms
|
||||
MYSQL_USER=librenms
|
||||
MYSQL_PASSWORD=asupersecretpassword
|
||||
154
test/compose.yml
Normal file
154
test/compose.yml
Normal file
|
|
@ -0,0 +1,154 @@
|
|||
name: librenms
|
||||
|
||||
services:
|
||||
db:
|
||||
image: mariadb:10
|
||||
container_name: librenms_db
|
||||
command:
|
||||
- "mysqld"
|
||||
- "--innodb-file-per-table=1"
|
||||
- "--lower-case-table-names=0"
|
||||
- "--character-set-server=utf8mb4"
|
||||
- "--collation-server=utf8mb4_unicode_ci"
|
||||
volumes:
|
||||
- "librenms-db:/var/lib/mysql"
|
||||
environment:
|
||||
- "TZ=${TZ}"
|
||||
- "MARIADB_RANDOM_ROOT_PASSWORD=yes"
|
||||
- "MYSQL_DATABASE=${MYSQL_DATABASE}"
|
||||
- "MYSQL_USER=${MYSQL_USER}"
|
||||
- "MYSQL_PASSWORD=${MYSQL_PASSWORD}"
|
||||
restart: always
|
||||
|
||||
redis:
|
||||
image: redis:7.2-alpine
|
||||
container_name: librenms_redis
|
||||
environment:
|
||||
- "TZ=${TZ}"
|
||||
restart: always
|
||||
|
||||
librenms:
|
||||
image: ${LIBRENMS_IMAGE:-librenms/librenms:latest}
|
||||
container_name: ${LIBRENMS_CONTAINER:-librenms}
|
||||
hostname: librenms
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
- NET_RAW
|
||||
ports:
|
||||
- target: 8000
|
||||
published: 8000
|
||||
protocol: tcp
|
||||
depends_on:
|
||||
- db
|
||||
- redis
|
||||
volumes:
|
||||
- "librenms-data:/data"
|
||||
env_file:
|
||||
- "./librenms.env"
|
||||
environment:
|
||||
- "TZ=${TZ}"
|
||||
- "PUID=${PUID}"
|
||||
- "PGID=${PGID}"
|
||||
- "DB_HOST=db"
|
||||
- "DB_NAME=${MYSQL_DATABASE}"
|
||||
- "DB_USER=${MYSQL_USER}"
|
||||
- "DB_PASSWORD=${MYSQL_PASSWORD}"
|
||||
- "DB_TIMEOUT=60"
|
||||
restart: always
|
||||
|
||||
dispatcher:
|
||||
image: ${LIBRENMS_IMAGE:-librenms/librenms:latest}
|
||||
container_name: librenms_dispatcher
|
||||
hostname: librenms-dispatcher
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
- NET_RAW
|
||||
depends_on:
|
||||
- librenms
|
||||
- redis
|
||||
volumes:
|
||||
- "librenms-data:/data"
|
||||
env_file:
|
||||
- "./librenms.env"
|
||||
environment:
|
||||
- "TZ=${TZ}"
|
||||
- "PUID=${PUID}"
|
||||
- "PGID=${PGID}"
|
||||
- "DB_HOST=db"
|
||||
- "DB_NAME=${MYSQL_DATABASE}"
|
||||
- "DB_USER=${MYSQL_USER}"
|
||||
- "DB_PASSWORD=${MYSQL_PASSWORD}"
|
||||
- "DB_TIMEOUT=60"
|
||||
- "DISPATCHER_NODE_ID=dispatcher1"
|
||||
- "SIDECAR_DISPATCHER=1"
|
||||
restart: always
|
||||
|
||||
syslogng:
|
||||
image: ${LIBRENMS_IMAGE:-librenms/librenms:latest}
|
||||
container_name: librenms_syslogng
|
||||
hostname: librenms-syslogng
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
- NET_RAW
|
||||
depends_on:
|
||||
- librenms
|
||||
- redis
|
||||
ports:
|
||||
- target: 514
|
||||
published: 514
|
||||
protocol: tcp
|
||||
- target: 514
|
||||
published: 514
|
||||
protocol: udp
|
||||
volumes:
|
||||
- "librenms-data:/data"
|
||||
env_file:
|
||||
- "./librenms.env"
|
||||
environment:
|
||||
- "TZ=${TZ}"
|
||||
- "PUID=${PUID}"
|
||||
- "PGID=${PGID}"
|
||||
- "DB_HOST=db"
|
||||
- "DB_NAME=${MYSQL_DATABASE}"
|
||||
- "DB_USER=${MYSQL_USER}"
|
||||
- "DB_PASSWORD=${MYSQL_PASSWORD}"
|
||||
- "DB_TIMEOUT=60"
|
||||
- "SIDECAR_SYSLOGNG=1"
|
||||
restart: always
|
||||
|
||||
snmptrapd:
|
||||
image: ${LIBRENMS_IMAGE:-librenms/librenms:latest}
|
||||
container_name: librenms_snmptrapd
|
||||
hostname: librenms-snmptrapd
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
- NET_RAW
|
||||
depends_on:
|
||||
- librenms
|
||||
- redis
|
||||
ports:
|
||||
- target: 162
|
||||
published: 162
|
||||
protocol: tcp
|
||||
- target: 162
|
||||
published: 162
|
||||
protocol: udp
|
||||
volumes:
|
||||
- "librenms-data:/data"
|
||||
env_file:
|
||||
- "./librenms.env"
|
||||
environment:
|
||||
- "TZ=${TZ}"
|
||||
- "PUID=${PUID}"
|
||||
- "PGID=${PGID}"
|
||||
- "DB_HOST=db"
|
||||
- "DB_NAME=${MYSQL_DATABASE}"
|
||||
- "DB_USER=${MYSQL_USER}"
|
||||
- "DB_PASSWORD=${MYSQL_PASSWORD}"
|
||||
- "DB_TIMEOUT=60"
|
||||
- "SIDECAR_SNMPTRAPD=1"
|
||||
restart: always
|
||||
|
||||
volumes:
|
||||
librenms-db:
|
||||
librenms-data:
|
||||
16
test/librenms.env
Normal file
16
test/librenms.env
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
MEMORY_LIMIT=256M
|
||||
MAX_INPUT_VARS=1000
|
||||
UPLOAD_MAX_SIZE=16M
|
||||
OPCACHE_MEM_SIZE=128
|
||||
REAL_IP_FROM=0.0.0.0/32
|
||||
REAL_IP_HEADER=X-Forwarded-For
|
||||
LOG_IP_VAR=remote_addr
|
||||
|
||||
CACHE_DRIVER=redis
|
||||
SESSION_DRIVER=redis
|
||||
REDIS_HOST=redis
|
||||
|
||||
LIBRENMS_SNMP_COMMUNITY=librenmsdocker
|
||||
|
||||
LIBRENMS_WEATHERMAP=false
|
||||
LIBRENMS_WEATHERMAP_SCHEDULE=*/5 * * * *
|
||||
Loading…
Add table
Add a link
Reference in a new issue