Module: nagvis
Branch: master
Commit: d6f0e9daf5c3e6516b4b97ea1b99131b7e3f9e8b
URL:    
http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=d6f0e9daf5c3e6516b4b97ea1b99131b7e3f9e8b

Author: LaMi <[email protected]>
Date:   Mon Nov  9 17:35:13 2009 +0100

Fixed problem copying the webserver configuration; Added new option to 
configure the NagVis web path

---

 etc/apache2-nagvis.conf-sample |    2 +-
 install.sh                     |   20 +++++++++++++++++---
 2 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/etc/apache2-nagvis.conf-sample b/etc/apache2-nagvis.conf-sample
index 82fd459..21bb77a 100644
--- a/etc/apache2-nagvis.conf-sample
+++ b/etc/apache2-nagvis.conf-sample
@@ -2,7 +2,7 @@
 #
 # #############################################################################
 
-Alias /nagvis "@NAGVIS_PATH@/share"
+Alias @NAGVIS_WEB@ "@NAGVIS_PATH@/share"
 
 <Directory "@NAGVIS_PATH@/share">
 #  SSLRequireSSL
diff --git a/install.sh b/install.sh
index 3a7b401..40d7592 100755
--- a/install.sh
+++ b/install.sh
@@ -65,11 +65,13 @@ NAGVIS_CONF="etc/nagvis.ini.php"
 # Relative path to the NagVis SQLite auth database
 NAGVIS_AUTH_DB="etc/auth.db"
 # Default nagios web conf
-HTML_SAMPLE="apache2-nagvis.conf-sample"
+HTML_SAMPLE="etc/apache2-nagvis.conf-sample"
 # Default nagios web conf
 HTML_CONF="nagvis.conf"
 # Saving current timestamp for backup when updating
 DATE=`date +%s`
+# Web path to the NagVis base directory
+HTML_PATH=""
 # Path to webserver conf
 WEB_PATH=""
 # Default webserver user
@@ -115,6 +117,7 @@ Parameters:
   -u <USER>     User who runs the webserver
   -g <GROUP>    Group who runs the webserver
   -w <PATH>     Path to the webserver config files
+  -W <PATH      Web path to the NagVis base directory (Default: $HTML_PATH) 
   -i <BACKENDs> comma separated list of backend interfaces to use: ndo2db, 
ido2db, ndo2fs, merlin
   -s <SOURCE>   Data source, defaults to Nagios, may be Icinga
   -o            omit demo files
@@ -605,7 +608,7 @@ HTML_BASE=$HTML_PATH
 
 # Process command line options
 if [ $# -gt 0 ]; then
-       while getopts "n:B:m:p:w:u:b:g:c:i:s:ohqvFr" options; do
+       while getopts "n:B:m:p:w:W:u:b:g:c:i:s:ohqvFr" options; do
                case $options in
                        n)
                                NAGIOS_PATH=$OPTARG
@@ -629,6 +632,9 @@ if [ $# -gt 0 ]; then
                        w)
                                WEB_PATH=$OPTARG
                        ;;
+                       W)
+                               HTML_PATH=$OPTARG
+                       ;;
                        u)
                                WEB_USER=$OPTARG
                        ;;
@@ -811,6 +817,14 @@ if [ $FORCE -eq 0 ]; then
        HTML_PATH=${HTML_PATH%/}
 
        if [ $INSTALLER_QUIET -ne 1 ]; then
+               echo -n "| Please enter the web path to NagVis [$HTML_PATH]: "
+               read AHTMLPATH
+               if [ ! -z $AHTMLPATH ]; then
+                       HTML_PATH=$AHTMLPATH
+               fi
+       fi
+
+       if [ $INSTALLER_QUIET -ne 1 ]; then
                echo -n "| Please enter the name of the web-server user 
[$WEB_USER]: "
                read AUSR
                if [ ! -z $AUSR ]; then
@@ -989,7 +1003,7 @@ if [ -f $NAGVIS_PATH/$HTML_SAMPLE ]; then
                CHG='s/^/#new /'
        fi
        DONE=`log "Creating web configuration file..." done`
-       cat $NAGVIS_PATH/$HTML_SAMPLE | $SED 
"s...@nagios_path@#$NAGIOS_PATH#g;s...@nagvis_path@#$NAGVIS_PATH#g;$CHG" > 
$WEB_PATH/$HTML_CONF
+       cat $NAGVIS_PATH/$HTML_SAMPLE | $SED 
"s...@nagios_path@#$NAGIOS_PATH#g;s...@nagvis_path@#$NAGVIS_PATH#g;s...@nagvis_web@#$HTML_PATH#g;$CHG"
 > $WEB_PATH/$HTML_CONF
        chk_rc "|  Error creating web configuration" "$DONE"
        DONE=`log "Setting permissions for web configuration file..." done`
        chown $WEB_USER:$WEB_GROUP $WEB_PATH/$HTML_CONF


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to