Finalise initial collectd implementation
Some checks are pending
continuous-integration/laminar-eldarion Build failed with exit code 123 after 4 seconds
Some checks are pending
continuous-integration/laminar-eldarion Build failed with exit code 123 after 4 seconds
...it's still all untested.
This commit is contained in:
parent
5f412703e5
commit
741d6c2c03
4 changed files with 11 additions and 86 deletions
|
@ -1,59 +0,0 @@
|
||||||
Interval 300
|
|
||||||
|
|
||||||
LoadPlugin load
|
|
||||||
LoadPlugin thermal
|
|
||||||
LoadPlugin memory
|
|
||||||
LoadPlugin disk
|
|
||||||
LoadPlugin swap
|
|
||||||
LoadPlugin uptime
|
|
||||||
#LoadPlugin smart
|
|
||||||
|
|
||||||
LoadPlugin df
|
|
||||||
LoadPlugin irq
|
|
||||||
LoadPlugin contextswitch
|
|
||||||
LoadPlugin interface
|
|
||||||
LoadPlugin ping
|
|
||||||
#LoadPlugin nginx
|
|
||||||
#LoadPlugin ntpd
|
|
||||||
|
|
||||||
LoadPlugin exec
|
|
||||||
|
|
||||||
LoadPlugin processes
|
|
||||||
|
|
||||||
LoadPlugin network
|
|
||||||
|
|
||||||
<Plugin df>
|
|
||||||
MountPoint "/"
|
|
||||||
MountPoint "/boot"
|
|
||||||
</Plugin>
|
|
||||||
|
|
||||||
<Plugin interface>
|
|
||||||
Interface "eth0"
|
|
||||||
IgnoreSelected false
|
|
||||||
</Plugin>
|
|
||||||
|
|
||||||
<Plugin ping>
|
|
||||||
Host "elessar.mooncarrot.space"
|
|
||||||
Host "wopplefox.mooncarrot.space"
|
|
||||||
Host "ubuntu.mirrors.ovh.net"
|
|
||||||
#Host "s3-eu-west-1.amazonaws.com"
|
|
||||||
#Host "github.com"
|
|
||||||
#Host "api.backblazeb2.com"
|
|
||||||
</Plugin>
|
|
||||||
|
|
||||||
#<Plugin ntpd>
|
|
||||||
# Host "localhost"
|
|
||||||
# Port "123"
|
|
||||||
#</Plugin>
|
|
||||||
|
|
||||||
<Plugin processes>
|
|
||||||
CollectMemoryMaps false
|
|
||||||
</Plugin>
|
|
||||||
|
|
||||||
<Plugin "network">
|
|
||||||
<Server "5.198.44.45">
|
|
||||||
SecurityLevel "Encrypt"
|
|
||||||
Username "cluster"
|
|
||||||
Password "{{{PASSWORD}}}"
|
|
||||||
</Server>
|
|
||||||
</Plugin>
|
|
|
@ -1,25 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
if [[ -z "${COLLECTD_PW}" ]]; then
|
|
||||||
echo "Error: COLLECTD_PW environment variable is not set";
|
|
||||||
exit 1;
|
|
||||||
fi
|
|
||||||
|
|
||||||
RUN "sudo apt-get install -y collectd liboping0";
|
|
||||||
|
|
||||||
tmpfile_collectd="$(mktemp --tmpdir "collectd-XXXXXXX")";
|
|
||||||
|
|
||||||
chmod 0600 "${tmpfile_collectd}";
|
|
||||||
sed -e "s/{{{PASSWORD}}}/${COLLECTD_PW}/g" <"${JOBFILE_DIR}/collectd.conf" >"${tmpfile_collectd}";
|
|
||||||
unset COLLECTD_PW;
|
|
||||||
|
|
||||||
COPY "${tmpfile_collectd}" "/tmp/collectd.conf";
|
|
||||||
|
|
||||||
rm "${tmpfile_collectd}";
|
|
||||||
|
|
||||||
RUN "sudo chown root:root /tmp/collectd.conf";
|
|
||||||
RUN "sudo chmod 0600 /tmp/collectd.conf";
|
|
||||||
RUN "sudo mv /tmp/collectd.conf /etc/collectd/collectd.conf";
|
|
||||||
|
|
||||||
RUN "sudo systemctl restart collectd.service";
|
|
||||||
RUN "sudo systemctl enable collectd.service";
|
|
|
@ -10,6 +10,7 @@ iotop
|
||||||
jpegoptim
|
jpegoptim
|
||||||
jq
|
jq
|
||||||
less
|
less
|
||||||
|
liboping0
|
||||||
lnav
|
lnav
|
||||||
lsof
|
lsof
|
||||||
netcat
|
netcat
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
collectd_conf_target="/etc/collectd/collectd.conf";
|
||||||
|
|
||||||
task_begin "Configurating collectd";
|
task_begin "Configurating collectd";
|
||||||
|
|
||||||
subtask_begin "Stopping collectd";
|
subtask_begin "Stopping collectd";
|
||||||
|
@ -8,15 +10,21 @@ subtask_end "$?";
|
||||||
|
|
||||||
if [[ -r "/etc/collectd/collectd.conf" ]]; then
|
if [[ -r "/etc/collectd/collectd.conf" ]]; then
|
||||||
subtask_begin "Moving existing config file aside";
|
subtask_begin "Moving existing config file aside";
|
||||||
mv "/etc/collectd/collectd.conf" "/etc/collectd/collectd.conf.bak-$(date +%Y-%m-%d)";
|
mv "${collectd_conf_target}" "${collectd_conf_target}.bak-$(date +%Y-%m-%d)";
|
||||||
subtask_end "$?";
|
subtask_end "$?";
|
||||||
fi
|
fi
|
||||||
|
|
||||||
subtask_begin "Installing configuration file";
|
subtask_begin "Installing configuration file";
|
||||||
|
touch "${collectd_conf_target}";
|
||||||
|
chmod 0600 "${collectd_conf_target}";
|
||||||
#shellcheck disable=SC2154
|
#shellcheck disable=SC2154
|
||||||
cat configs/collectd.conf | awk -v "user=${collectd_username}" -v "pass=${collectd_password}" '{ gsub("|||USERNAME|||", user); gsub("|||PASSWORD|||", pass); print }' >/etc/collectd/collectd.conf;
|
cat configs/collectd.conf | awk -v "user=${collectd_username}" -v "pass=${collectd_password}" '{ gsub("|||USERNAME|||", user); gsub("|||PASSWORD|||", pass); print }' >"${collectd_conf_target}";
|
||||||
subtask-end "$?";
|
subtask-end "$?";
|
||||||
|
|
||||||
subtask_begin "Starting collectd & enabling on boot";
|
subtask_begin "Starting collectd & enabling on boot";
|
||||||
systemctl enable --now collectd;
|
systemctl enable --now collectd;
|
||||||
subtask_end "$?";
|
subtask_end "$?";
|
||||||
|
|
||||||
|
subtask_begin "Cleaning up";
|
||||||
|
unset collectd_username collectd_password;
|
||||||
|
subtask_end "$?";
|
||||||
|
|
Loading…
Reference in a new issue