mirror of
https://github.com/librenms/docker.git
synced 2026-07-19 01:27:56 +00:00
Replace Nagios with Monitoring Plugins
This commit is contained in:
parent
645f76d350
commit
40db93e32f
4 changed files with 21 additions and 22 deletions
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
## 1.43-RC5 (2018/09/29)
|
||||
|
||||
* Ability to add custom Nagios plugins through `/data/nagios-plugins`
|
||||
* Install official nagios-plugins package
|
||||
* Ability to add custom Monitoring plugins through `/data/monitoring-plugins`
|
||||
* Install [Monitoring Plugins](https://www.monitoring-plugins.org/) package
|
||||
* Services enabled by default
|
||||
|
||||
## 1.43-RC4 (2018/09/26)
|
||||
|
|
|
|||
|
|
@ -26,10 +26,9 @@ RUN apk --update --no-cache add \
|
|||
git \
|
||||
graphviz \
|
||||
imagemagick \
|
||||
monitoring-plugins \
|
||||
mtr \
|
||||
mysql-client \
|
||||
nagios-plugins \
|
||||
nagios-plugins-all \
|
||||
net-snmp \
|
||||
net-snmp-tools \
|
||||
nginx \
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ If you are interested, [check out](https://hub.docker.com/r/crazymax/) my other
|
|||
* Cron tasks as a ["sidecar" container](#cron)
|
||||
* Syslog-ng support through a ["sidecar" container](#syslog-ng)
|
||||
* Ability to configure [distributed polling](https://docs.librenms.org/#Extensions/Distributed-Poller/#distributed-poller)
|
||||
* Ability to add custom Nagios plugins
|
||||
* Ability to add custom Monitoring plugins (Nagios)
|
||||
* OPCache enabled to store precompiled script bytecode in shared memory
|
||||
|
||||
### From docker-compose
|
||||
|
|
@ -87,7 +87,7 @@ If you are interested, [check out](https://hub.docker.com/r/crazymax/) my other
|
|||
|
||||
### Volumes
|
||||
|
||||
* `/data` : Contains configuration, rrd database, logs, additional Nagios plugins, additional syslog-ng config files
|
||||
* `/data` : Contains configuration, rrd database, logs, additional Monitoring plugins, additional syslog-ng config files
|
||||
|
||||
### Ports
|
||||
|
||||
|
|
@ -220,9 +220,9 @@ You have to create a configuration file to enable syslog in LibreNMS too. Create
|
|||
$config['enable_syslog'] = 1;
|
||||
```
|
||||
|
||||
## Additional Nagios plugins
|
||||
## Additional Monitoring plugins (Nagios)
|
||||
|
||||
You can add a custom Nagios plugin in `/data/nagios-plugins/`.
|
||||
You can add a custom Monitoring (Nagios) plugin in `/data/monitoring-plugins/`.
|
||||
|
||||
> ⚠️ Container has to be restarted to propagate changes
|
||||
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ sed -i -e "s/RANDOMSTRINGGOESHERE/${LIBRENMS_SNMP_COMMUNITY}/" /etc/snmp/snmpd.c
|
|||
echo "Initializing LibreNMS files / folders..."
|
||||
mkdir -p ${DATA_PATH}/config \
|
||||
${DATA_PATH}/logs \
|
||||
${DATA_PATH}/nagios-plugins \
|
||||
${DATA_PATH}/monitoring-plugins \
|
||||
${DATA_PATH}/rrd
|
||||
rm -f ${LIBRENMS_PATH}/config.d/*
|
||||
|
||||
|
|
@ -163,7 +163,7 @@ EOL
|
|||
cat > ${LIBRENMS_PATH}/config.d/services.php <<EOL
|
||||
<?php
|
||||
\$config['show_services'] = 1;
|
||||
\$config['nagios_plugins'] = "/usr/lib/nagios/plugins";
|
||||
\$config['nagios_plugins'] = "/usr/lib/monitoring-plugins";
|
||||
EOL
|
||||
|
||||
# Config : Memcached
|
||||
|
|
@ -209,24 +209,24 @@ chmod ug+rw ${DATA_PATH}/logs \
|
|||
${LIBRENMS_PATH}/storage \
|
||||
${LIBRENMS_PATH}/storage/framework/*
|
||||
|
||||
# Check additional Nagios plugins
|
||||
echo "Checking additional Nagios plugins..."
|
||||
nagios_plugins=$(ls -l ${DATA_PATH}/nagios-plugins | egrep '^-' | awk '{print $9}')
|
||||
for nagios_plugin in ${nagios_plugins}; do
|
||||
if [ -f "/usr/lib/nagios/plugins/${nagios_plugin}" ]; then
|
||||
echo " WARNING: Official Nagios plugin ${nagios_plugin} cannot be overriden. Skipping..."
|
||||
# Check additional Monitoring plugins
|
||||
echo "Checking additional Monitoring plugins..."
|
||||
mon_plugins=$(ls -l ${DATA_PATH}/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 [[ ${nagios_plugin} != check_* ]]; then
|
||||
echo " WARNING: Nagios plugin filename ${nagios_plugin} invalid. It must start with 'check_'. Skipping..."
|
||||
if [[ ${mon_plugin} != check_* ]]; then
|
||||
echo " WARNING: Monitoring plugin filename ${mon_plugin} invalid. It must start with 'check_'. Skipping..."
|
||||
continue
|
||||
fi
|
||||
if [[ ! -x "${DATA_PATH}/nagios-plugins/${nagios_plugin}" ]]; then
|
||||
echo " WARNING: Nagios plugin file ${nagios_plugin} has to be executable. Skipping..."
|
||||
if [[ ! -x "${DATA_PATH}/monitoring-plugins/${mon_plugin}" ]]; then
|
||||
echo " WARNING: Monitoring plugin file ${mon_plugin} has to be executable. Skipping..."
|
||||
continue
|
||||
fi
|
||||
echo " Adding ${nagios_plugin} Nagios plugin"
|
||||
ln -sf ${DATA_PATH}/nagios-plugins/${nagios_plugin} /usr/lib/nagios/plugins/${nagios_plugin}
|
||||
echo " Adding ${mon_plugin} Monitoring plugin"
|
||||
ln -sf ${DATA_PATH}/monitoring-plugins/${mon_plugin} /usr/lib/monitoring-plugins/${mon_plugin}
|
||||
done
|
||||
|
||||
# Sidecar cron container ?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue