From: Sarah Hoffmann Date: Sun, 7 Jul 2013 14:36:01 +0000 (+0200) Subject: remove hard-coded DB name in munin plugins X-Git-Tag: v2.2.0~56 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/9ed49e50a6b622d884a10c0ede1ffae9025e48bb?ds=sidebyside remove hard-coded DB name in munin plugins Use PGDATABASE environment variable instead. --- diff --git a/munin/nominatim_importlag b/munin/nominatim_importlag index a118e0b6..9f401311 100755 --- a/munin/nominatim_importlag +++ b/munin/nominatim_importlag @@ -2,6 +2,9 @@ # # Plugin to monitor the age of the imported data in the rendering db # +# Can be configured through libpq environment variables, for example +# PGUSER, PGDATABASE, etc. See man page of psql for more information +# # Parameters: # # config (required) @@ -21,7 +24,7 @@ if [ "$1" = "config" ]; then fi -delay=`psql -d nominatim -c "copy (select extract(epoch from timezone('utc', now())-lastimportdate)::int from import_status) to stdout"` +delay=`psql -c "copy (select extract(epoch from timezone('utc', now())-lastimportdate)::int from import_status) to stdout"` echo "age.value $delay" diff --git a/munin/nominatim_requests b/munin/nominatim_requests index 4e149859..ac083fc2 100755 --- a/munin/nominatim_requests +++ b/munin/nominatim_requests @@ -2,6 +2,9 @@ # # Plugin to monitor the types of requsts made to the API # +# Can be configured through libpq environment variables, for example +# PGUSER, PGDATABASE, etc. See man page of psql for more information. +# # Parameters: # # config (required) @@ -32,10 +35,10 @@ fi query="select count(*)/5.0 from new_query_log where starttime > (now() - interval '5 min') and " -reverse=`psql -d nominatim -c "copy ($query type='reverse') to stdout"` -searchy=`psql -d nominatim -c "copy ($query type='search' and results>0) to stdout"` -searchn=`psql -d nominatim -c "copy ($query type='search' and results=0) to stdout"` -details=`psql -d nominatim -c "copy ($query type='details') to stdout"` +reverse=`psql -c "copy ($query type='reverse') to stdout"` +searchy=`psql -c "copy ($query type='search' and results>0) to stdout"` +searchn=`psql -c "copy ($query type='search' and results=0) to stdout"` +details=`psql -c "copy ($query type='details') to stdout"` echo "z1.value $reverse" echo "z2.value $searchy"