diff --git a/.config.sh.template b/.config.sh.template index 4584322..a2236c5 100644 --- a/.config.sh.template +++ b/.config.sh.template @@ -18,6 +18,12 @@ emailcontact=nominatim@localhost username=nominatim password= +# Enable Munin graphs. To turn off this feature leave as blank. +# setupMuninGraphs=yes enables the feature +setupMuninGraphs=yes +# Munin plugins path wthout trailing /! +muninPluginsPath=/etc/munin/plugins + # Apache virtual host configuration file name - with .conf extension nominatimVHfile=400-nominatim.conf diff --git a/README.md b/README.md index bfaec7a..a8193ed 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ Running the installation script `run.sh` (as *root*) will: * download the planet extract as defined by the `.config.sh` file * build the Nominatim index * create a virtual host + * setup Munin plugins (Note: server needs to be Munin node) The *root* user is required to install the packages, but most of the installation is done as the *nominatim* user (using *sudo*). @@ -42,6 +43,7 @@ cp .config.sh.template .config.sh # Edit .config.sh # At least set a password for the nominatim user +# Disable ```setupMuninGraphs``` if you don't have a Munin node running # Rest of file defaults to processing Andorra - which should take about half an hour # Run the installation diff --git a/run.sh b/run.sh index 3eee05c..ed16d1d 100755 --- a/run.sh +++ b/run.sh @@ -191,19 +191,6 @@ fi echo "# $(date) Restarting PostgreSQL" service postgresql restart -# Nominatim munin -# !! Look at the comments at the top of the nominatim_importlag file in the following and copy the setup section to a new file in: /etc/munin/plugin-conf.d/ -ln -s '/home/nominatim/Nominatim/munin/nominatim_importlag' '/etc/munin/plugins/nominatim_importlag' -ln -s '/home/nominatim/Nominatim/munin/nominatim_query_speed' '/etc/munin/plugins/nominatim_query_speed' -ln -s '/home/nominatim/Nominatim/munin/nominatim_nominatim_requests' '/etc/munin/plugins/nominatim_nominatim_requests' - - -# Needed to help postgres munin charts work -apt-get -y install libdbd-pg-perl -munin-node-configure --shell | grep postgres | sh -service munin-reload restart - - # We will use the Nominatim user's homedir for the installation, so switch to that cd /home/${username} @@ -233,6 +220,31 @@ sudo -u ${username} ./autogen.sh sudo -u ${username} ./configure sudo -u ${username} make +# Nominatim munin +if [ ! -z "$setupMuninGraphs" ]; then + if [ -z "$muninPluginsPath" ]; then + echo "# Missing muninPluginsPath configuration" 1>&2 + exit 1 + fi + + if [ ! -d "${muninPluginsPath}" ]; then + echo "# Munin plugins directory does not exist: : ${muninPluginsPath}" 1>&2 + exit 1 + fi + + echo "# Setup Munin as requested" 1>&2 + + # !! Look at the comments at the top of the nominatim_importlag file in the following and copy the setup section to a new file in: /etc/munin/plugin-conf.d/ + ln -s "/home/${username}/Nominatim/munin/nominatim_importlag" "${muninPluginsPath}/nominatim_importlag" + ln -s "/home/${username}/Nominatim/munin/nominatim_query_speed" "${muninPluginsPath}/nominatim_query_speed" + ln -s "/home/${username}/Nominatim/munin/nominatim_nominatim_requests" "${muninPluginsPath}/nominatim_nominatim_requests" + + # Needed to help postgres munin charts work + apt-get -y install libdbd-pg-perl + munin-node-configure --shell | grep postgres | sh + service munin-reload restart +fi + # Customization of the Installation # http://wiki.openstreetmap.org/wiki/Nominatim/Installation#Customization_of_the_Installation