New step to install nagios plugin (services)

Colored output for text only steps
This commit is contained in:
2021-02-19 14:48:05 +01:00
parent 3001515720
commit 12a2d52b05

View File

@@ -27,8 +27,8 @@ step_config() {
initSeqConfig "$CONFIG_FILE_NAME" "$CONFIG_FILE_TEMPLATE"
if [ $? -eq 0 ] ; then
CONFIG=1
echo " Install: $LNMS_DIR"
echo " Backup: $LNMS_BU_DIR"
echoseq " Install: $LNMS_DIR"
echoseq " Backup: $LNMS_BU_DIR"
else
[ $DRY -eq 0 ] && exit 1
fi
@@ -94,6 +94,7 @@ step_10() {
step_11_info() { echo "MariaDB configuration"; }
step_11() {
outColor green
cat << SQLCONF_END
Edit or create /etc/mysql/mariadb.conf.d/90-myconfig.cnf and add:
@@ -111,6 +112,7 @@ SQLCONF_END
step_12_info() { echo "PHP fpm/cli timezone configuration"; }
step_12() {
outColor green
cat << PHPCONF_END
Ensure date.timezone is set in php.ini to your preferred time zone. See http://php.net/manual/en/timezones.php for a list of supported timezones. Valid examples are: "America/New_York", "Europe/Berlin", "Etc/UTC".
@@ -129,6 +131,7 @@ PHPCONF_END
step_13_info() { echo "PHP fpm configuration"; }
step_13() {
outColor green
cat << FPMCONF_END
cp /etc/php/7.3/fpm/pool.d/www.conf /etc/php/7.3/fpm/pool.d/librenms.conf
@@ -151,6 +154,7 @@ FPMCONF_END
step_14_info() { echo "Nginx configuration"; }
step_14() {
outColor green
cat << NGINXCONF_END
server {
@@ -201,6 +205,19 @@ step_24() {
exe cp "${LNMS_DIR}/misc/librenms.logrotate" "$lnmsLogrotLoc" && echoseq "Ok" || echoseq "Nok"
}
lnmsLogrotLoc="/etc/logrotate.d/librenms"
step_26_info() { echo "Install nagios plugin to enable services"; }
step_26_alias() { ALIAS="services"; }
step_26() {
exe apt install monitoring-plugins
echoseq
echoseq " [$LNMS_DIR/config.php]"
echoseq "\$config['show_services'] = 1;"
echoseq
echoseq " [/etc/cron.d/librenms]"
echoseq " */5 * * * * librenms /opt/librenms/services-wrapper.py 1"
}
step_30_info() { echo "Backup ${toolName} web direcotry"; }
step_30_alias() { ALIAS="backup"; }
step_30() {