lpar2rrd-6.02/ 0000775 0001750 0001750 00000000000 13442733703 013027 5 ustar pahampl pahampl lpar2rrd-6.02/scripts/ 0000755 0001750 0001750 00000000000 13442731527 014516 5 ustar pahampl pahampl lpar2rrd-6.02/scripts/install.sh 0000755 0001750 0001750 00000053540 13442733703 016530 0 ustar pahampl pahampl #!/bin/sh
#
# LPAR2RRD install script
# usage: ./install.sh
#
LANG=C
export LANG
if [ ! "$1"x = "x" ]; then
if [ "$1" = "wrap" ]; then
# create a package, internall usage only
ver=`grep "version=" dist/etc/lpar2rrd.cfg|sed 's/version=//g'`
if [ "$ver"x = "x" ]; then
echo "Something is wroing, cannot find the version"
exit 1
fi
if [ -f lpar2rrd.tar.Z ]; then
echo "removing lpar2rrd.tar.Z"
rm lpar2rrd.tar.Z
fi
if [ -f lpar2rrd.tar ]; then
echo "removing lpar2rrd.tar"
rm lpar2rrd.tar
fi
tar cvf lpar2rrd.tar dist
compress lpar2rrd.tar
if [ -f lpar2rrd.tar.Z ]; then
echo "removing dist"
rm -r dist
fi
echo ""
echo "$ver has been created"
echo ""
exit
fi
fi
os_aix=` uname|grep AIX|wc -l`
# test if "ed" command does not exist, it might happen especially on some Linux distros
ed << END 2>/dev/null 1>&2
q
END
if [ $? -gt 0 ]; then
echo "ERROR: "ed" command does not seem to be installed or in $PATH"
echo "Linux under root account: yum install ed"
echo "Exiting ..."
exit 1
fi
echo "1+1"|bc 2>/dev/null 1>&2
if [ $? -gt 0 ]; then
echo "ERROR: "bc" command does not seem to be installed or in $PATH"
echo "Linux under root account: yum install bc"
echo "Exiting ..."
exit 1
fi
umask 0022
ID=`id -un`
if [ $os_aix -eq 0 ]; then
ECHO_OPT="-e"
else
ECHO_OPT=""
fi
echo "LPAR2RRD installation under user : \"$ID\""
echo " make sure it is realy the user which should own it"
echo ""
echo "Where LPAR2RRD will be installed [$HOME/lpar2rrd]:"
read HOMELPAR
echo ""
if [ "$HOMELPAR"x = "x" ]; then
HOMELPAR="$HOME/lpar2rrd"
fi
if [ -f $HOMELPAR/bin/lpar2rrd.pl -o -f $HOMELPAR/lpar2rrd.pl ]; then
echo "LPAR2RRD instance already exists there, use update.sh script for the update"
exit 0
fi
if [ "$HOMELPAR"x = "x" ]; then
HOMELPAR=$HOME/lpar2rrd
fi
if [ ! -d "$HOMELPAR" ]; then
echo "Creating $HOMELPAR"
echo ""
mkdir "$HOMELPAR"
if [ ! $? -eq 0 ]; then
echo "Error during creation of $HOMELPAR, exiting ..."
exit 0
fi
fi
touch test
if [ ! $? -eq 0 ]; then
p=`pwd`
echo "Actual user does not have rights to create files in actual directory: $p "
echo "Fix it and re-run installation"
exit 1
fi
rm -f test
if [ -f lpar2rrd.tar.Z ]; then
which uncompress >/dev/null 2>&1
if [ $? -eq 0 ]; then
uncompress -f lpar2rrd.tar.Z
else
which gunzip >/dev/null 2>&1
if [ $? -eq 0 ]; then
gunzip -f lpar2rrd.tar.Z
else
echo "Could not locate uncompress or gunzip commands. exiting"
exit
fi
fi
fi
chown $ID $HOMELPAR
if [ ! $? -eq 0 ]; then
echo "Problem with ownership of $HOMELPAR"
echo "Fix it and run it again : chown $ID $HOMELPAR"
exit 0
fi
echo "Extracting distribution"
tar xf lpar2rrd.tar
echo "Copy distribution to the target location"
mv dist/* $HOMELPAR/
if [ $os_aix -gt 0 ]; then
# Font cache refresh, it migh speed up significantly graphs creation on AIX
fc-cache -v 1>/dev/null 2>&1
# extract perl lib for https REST API support (LWP 6.06)
if [ -f perl_aix_ssl.tar.Z ]; then
uncompress -f perl_aix_ssl.tar.Z
fi
if [ -f perl_aix_ssl.tar ]; then
tar xf perl_aix_ssl.tar
cp -R lib $HOMELPAR/
else
echo "ERROR during: uncompress -f perl_aix_ssl.tar.Z : install it manually"
echo " uncompress -f perl_aix_ssl.tar.Z; cd $HOMELPAR/; tar xvf perl_aix_ssl.tar"
fi
fi
if [ -f version.txt ]; then
version=`cat version.txt|tail -1|sed 's/ .*//'`
fi
# put WEB files immediately after the upgrade to do not have to wait for the end of upgrade
echo "Copy GUI files : $HOMELPAR/www"
cp $HOMELPAR/html/*html $HOMELPAR/www
cp $HOMELPAR/html/*ico $HOMELPAR/www
cp $HOMELPAR/html/*png $HOMELPAR/www
cd $HOMELPAR/html
tar cf - jquery | (cd $HOMELPAR/www; tar xf - )
tar cf - css | (cd $HOMELPAR/www; tar xf - )
cd - >/dev/null
if [ ! -f "$HOMELPAR/tmp/menu.txt" -a -f "$HOMELPAR/html/menu_default.txt" ]; then
#place default menu.txt
cp $HOMELPAR/html/menu_default.txt $HOMELPAR/tmp/menu.txt
fi
echo "Setting up directory permissions"
chown -R $ID $HOMELPAR 2>&1 |grep -v "lost+found"
chmod 755 $HOMELPAR
chmod 666 $HOMELPAR/logs/error.log
chmod 755 $HOMELPAR/data
chmod 755 $HOMELPAR/lib
chmod 755 $HOMELPAR/www
chmod 755 $HOMELPAR/bin
chmod 755 $HOMELPAR/etc
chmod 755 $HOMELPAR/scripts
chmod 755 $HOMELPAR/logs
if [ ! -d $HOMELPAR/tmp ]; then
mkdir $HOMELPAR/tmp
fi
chmod 777 $HOMELPAR/tmp # due to "Refresh" feature which need to save temp files there
chmod -R 755 $HOMELPAR/html # must be due tue subdirs jquery, images ...
chmod -R 755 $HOMELPAR/lpar2rrd-cgi
chmod -R o+r $HOMELPAR/data
chmod -R o+x $HOMELPAR/data
chmod -R o+r $HOMELPAR/www
chmod -R o+x $HOMELPAR/www
chmod 755 $HOMELPAR/bin/*.pl
chmod 755 $HOMELPAR/bin/*.pm
chmod 755 $HOMELPAR/bin/*.sh
chmod 755 $HOMELPAR/*.sh
chmod 644 $HOMELPAR/etc/*.cfg
chmod 755 $HOMELPAR/scripts/*
chmod 644 $HOMELPAR/*.txt
if [ -h $HOMELPAR/error-cgi.log ]; then
rm $HOMELPAR/error-cgi.log
fi
if [ -h $HOMELPAR/realt-error.log ]; then
rm $HOMELPAR/realt-error.log
fi
if [ ! -h $HOMELPAR/logs/error-cgi.log ]; then
ln -s /var/tmp/lpar2rrd-realt-error.log $HOMELPAR/logs/error-cgi.log
fi
if [ -f $HOMELPAR/etc/rperf_user.txt_template ]; then
mv $HOMELPAR/etc/rperf_user.txt_template $HOMELPAR/etc/rperf_user.txt
fi
if [ ! -d "$HOMELPAR/etc/web_config" ]; then
mkdir "$HOMELPAR/etc/web_config"
fi
if [ "$VM_IMAGE"x = "x" ]; then
chmod 777 "$HOMELPAR/etc/web_config"
chmod 777 "$HOMELPAR/reports"
else
chmod 755 "$HOMELPAR/etc/web_config"
chmod 755 "$HOMELPAR/reports"
fi
if [ ! -f "$HOMELPAR/etc/web_config/htusers.cfg" ]; then
echo 'admin:$apr1$CSoXefyw$wGe9K7Ld5ClOEozE4zC.T1' > $HOMELPAR/etc/web_config/htusers.cfg
if [ "$VM_IMAGE"x = "x" ]; then
chmod 666 $HOMELPAR/etc/web_config/htusers.cfg
else
chmod 600 $HOMELPAR/etc/web_config/htusers.cfg
fi
fi
rrd=`which rrdtool | awk '{print $1}'|wc -w`
if [ $rrd -eq 0 ]; then
if [ -f /opt/freeware/bin/rrdtool ]; then
rrd="/opt/freeware/bin/rrdtool"
else
echo ""
echo "Warning: RRDTool has not been found in \$PATH, using RRDTOOL=/usr/bin/rrdtool"
echo " assure it is ok, if not then edit $HOMELPAR/etc/lpar2rrd.cfg and change it"
echo ""
rrd="/usr/bin/rrdtool"
fi
else
rrd=`which rrdtool|awk '{print $1}'`
fi
if [ -f /opt/freeware/bin/perl ]; then
per="/opt/freeware/bin/perl"
else
per=`which perl|awk '{print $1}'|wc -w`
if [ $per -eq 0 ]; then
echo ""
echo "Warning: Perl has not been found in \$PATH, placing /usr/bin/perl"
echo " assure it is ok, if not then edit $HOMELPAR/etc/lpar2rrd.cfg and change it"
echo ""
per="/usr/bin/perl"
else
per=`which perl|awk '{print $1}'`
fi
fi
if [ ! "$CUSTOM_PERL_INTERPRETER"x = "x" -a -f "$CUSTOM_PERL_INTERPRETER" ]; then
per="$CUSTOM_PERL_INTERPRETER"
fi
# replace path for actual one in config files
HOMELPAR_slash=`echo $HOMELPAR|sed 's/\//\\\\\\//g'`
HOME_slash=`echo $HOME|sed 's/\//\\\\\\//g'`
rrd_slash=`echo $rrd|sed 's/\//\\\\\\//g'`
per_slash=`echo $per|sed 's/\//\\\\\\//g'`
# add actual paths
PERL5LIB=/usr/lib64/perl5:/usr/lib64/perl5/vendor_perl/5.8.8:/opt/freeware/lib/perl/5.8.8:/opt/freeware/lib/perl/5.8.0:/usr/opt/perl5/lib/site_perl/5.8.2:/usr/lib/perl5/vendor_perl/5.8.5:/usr/share/perl5:/usr/lib/perl5:/usr/opt/perl5/lib/site_perl/5.8.8/aix-thread-multi:/opt/freeware/lib/perl5/vendor_perl/5.8.8/ppc-thread-multi:/usr/lib64/perl5/vendor_perl:/usr/lib/perl5/vendor_perl
PPATH="/opt/freeware/lib/perl5/site_perl/5.22.0/ppc-aix-thread-multi
/opt/freeware/lib/perl
/usr/opt/perl5/lib/site_perl
/opt/freeware/lib/perl5/vendor_perl/5.8.8
/usr/share/perl5/vendor_perl
/opt/csw/share/perl/csw
/opt/csw/lib/perl/site_perl
/usr/opt/perl5/lib/site_perl/5.8.8/aix-thread-multi
/usr/opt/perl5/lib/site_perl/5.10.1/aix-thread-multi
/opt/freeware/lib/perl5/site_perl/5.28.0/ppc-aix-thread-multi
/usr/lib64/perl5/vendor_perl"
# /opt/csw/share/perl/csw is necessary on Solaris
perl_version=`$per -e 'print "$]\n"'|sed -e 's/0/\./g' -e 's/\.\.\.\./\./g' -e 's/\.\.\./\./g' -e 's/\.\./\./g' -e 's/ //g'`
PLIB=`for ppath in $PPATH
do
echo $PERL5LIB|grep "$ppath/$perl_version" >/dev/null
if [ ! $? -eq 0 -a -d "$ppath/$perl_version" ]; then
echo "$ppath/$perl_version"
else
echo $PERL5LIB|grep "$ppath" >/dev/null
if [ ! $? -eq 0 -a -d "$ppath" ]; then
echo "$ppath"
fi
fi
done|xargs|sed 's/ /:/g'`
perl5lib="$HOMELPAR/bin:$HOMELPAR/vmware-lib:$PLIB:$PERL5LIB:$HOMELPAR/lib"
# Clean up PERL5LIB, place only existing dirs
PERL5LIB_new=""
for lib_path in `echo $perl5lib| sed 's/:/ /g'`
do
if [ -d "$lib_path" ]; then
if [ `echo "$PERL5LIB_new" | egrep "$lib_path:|$lib_path$" | wc -l | sed 's/ //g'` -eq 1 ]; then
continue
fi
if [ "$PERL5LIB_new"x = "x" ]; then
PERL5LIB_new=$lib_path
else
PERL5LIB_new=$PERL5LIB_new:$lib_path
fi
fi
done
# AIX: always keep this in PERL5LIB
# /opt/freeware/lib/perl/5.8.8:/usr/opt/perl5/lib/site_perl/5.8.8/aix-thread-multi:/opt/freeware/lib/perl5/vendor_perl/5.8.8/ppc-thread-multi
if [ $os_aix -eq 1 ]; then
if [ `echo "$PERL5LIB_new"|grep "/opt/freeware/lib/perl/5.8.8" | wc -l` -eq 0 ]; then
PERL5LIB_new="$PERL5LIB_new:/opt/freeware/lib/perl/5.8.8"
fi
if [ `echo "$PERL5LIB_new"|grep "/usr/opt/perl5/lib/site_perl/5.8.8/aix-thread-multi" | wc -l` -eq 0 ]; then
PERL5LIB_new="$PERL5LIB_new:/usr/opt/perl5/lib/site_perl/5.8.8/aix-thread-multi"
fi
if [ `echo "$PERL5LIB_new"|grep "/opt/freeware/lib/perl5/vendor_perl/5.8.8/ppc-thread-multi" | wc -l` -eq 0 ]; then
PERL5LIB_new="$PERL5LIB_new:/opt/freeware/lib/perl5/vendor_perl/5.8.8/ppc-thread-multi"
fi
fi
# Solaris: always keep this in PERL5LIB
# /opt/csw/share/perl/csw /opt/csw/lib/perl/site_perl
if [ `uname|grep SunOS|wc -l| sed 's/ //g'` -eq 1 ]; then
if [ `echo "$PERL5LIB_new"|grep "/opt/csw/share/perl/csw" | wc -l` -eq 0 ]; then
PERL5LIB_new="$PERL5LIB_new:/opt/csw/share/perl/csw"
fi
if [ `echo "$PERL5LIB_new"|grep "/opt/csw/lib/perl/site_perl" | wc -l` -eq 0 ]; then
PERL5LIB_new="$PERL5LIB_new:/opt/csw/lib/perl/site_perl"
fi
fi
perl5lib_slash=`echo "$PERL5LIB_new"|sed -e 's/::/:/g' -e 's/\//\\\\\\//g'`
echo "Configuring $HOMELPAR/etc/lpar2rrd.cfg"
ed $HOMELPAR/etc/lpar2rrd.cfg << EOF 1>/dev/null
g/__LPAR2RRD_HOME__/s/__LPAR2RRD_HOME__/$HOMELPAR_slash/g
g/__USER_HOME__/s/__USER_HOME__/$HOME_slash/g
g/__LPAR2RRD_USER__/s/__LPAR2RRD_USER__/$ID/g
g/__RRDTOOL__/s/__RRDTOOL__/$rrd_slash/g
g/__PERL__/s/__PERL__/$per_slash/g
g/__PERL5LIB__/s/__PERL5LIB__/$perl5lib_slash/g
w
q
EOF
if [ ! $? -eq 0 ]; then
echo ""
echo "Error!"
echo "Probably does not exist command: \"ed\" "
echo "If it is the case then install ed, \"rm -r $HOMELPAR\" and run install once more"
echo "Or customization of $HOMELPAR/etc/lpar2rrd.cfg failed"
echo "Contact support in this case"
exit 0
fi
# Solaris ssh does not recognizes -o SendEnv=no
if [ `uname|grep SunOS|wc -l| sed 's/ //g'` -eq 1 ]; then
ed $HOMELPAR/etc/lpar2rrd.cfg << EOF 1>/dev/null
g/ -o SendEnv=no/s/ -o SendEnv=no/ /g
w
q
EOF
fi
# creating ssh keys if they do not exist
echo "" |ssh-keygen -t dsa -P "" 2>/dev/null 1>/dev/null
SSH_WEB_IDENT=$HOME/.ssh/realt_dsa
#if [ ! -f "$SSH_WEB_IDENT" ]; then
# # realt_dsa exist, then probably keay are already in place
# echo "Do you want to create ssh-keys now (ssh-keygen -t dsa)?[n]"
# read Y
#
# if [ "$Y" = "y" -o "$Y" = "Y" ]; then
# echo ""
# ssh-keygen -t dsa
# echo ""
# echo ""
# fi
#fi
WWW_USER=`ps -ef|egrep "apache|httpd"|grep -v grep|awk '{print $1}'|grep -v "root"|head -1`
if [ "$WWW_USER"x = x ]; then
WWW_USER=nobody
fi
if [ ! -d $HOME/.ssh ]; then
echo "Could not be found directory with ssh-keys ($HOME/.ssh)"
echo " You wil need to do manually following:"
echo " 1. create ssh-keys (ssh-keygen -t dsa)"
echo " 2. copy keys to a new file and assign read rights for the web user : $WWW_USER"
echo " # cp $HOME/.ssh/id_dsa $HOME/.ssh/realt_dsa"
echo " under root account :"
echo " # chown $WWW_USER $HOME/.ssh/realt_dsa"
echo " # chmod 600 $HOME/.ssh/realt_dsa"
echo ""
else
if [ ! -f "$SSH_WEB_IDENT" ]; then
chmod 755 $HOME/.ssh
if [ -f $HOME/.ssh/id_dsa ]; then
cp -f $HOME/.ssh/id_dsa $SSH_WEB_IDENT
chmod 600 $SSH_WEB_IDENT
else
if [ -f $HOME/.ssh/id_rsa ]; then
cp -f $HOME/.ssh/id_rsa $SSH_WEB_IDENT
chmod 600 $SSH_WEB_IDENT
else
echo "Could not be found ssh-keys in ($HOME/ssh)"
echo " You wil need to do manually following:"
echo " 1. create ssh-keys (ssh-keygen -t dsa)"
echo " You wil need to do manually following:"
echo " 2. copy keys to a new file and assign read rights for the web user : $WWW_USER"
echo " # cp $HOME/.ssh/id_dsa $HOME/.ssh/realt_dsa"
echo " under root account :"
echo " # chown $WWW_USER $SSH_WEB_IDENT
echo " # chmod 600 $SSH_WEB_IDENT
echo ""
fi
fi
fi
fi
# stop the agent daemon althought it is the installation!! who knows what user is doing ...
if [ -f "$HOMELPAR/tmp/lpar2rrd-daemon.pid" ]; then
PID=`cat "$HOMELPAR/tmp/lpar2rrd-daemon.pid"|sed 's/ //g'`
if [ ! "$PID"x = "x" ]; then
echo "Stopping LPAR2RRD daemon"
kill `cat "$HOMELPAR/tmp/lpar2rrd-daemon.pid"`
fi
fi
run=`ps -ef|grep lpar2rrd-daemon.pl| egrep -v "grep |vi | vim "|wc -l`
if [ $run -gt 0 ]; then
kill `ps -ef|grep lpar2rrd-daemon.pl| egrep -v "grep |vi | vim "|awk '{print $2}'` 2>/dev/null
fi
cd $HOMELPAR
# change #!bin/ksh in shell script to #!bin/bash on Linux platform
os_linux=` uname -a|grep Linux|wc -l`
if [ $os_linux -eq 1 ]; then
# If Linux then change all "#!bin/sh --> #!bin/bash
for sh in $HOMELPAR/bin/*.sh
do
ed $sh << EOF >/dev/null 2>&1
1s/\/ksh/\/bash/
w
q
EOF
done
for sh in $HOMELPAR/scripts/*.sh
do
ed $sh << EOF >/dev/null 2>&1
1s/\/ksh/\/bash/
w
q
EOF
done
for sh in $HOMELPAR/*.sh
do
ed $sh << EOF >/dev/null 2>&1
1s/\/ksh/\/bash/
w
q
EOF
done
for sh in $HOMELPAR/lpar2rrd-cgi/*.sh
do
ed $sh << EOF >/dev/null 2>&1
1s/\/ksh/\/bash/
w
q
EOF
done
else
# for AIX Solaris etc, all should be already in place just to be sure ...
# change all "#!bin/bash --> #!bin/ksh
for sh in $HOMELPAR/bin/*.sh
do
ed $sh << EOF >/dev/null 2>&1
1s/\/bash/\/ksh/
w
q
EOF
done
for sh in $HOMELPAR/scripts/*.sh
do
ed $sh << EOF >/dev/null 2>&1
1s/\/bash/\/ksh/
w
q
EOF
done
for sh in $HOMELPAR/*.sh
do
ed $sh << EOF >/dev/null 2>&1
1s/\/bash/\/ksh/
w
q
EOF
done
for sh in $HOMELPAR/lpar2rrd-cgi/*.sh
do
ed $sh << EOF >/dev/null 2>&1
1s/\/bash/\/ksh/
w
q
EOF
done
fi
# not necessary since 4.70 due to a new GUI
#echo ""
#echo "Custom groups config file creation"
#$HOMELPAR/scripts/update_cfg_custom-groups.sh update
# not longer used (since 4.75)
#echo ""
#echo "Favourites config file creation"
#$HOMELPAR/scripts/update_cfg_favourites.sh update
#echo ""
#echo "Alerting config file creation"
#$HOMELPAR/scripts/update_cfg_alert.sh update
# Check web user has read&executable rights for CGI dir lpar2rrd-cgi
dir=`echo "$HOMELPAR/www"|sed 's/\\\//g'`
DIR=""
IFS_ORG=$IFS
IFS="/"
for i in $dir
do
IFS=$IFS_ORG
NEW_DIR=`echo $DIR$i/`
#echo "01 $NEW_DIR -- $i -- $DIR ++ $www"
NUM=`ls -dLl $NEW_DIR |awk '{print $1}'|sed -e 's/d//g' -e 's/-//g' -e 's/w//g' -e 's/\.//g'| wc -c`
#echo "02 $NUM"
if [ ! $NUM -eq 7 ]; then
echo ""
echo "WARNING, directory : $NEW_DIR has probably wrong rights"| sed 's/\/\//\//g'
echo " $www dir and its subdirs have to be executable&readable for WEB user"
ls -lLd $NEW_DIR| sed 's/\/\//\//g'
echo ""
fi
DIR=`echo "$NEW_DIR/"`
#echo $DIR
IFS="/"
done
IFS=$IFS_ORG
# ulimit check
# necessary for big aggregated graphs
#
# AIX:
# chuser data=8388608 lpar2rrd (4GB)
# chuser stack=1048576 lpar2rrd (512MB)
ulimit_message=0
data=`ulimit -d`
stack=`ulimit -s`
if [ $os_aix -eq 0 ]; then
if [ ! "$data" = "unlimited" -a ! "$data" = "hard" -a ! "$data" = "soft" ]; then
if [ $data -lt 4194304 ]; then
echo ""
echo "Warning: increase data ulimit for $ID user, it is actually too low ($data)"
echo "under root: chuser data=8388608 $ID"
ulimit_message=1
fi
fi
if [ ! "$stack" = "unlimited" -a ! "$stack" = "hard" -a ! "$data" = "soft" ]; then
if [ $stack -lt 1048576 ]; then
echo ""
echo "Warning: increase stack ulimit for $ID user, it is actually too low ($stack)"
echo "under root: chuser stack=524288 $ID"
ulimit_message=1
fi
fi
else # Linux
if [ ! "$data" = "unlimited" -a ! "$data" = "hard" -a ! "$data" = "soft" ]; then
if [ $data -lt 4194304 ]; then
echo ""
echo "Warning: increase data ulimit for $ID user, it is actually too low ($data)"
echo "under root: vi /etc/security/limits.conf"
echo "@$ID hard data 4194304"
echo "@$ID soft data 4194304"
ulimit_message=1
fi
fi
if [ ! "$stack" = "unlimited" -a ! "$stack" = "hard" -a ! "$data" = "soft" ]; then
if [ $stack -lt 524288 ]; then
echo ""
echo "Warning: increase stack ulimit for $ID user, it is actually too low ($stack)"
echo "under root: vi /etc/security/limits.conf"
echo "@$ID hard stack 524288"
echo "@$ID soft stack 524288"
ulimit_message=1
fi
fi
fi
if [ $ulimit_message -eq 1 ]; then
echo ""
echo "Assure that the same limits has even web user (apache/nobody/http)"
echo ""
fi
cd $HOMELPAR
if [ $os_aix -eq 0 ]; then
free=`df .|grep -iv filesystem|xargs|awk '{print $4}'`
freemb=`echo "$free/1048"|bc 2>/dev/null`
if [ $? -eq 0 -a ! "$freemb"x = "x" ]; then
if [ $freemb -lt 1048 ]; then
echo ""
echo "WARNING: free space in $HOMELPAR is too low : $freemb MB"
echo " note that 1 HMC needs about 1GB space depends on number of servers/lpars"
fi
fi
else
free=`df .|grep -iv filesystem|xargs|awk '{print $3}'`
freemb=`echo "$free/2048"|bc 2>/dev/null`
if [ $? -eq 0 -a ! "$freemb"x = "x" ]; then
if [ $freemb -lt 1048 ]; then
echo ""
echo "WARNING: free space in $HOMELPAR is too low : $freemb MB"
echo " note that 1 HMC needs about 1GB space depends on number of servers/lpars"
fi
fi
fi
# setting up the font dir (necessary for 1.3 on AIX)
FN_PATH="
/opt/freeware/share/fonts/dejavu
"
if [ ! -f "$HOME/.config/fontconfig/.fonts.conf" -o `grep -i deja "$HOME/.config/fontconfig/.fonts.conf" 2>/dev/null|wc -l` -eq 0 ]; then
if [ ! -d "$HOME/.config" ]; then
mkdir "$HOME/.config"
fi
if [ ! -d "$HOME/.config/fontconfig" ]; then
mkdir "$HOME/.config/fontconfig"
fi
echo $FN_PATH > "$HOME/.config/fontconfig/.fonts.conf"
fi
chmod 644 "$HOME/.config/fontconfig/.fonts.conf"
# no, no, it issues this error:
# Fontconfig warning: "/opt/freeware/etc/fonts/conf.d/50-user.conf", line 9: reading configurations from ~/.fonts.conf is deprecated.
#if [ ! -f "$HOME/.fonts.conf" ]; then
# echo $FN_PATH > "$HOME/.fonts.conf"
# chmod 644 "$HOME/.fonts.conf"
#fi
# for web server user home
if [ ! -d "$HOMELPAR/tmp/home" ]; then
mkdir "$HOMELPAR/tmp/home"
fi
#if [ ! -f "$HOMELPAR/tmp/home/.fonts.conf" ]; then
# echo $FN_PATH > "$HOMELPAR/tmp/home/.fonts.conf"
#fi
if [ ! -d "$HOMELPAR/tmp/home/.config" ]; then
mkdir "$HOMELPAR/tmp/home/.config"
fi
if [ ! -d "$HOMELPAR/tmp/home/.config/fontconfig" ]; then
mkdir "$HOMELPAR/tmp/home/.config/fontconfig"
fi
if [ ! -f "$HOMELPAR/tmp/home/.config/fontconfig/fonts.conf" ]; then
echo $FN_PATH > "$HOMELPAR/tmp/home/.config/fontconfig/fonts.conf"
fi
chmod 755 "$HOMELPAR/tmp/home"
chmod 755 "$HOMELPAR/tmp/home/.config"
chmod 755 "$HOMELPAR/tmp/home/.config/fontconfig"
chmod 644 "$HOMELPAR/tmp/home/.config/fontconfig/fonts.conf"
# Checking installed Perl modules
cd $HOMELPAR
. etc/lpar2rrd.cfg; $PERL bin/perl_modules_check.pl $PERL
echo ""
cd - >/dev/null
# RRDTool existency checking
$rrd >/dev/null 2>&1
ret=$?
if [ ! $ret -eq 127 ]; then
$rrd|grep graphv >/dev/null 2>&1
ret=$?
if [ $ret -eq 1 ]; then
# suggest RRDTool upgrade
rrd_version=`$rrd -v|head -1|awk '{print $2}'`
echo "Condider RRDtool upgrade to version 1.3.5+ (actual one is $rrd_version)"
echo "This will allow graph zooming: http://www.lpar2rrd.com/zoom.html"
echo ""
fi
fi
if [ $os_linux -gt 0 ]; then
# LinuxSE warning
SELINUX=`ps -ef | grep -i selinux| grep -v grep|wc -l`
if [ "$SELINUX" -gt 0 ]; then
GETENFORCE=`getenforce 2>/dev/null`
if [ "$GETENFORCE" = "Enforcing" ]; then
echo ""
echo "Warning!!!!!"
echo "SELINUX status is Enforcing, it might cause a problem during Apache setup"
echo "like this in Apache error_log: (13)Permission denied: access to /XXXX denied"
echo ""
fi
fi
fi
#VMware
if [ ! -d "$HOMELPAR/.vmware" ]; then
mkdir "$HOMELPAR/.vmware"
chmod 755 "$HOMELPAR/.vmware"
fi
if [ ! -d "$HOMELPAR/.vmware/credstore" ]; then
mkdir "$HOMELPAR/.vmware/credstore"
chmod 777 "$HOMELPAR/.vmware/credstore" # must be 777 to allow writes of Apache user
fi
# Apache authorization, it must be here because path has to be modified as per installation home
cat << END > $HOMELPAR/html/.htaccess
SetEnv XORUX_ACCESS_CONTROL 1
AuthUserFile $HOMELPAR/etc/web_config/htusers.cfg
AuthName "Authorized personnel only."
AuthType Basic
Require valid-user
END
if [ $os_aix -eq 1 ]; then
# AIX (at least) rrdtool 1.7 issue when prints mem profiling info to pwd/mon.out
touch $HOMELPAR/lpar2rrd-cgi/mon.out
chmod 777 $HOMELPAR/lpar2rrd-cgi/mon.out
touch $HOMELPAR/bin/mon.out
chmod 777 $HOMELPAR/bin/mon.out
# refresh font caching
fc-cache -fv >/dev/null 2>&1
fi
echo ""
echo "Installation has finished"
echo "Follow post-install instructions at:"
echo " http://www.lpar2rrd.com/install.htm"
date=`date "+%Y-%m-%d_%H:%M"`
echo "$version $date" >> $HOMELPAR/etc/version.txt
echo "$HOMELPAR" > $HOME/.lpar2rrd_home 2>/dev/null
lpar2rrd-6.02/scripts/update.sh 0000755 0001750 0001750 00000177016 13442733703 016351 0 ustar pahampl pahampl #!/bin/sh
#
# LPAR2RRD update script
# usage : ./update.sh
# ./update.sh nocheck # consistency check of RRDTool files is excluded
#
#
LANG=C
export LANG
check=1
if [ ! "$1"x = "x" ]; then
if [ "$1" = "nocheck" ]; then
check=0
fi
fi
AWK="awk"
if [ `uname -s` = "SunOS" ]; then
AWK="nawk"
fi
os_aix=` uname -a|grep AIX|wc -l`
UN=`uname`
TWOHYPHENS="--"
if [ "$UN" = "SunOS" ]; then TWOHYPHENS=""; fi # problem with basename param on Solaris
# test if "ed" command does not exist, it might happen especially on some Linux distros
ed << END 2>/dev/null 1>&2
q
END
if [ $? -gt 0 ]; then
echo "ERROR: "ed" command does not seem to be installed or in $PATH"
echo "Exiting ..."
exit 1
fi
lpm_find ()
{
if [ ! -f $dup_tmp ]; then
#something is wrong
cat /dev/null > $dup_tmp
return
fi
for i in `cat $dup_tmp|sort`
do
server_org=`echo "$i"|cut -d "/" -f1`
hmc_org=`echo "$i"|cut -d "/" -f2`
lpar_org=`echo "$i"|cut -d "/" -f3`
if [ ! -f "$INPUTDIR/data/$server_org/$hmc_org/$lpar_org.$RR" ]; then
# some proble, skipping
server_prev=$server_org
continue
fi
server_prev="" # to aviod HMc duall setup
# nested loop, must be run each lpar with all which have been found, there might be more than 2 lpars
for ii in `cat $dup_tmp`
do
server=`echo "$ii"|cut -d "/" -f1`
hmc=`echo "$ii"|cut -d "/" -f2`
lpar=`echo "$ii"|cut -d "/" -f3`
if [ "$server" = "$server_org" -a "$hmc" = "$hmc_org" -a "$lpar" = "$lpar_org" ]; then
# it is same record as already processing one, skipping
server_prev=$server
continue
fi
if [ ! "$hmc" = "$hmc_org" ]; then
# LPM must be under same HMC/SDMC, exceptions are only IVM
if [ ! -f $INPUTDIR/data/$server/$hmc/IVM -o ! -f $INPUTDIR/data/$server_org/$hmc_org/IVM ]; then
continue
fi
fi
if [ ! -f "$INPUTDIR/data/$server/$hmc/$lpar.$RR" ]; then
# some proble, skipping
server_prev=$server
continue
fi
if [ "$server" = "$server_org" ]; then
# probably dual HMC setup, skip this then
server_prev=$server
continue
fi
if [ "$server_prev"x = "x" ]; then
server_prev=$server
else
if [ "$server_prev" = "$server" ]; then
continue # due to dual HMC setup
fi
fi
# exclude VIOses
if [ -f $INPUTDIR/data/$server/$hmc/lpm-exclude.txt ]; then
egrep "^$lpar\$" $INPUTDIR/data/$server/$hmc/lpm-exclude.txt >/dev/null
if [ $? -eq 0 ]; then
#if [ $DEBUG ]; then echo "LPM new lpar : $lpar $server:$hmc - looks like VIO, excluding it" ; fi
continue
fi
fi
if [ -f $INPUTDIR/data/$server_org/$hmc_org/lpm-exclude.txt ]; then
egrep "^$lpar_org\$" $INPUTDIR/data/$server_org/$hmc_org/lpm-exclude.txt >/dev/null
if [ $? -eq 0 ]; then
#if [ $DEBUG ]; then echo "LPM new lpar : $lpar_org $server_org:$hmc_org - looks like VIO, excluding it" ; fi
continue
fi
fi
#if [ $DEBUG ]; then echo "LPM new lpar : $lpar : $hmc_org:$server_org --> $hmc:$server"; fi
(( LPM_FOUND = LPM_FOUND + 1 )) # LPM found
if [ $LPM_FOUND -gt 5 ]; then
break
fi
server_prev=$server
done
done
cat /dev/null > $dup_tmp # clean out temp file
return 0
}
lpm_support ()
{
dup_tmp=/tmp/lpar2rrd-dup-$$.txt #tmp file
cat /dev/null > $dup_tmp
cd $INPUTDIR/data
lpar_prev=""
for i in `find . -name \*$RR -exec ls {} \;| sed 's/^\.\///g'|sort -t "/" -k 3`
do
server=`echo "$i"|cut -d "/" -f1`
if [ -h "$server" ]; then
continue
fi
hmc=`echo "$i"|cut -d "/" -f2`
lpar_all=`echo "$i"|cut -d "/" -f3`
lpar1=`basename $TWOHYPHENS "$lpar_all" .$RR`
lpar=`basename $TWOHYPHENS "$lpar1" .rrh` # must be there
# exclude not LPM stuff
echo "$lpar" | egrep "^SharedPool[0-9]*" >/dev/null 2>&1
if [ $? -eq 0 -o "$lpar" = "mem" -o "$lpar" = "pool" ]; then
if [ `wc -l $dup_tmp|$AWK '{print $1}'` -gt 1 ]; then
lpm_find
fi
continue
fi
if [ "$lpar_prev"x = "x" ]; then
echo "$server/$hmc/$lpar" > $dup_tmp
lpar_prev=$lpar
continue
fi
if [ "$lpar" = "$lpar_prev" ]; then
echo "$server/$hmc/$lpar" >> $dup_tmp # add next lpar
else
if [ `wc -l $dup_tmp|$AWK '{print $1}'` -gt 1 ]; then
lpm_find
fi
echo "$server/$hmc/$lpar" > $dup_tmp # start new lpar
lpar_prev=$lpar
fi
done
if [ `wc -l $dup_tmp|$AWK '{print $1}'` -gt 1 ]; then
lpm_find
fi
rm -f $dup_tmp
}
DEBUG_UPD=0
ID=`id -un`
if [ $os_aix -eq 0 ]; then
ECHO_OPT="-e"
else
ECHO_OPT=""
fi
umask 022
if [ -d $HOME/lpar2rrd ]; then
HOME1=$HOME/lpar2rrd
fi
if [ -f "$HOME/etc/.magic" ]; then
. $HOME/etc/.magic
fi
if [ -f "/home/lpar2rrd/lpar2rrd/etc/.magic" ]; then
. /home/lpar2rrd/lpar2rrd/etc/.magic
fi
if [ `ps -ef|egrep "/load.sh|"|egrep -v "grep"|wc -l` -gt 0 ]; then
kill `ps -ef|egrep "load.sh"|egrep -v "grep"|$AWK '{print $2}'|xargs` 2>/dev/null
sleep 2
fi
if [ -f "$HOME/.lpar2rrd_home" ]; then
HOME1=`cat "$HOME/.lpar2rrd_home"`
fi
if [ ! "$HOME1"x = "x" -a -d "$HOME1" ]; then
echo $ECHO_OPT "Where is LPAR2RRD actually located [$HOME1]: \c"
else
if [ x"$HOME1" = "x" ]; then
echo $ECHO_OPT "Where is LPAR2RRD actually located: \c"
else
echo $ECHO_OPT "Where is LPAR2RRD actually located [$HOME1]: \c"
fi
fi
# check if it is running from the image, then no wait for the input
if [ "$VM_IMAGE"x = "x" ]; then
read HOMELPAR
else
if [ $VM_IMAGE -eq 0 ]; then
read HOMELPAR
else
echo ""
echo "$HOME1"
fi
fi
if [ x"$HOMELPAR" = "x" ]; then
HOMELPAR=$HOME1
fi
# Check if it runs under the right user
check_file="$HOMELPAR/bin/lpar2rrd.pl"
if [ ! -f "$check_file" ]; then
check_file="$HOMELPAR/lpar2rrd.pl"
if [ ! -f "$check_file" ]; then
echo "LPAR2RRD product has not been found in: $HOMELPAR"
exit 1
fi
fi
if [ `uname -s` = "SunOS" ]; then
# Solaris does not have -X
install_user=`ls -l "$check_file"|$AWK '{print $3}'`
else
install_user=`ls -lX "$check_file"|$AWK '{print $3}'` # must be X to do not cut user name to 8 chars
fi
running_user=`id |$AWK -F\( '{print $2}'|$AWK -F\) '{print $1}'`
if [ ! "$install_user" = "$running_user" ]; then
echo "You probably trying to run it under wrong user"
echo "LPAR2RRD files are owned by : $install_user"
echo "You are : $running_user"
echo "LPAR2RRD update should run only under user which owns installed package"
echo "Do you want to really continue? [n]:"
# check if it is running from the image, then no wait for the input
if [ "$VM_IMAGE"x = "x" ]; then
read answer
else
if [ $VM_IMAGE -eq 0 ]; then
read answer
else
echo ""
echo "Exiting as a wrong user ..."
exit 1
fi
fi
if [ "$answer"x = "x" -o "$answer" = "n" -o "$answer" = "N" ]; then
exit 1
fi
fi
CFG24=$HOMELPAR/etc/lpar2rrd.cfg
CFG=$HOMELPAR/etc/lpar2rrd.cfg
cp -p $CFG $CFG-backup
if [ ! -f "$CFG" ]; then
CFG24=$HOMELPAR/lpar2rrd.cfg
CFG=$HOMELPAR/lpar2rrd.cfg
if [ ! -f "$CFG" ]; then
CFG=$HOMELPAR/load.sh
if [ ! -f "$CFG" ]; then
echo "Could not find config file $CFG, LPAR2RRD is not installed there, exiting"
exit 1
fi
fi
fi
touch test
if [ ! $? -eq 0 ]; then
p=`pwd`
echo "Actual user does not have rights to create files in actual directory: $p "
echo "Fix it and re-run upgrade"
exit 1
fi
rm -f test
if [ -f lpar2rrd.tar.Z ]; then
which uncompress >/dev/null 2>&1
if [ $? -eq 0 ]; then
uncompress -f lpar2rrd.tar.Z
if [ ! $? -eq 0 ]; then
echo "Package uncomress encountered a problem"
echo "Check if actual user owns directory and if there is enough of disk space"
echo "Exiting without any change"
exit 1
fi
else
which gunzip >/dev/null 2>&1
if [ $? -eq 0 ]; then
gunzip -f lpar2rrd.tar.Z
if [ ! $? -eq 0 ]; then
echo "Package uncomress encountered a problem"
echo "Check if actual user owns directory and if there is enough of disk space"
echo "Exiting without any change"
exit 1
fi
else
echo "Could not locate uncompress or gunzip commands. exiting"
exit 1
fi
fi
fi
if [ -f lpar2rrd.tar ]; then
echo "Extracting distribution"
tar xf lpar2rrd.tar
if [ ! $? -eq 0 ]; then
echo "Package extraction encountered a problem"
echo "Check if actual user owns directory and if there is enough of disk space"
echo "Exiting without any change"
exit 1
fi
else
echo "looks like it is already extracted, tar is missing"
fi
if [ ! -d "dist" ]; then
echo "There is not \"dist\", data was not extracted properly"
echo "Check if actual user owns directory and if there is enough of disk space"
echo "Exiting without any change"
exit 1
fi
cd dist
# Read original configuration
WEBDIR=`sed 's/#.*$//g' $CFG|egrep "WEBDIR=" | tail -1|$AWK -F = '{print $2}' |sed -e 's/\//\\\\\\\\\//g' -e 's/ //g'|sed -e 's/ //g' -e 's/ /\\\\ /g'`
HMC_USER=`sed 's/#.*$//g' $CFG|egrep "HMC_USER=" | tail -1|$AWK -F = '{print $2}'|sed -e 's/ //g' -e 's/ /\\\\ /g'`
HMC_HOSTAME=`sed 's/#.*$//g' $CFG|egrep "HMC_HOSTAME=" | tail -1|$AWK -F = '{print $2}'|sed 's/ /\\\\ /g'|sed -e 's/ //g' -e 's/"/\\\\"/g'`
HMC_LIST=`sed 's/#.*$//g' $CFG|egrep "HMC_LIST=" | tail -1|$AWK -F = '{print $2}'|sed -e 's/\//\\\\\\\\\//g' -e 's/ /\\\\ /g'|sed -e 's/ //g' -e 's/"/\\\\"/g'`
IVM_LIST=`sed 's/#.*$//g' $CFG|egrep "IVM_LIST=" | tail -1|$AWK -F = '{print $2}'|sed -e 's/\//\\\\\\\\\//g' -e 's/ /\\\\ /g'|sed -e 's/ //g' -e 's/"/\\\\"/g'`
MANAGED_SYSTEMS_EXCLUDE=`sed 's/#.*$//g' $CFG|egrep "MANAGED_SYSTEMS_EXCLUDE=" | tail -1|$AWK -F = '{print $2}'|sed 's/ /\\\\ /g'|sed -e 's/ //g' -e 's/"/\\\\"/g'`
PERL=`sed 's/#.*$//g' $CFG|egrep "PERL=" | tail -1|$AWK -F = '{print $2}'|sed -e 's/\//\\\\\\\\\//g' -e 's/ //g'|sed -e 's/ //g' -e 's/ /\\\\ /g'`
PERL_act=`sed 's/#.*$//g' $CFG|egrep "PERL=" | tail -1|$AWK -F = '{print $2}'|sed -e 's/ //g'|sed -e 's/ //g' -e 's/ /\\\\ /g'`
RRD=`sed 's/#.*$//g' $CFG|egrep "RRDTOOL=" | tail -1|$AWK -F = '{print $2}' |sed -e 's/\//\\\\\\\\\//g' -e 's/ //g'|sed -e 's/ //g' -e 's/ /\\\\ /g'`
SAMPLE_RATE=`sed 's/#.*$//g' $CFG|egrep "SAMPLE_RATE=" | tail -1|$AWK -F = '{print $2}'|sed -e 's/ //g' -e 's/ /\\\\ /g'`
HWINFO=`sed 's/#.*$//g' $CFG|egrep "HWINFO=" | tail -1|$AWK -F = '{print $2}'|sed -e 's/ //g' -e 's/ /\\\\ /g'`
SYS_CHANGE=`sed 's/#.*$//g' $CFG|egrep "SYS_CHANGE=" | tail -1|$AWK -F = '{print $2}'|sed -e 's/ //g' -e 's/ /\\\\ /g'`
RRDHEIGHT=`sed 's/#.*$//g' $CFG|egrep "RRDHEIGHT=" $CFG|egrep -v "#|DASHB_"| tail -1|$AWK -F = '{print $2}'|sed -e 's/ //g' -e 's/ /\\\\ /g'`
RRDWIDTH=`sed 's/#.*$//g' $CFG|egrep "RRDWIDTH=" $CFG|egrep -v "#|DASHB_"| tail -1|$AWK -F = '{print $2}'|sed -e 's/ //g' -e 's/ /\\\\ /g'`
DASHB_RRDHEIGHT=`sed 's/#.*$//g' $CFG|egrep "DASHB_RRDHEIGHT=" | tail -1|$AWK -F = '{print $2}'|sed -e 's/ //g' -e 's/ /\\\\ /g'`
DASHB_RRDWIDTH=`sed 's/#.*$//g' $CFG|egrep "DASHB_RRDWIDTH=" | tail -1|$AWK -F = '{print $2}'|sed -e 's/ //g' -e 's/ /\\\\ /g'`
PERL5LIB=`sed 's/#.*$//g' $CFG|egrep "PERL5LIB=" | tail -1|$AWK -F = '{print $2}'|sed -e 's/ //g'`
DEBUG=`sed 's/#.*$//g' $CFG|egrep "DEBUG=" | tail -1|$AWK -F = '{print $2}'|sed -e 's/ //g' -e 's/ /\\\\ /g'`
EXPORT_TO_CSV=`sed 's/#.*$//g' $CFG|egrep "EXPORT_TO_CSV=" | tail -1|$AWK -F = '{print $2}'|sed -e 's/ //g' -e 's/ /\\\\ /g'`
PICTURE_COLOR=`sed 's/#.*$//g' $CFG|egrep "PICTURE_COLOR=" | tail -1|$AWK -F = '{print $2}'|sed -e 's/ //g' -e 's/ /\\\\ /g'`
HEA=`sed 's/#.*$//g' $CFG|egrep "HEA=" $CFG|grep -v "STEP_HEA"|grep -v "#"| tail -1|$AWK -F = '{print $2}'|sed -e 's/ //g' -e 's/ /\\\\ /g'`
STEP_HEA=`sed 's/#.*$//g' $CFG|egrep "STEP_HEA=" | tail -1|$AWK -F = '{print $2}'|sed -e 's/ //g' -e 's/ /\\\\ /g'`
TOPTEN=`sed 's/#.*$//g' $CFG|egrep "TOPTEN=" | tail -1|$AWK -F = '{print $2}'|sed -e 's/ //g' -e 's/ /\\\\ /g'`
LPM=`sed 's/#.*$//g' $CFG|egrep "LPM=" | tail -1|$AWK -F = '{print $2}'|sed -e 's/ //g' -e 's/ /\\\\ /g'`
LPAR2RRD_AGENT_DAEMON=`sed 's/#.*$//g' $CFG|egrep "LPAR2RRD_AGENT_DAEMON=" | tail -1|$AWK -F = '{print $2}'|sed -e 's/ //g' -e 's/ /\\\\ /g'`
LPAR2RRD_AGENT_DAEMON_PORT=`sed 's/#.*$//g' $CFG|egrep "LPAR2RRD_AGENT_DAEMON_PORT=" | tail -1|$AWK -F = '{print $2}'|sed -e 's/ //g' -e 's/ /\\\\ /g'`
LPAR2RRD_AGENT_DAEMON_IP=`sed 's/#.*$//g' $CFG|egrep "LPAR2RRD_AGENT_DAEMON_IP=" | tail -1|$AWK -F = '{print $2}'|sed -e 's/ //g' -e 's/ /\\\\ /g'`
LPM_LPAR_EXCLUDE=`sed 's/#.*$//g' $CFG|egrep "LPM_LPAR_EXCLUDE=" | tail -1|$AWK -F = '{print $2}'|sed 's/ /\\\\ /g'|sed -e 's/ //g' -e 's/"/\\\\"/g'`
LPM_SERVER_EXCLUDE=`sed 's/#.*$//g' $CFG|egrep "LPM_SERVER_EXCLUDE=" | tail -1|$AWK -F = '{print $2}'|sed 's/ /\\\\ /g'|sed -e 's/ //g' -e 's/"/\\\\"/g'`
LPM_HMC_EXCLUDE=`sed 's/#.*$//g' $CFG|egrep "LPM_HMC_EXCLUDE=" | tail -1|$AWK -F = '{print $2}'|sed 's/ /\\\\ /g'|sed -e 's/ //g' -e 's/"/\\\\"/g'`
SSH_WEB_IDENT=`sed 's/#.*$//g' $CFG|egrep "SSH_WEB_IDENT=" | tail -1|$AWK -F = '{print $2}' |sed -e 's/-q//' -e 's/\//\\\\\\\\\//g' -e 's/ //g'|sed -e 's/ //g' -e 's/ /\\\\ /g'`
#Do not use here $AWK -F = '{print $2}' as there might be more "=" inside the param !!!
SSH=`sed 's/#.*$//g' $CFG|egrep "SSH=" | tail -1| sed -e 's/^.*SSH=//' -e 's/"//g' -e 's/ //g'`
#SSH=`sed 's/#.*$//g' $CFG|egrep "SSH=" | tail -1|$AWK -F = '{print $2}' |sed -e 's/-q//' -e 's/\//\\\\\\\\\//g' |sed -e 's/ //g' -e 's/ /\\\\ /g'`
#SSH=`sed 's/#.*$//g' $CFG|egrep "SSH=" | tail -1|$AWK -F = '{print $2}'|sed 's/ /\\\\ /g'|sed -e 's/ //g' -e 's/"/\\\\"/g'`
ACL_ADMIN_GROUP=`sed 's/#.*$//g' $CFG|egrep "ACL_ADMIN_GROUP=" | tail -1|$AWK -F = '{print $2}'|sed -e 's/\//\\\\\\\\\//g' -e 's/ /\\\\ /g' -e 's/"/\\\\"/g' -e 's/ //g'`
ACL_GRPLIST_VARNAME=`sed 's/#.*$//g' $CFG|egrep "ACL_GRPLIST_VARNAME=" | tail -1|$AWK -F = '{print $2}'|sed -e 's/\//\\\\\\\\\//g' -e 's/ /\\\\ /g' -e 's/"/\\\\"/g' -e 's/ //g'`
LEGEND_HEIGHT=`sed 's/#.*$//g' $CFG|egrep "LEGEND_HEIGHT=" | tail -1|$AWK -F = '{print $2}'|sed -e 's/ //g' -e 's/ /\\\\ /g'`
PDF_PAGE_SIZE=`sed 's/#.*$//g' $CFG|egrep "PDF_PAGE_SIZE=" | tail -1|$AWK -F = '{print $2}'|sed -e 's/ //g' -e 's/ /\\\\ /g'`
if [ "$SSH"x = "x" ]; then
# in case it is not there for any reason
SSH="ssh -q"
fi
# if OpenSSH then place there: -o ConnectTimeout=80 -o StrictHostKeyChecking=no -o PreferredAuthentications=publickey
if [ `$SSH -V 2>&1|grep -i OpenSSH|wc -l` -eq 1 ]; then
if [ `echo "$SSH"|grep -i ConnectTimeout|wc -l` -eq 0 ]; then
SSH_tmp="$SSH"
SSH=`echo "$SSH_tmp -o ConnectTimeout=80 -o StrictHostKeyChecking=no -o PreferredAuthentications=publickey "`
fi
if [ `echo "$SSH"|grep -i SendEnv|wc -l` -eq 0 ]; then
SSH_tmp="$SSH"
SSH=`echo "$SSH_tmp -o SendEnv=no "`
fi
fi
if [ `echo "$SSH"|grep -- "-q" |wc -l` -eq 0 ]; then
# "-q" must be there always
SSH_tmp=$SSH
SSH="$SSH_tmp -q "
fi
SSH_tmp=$SSH
# Solaris ssh does not recognize -o SendEnv=no
if [ `uname|grep SunOS|wc -l| sed 's/ //g'` -eq 1 ]; then
SSH=`echo $SSH_tmp|sed -e 's/\//\\\\\\\\\//g' -e 's/ /\\\\ /g' -e 's/^/\\\\"/' -e 's/$/\\\\ \\\\"/'|sed 's/ -o SendEnv=no/ /g'`
else
SSH=`echo $SSH_tmp|sed -e 's/\//\\\\\\\\\//g' -e 's/ /\\\\ /g' -e 's/^/\\\\"/' -e 's/$/\\\\ \\\\"/'`
fi
WEBDIR_PLAIN=`echo $WEBDIR | sed 's/\\\//g'`
if [ -f ../version.txt ]; then
# actually installed version
version_new=`cat ../version.txt|tail -1|sed 's/ .*//'`
fi
if [ -f "$HOMELPAR/etc/version.txt" ]; then
version=`egrep "[0-9]\.[0-9]" $HOMELPAR/etc/version.txt|tail -1|sed 's/ .*//'`
VER=`egrep "[0-9]\.[0-9]" $HOMELPAR/etc/version.txt|tail -1|sed 's/ .*//'|sed 's/-.*$//'` # get only major version info
else
# old version of getting version
if [ `grep "# version " $CFG|wc -l` -eq 1 ]; then
VER=`egrep "# version " $CFG|tail -1|$AWK '{print $3}'`
else
VER=`egrep "version=" $CFG|tail -1|$AWK -F= '{print $2}'`
fi
version=$VER
fi
#if [ "$LPM_LPAR_EXCLUDE"X = "X" ]; then
# LPM_LPAR_EXCLUDE=""
#fi
#if [ "$LPM_SERVER_EXCLUDE"X = "X" ]; then
# LPM_SERVER_EXCLUDE=""
#fi
#if [ "$LPM_HMC_EXCLUDE"X = "X" ]; then
# LPM_HMC_EXCLUDE=""
#fi
if [ "$LPAR2RRD_AGENT_DAEMON"X = "X" ]; then
LPAR2RRD_AGENT_DAEMON=0
fi
if [ "$LPAR2RRD_AGENT_DAEMON_PORT"X = "X" ]; then
LPAR2RRD_AGENT_DAEMON_PORT=8162
fi
if [ "$LPAR2RRD_AGENT_DAEMON_IP"X = "X" ]; then
LPAR2RRD_AGENT_DAEMON_IP=0.0.0.0
fi
if [ "$LPM"X = "X" ]; then
LPM=0
fi
# set LPM=1 after upgrade from free to the full version
if [ "$LPM" = "0" -a ! -f "$HOMELPAR/bin/premium.pl" -a -f "bin/premium.pl" ]; then
# only if upgrade is from free to premium version, not when premium to premium
LPM=1
fi
hash_ACL_ADMIN_GROUP="\#ACL_ADMIN_GROUP"
if [ "$ACL_ADMIN_GROUP"X = "X" ]; then
ACL_ADMIN_GROUP=lpar2rrd-admins
hash_ACL_ADMIN_GROUP="ACL_ADMIN_GROUP"
fi
hash_ACL_GRPLIST_VARNAME="\#ACL_GRPLIST_VARNAME"
if [ "$ACL_GRPLIST_VARNAME"X = "X" ]; then
ACL_GRPLIST_VARNAME=AUTHENTICATE_MEMBEROF
hash_ACL_GRPLIST_VARNAME="ACL_GRPLIST_VARNAME"
fi
if [ "$TOPTEN"X = "X" -o "$TOPTEN" = "10" ]; then
TOPTEN=50 # new top10 default since 4.60
fi
if [ "$SYS_CHANGE"X = "X" ]; then
SYS_CHANGE=100
fi
if [ "$RRDHEIGHT"X = "X" ]; then
RRDHEIGHT=150
fi
if [ "$RRDWIDTH"X = "X" ]; then
RRDWIDTH=700
fi
if [ "$DASHB_RRDHEIGHT"X = "X" ]; then
DASHB_RRDHEIGHT=50
fi
if [ "$LEGEND_HEIGHT"X = "X" ]; then
LEGEND_HEIGHT=120
fi
if [ "$DASHB_RRDWIDTH"X = "X" ]; then
DASHB_RRDWIDTH=120
fi
if [ "$PDF_PAGE_SIZE"X = "X" ]; then
PDF_PAGE_SIZE=A4
fi
if [ "$DEBUG"X = "X" ]; then
DEBUG=1
fi
if [ "$PICTURE_COLOR"X = "X" -o "$PICTURE_COLOR" = "D3D2D2" -o "$PICTURE_COLOR" = "E3E2E2" -o "$PICTURE_COLOR" = "F7FCF8" ]; then
PICTURE_COLOR=F7F7F7
fi
if [ "$EXPORT_TO_CSV"X = "X" ]; then
EXPORT_TO_CSV=1
fi
if [ "$SSH_WEB_IDENT"X = "X" ]; then
#SSH_WEB_IDENT="\\\/home\\\/lpar2rrd\\\/.ssh\\\/realt_rsa"
SSH_WEB_IDENT=`echo "$HOME/.ssh/realt_rsa"| sed -e 's/\//\\\\\\\\\//g' -e 's/ //g'|sed 's/ /\\\\ /g'`
fi
if [ "$HEA"X = "X" ]; then
HEA=1
fi
# fix for the bug from old version
if [ $HEA -eq 300 ]; then
HEA=1
fi
if [ "$SSH"X = "X" ]; then
SSH=`echo "ssh" |sed -e 's/\//\\\\\\\\\//g' -e 's/ /\\\\ /g' -e 's/^/\\\\"/' -e 's/$/\\\\ \\\\"/'`
fi
if [ "$DEBUG"X = "X" ]; then
DEBUG=1
fi
if [ "$STEP_HEA"X = "X" ]; then
STEP_HEA=300
fi
echo "$PERL5LIB"|grep ":" >/dev/null 2>&1
if [ ! $? -eq 0 ]; then
# perl/5.8.8 must be always first!
PERL5LIB=/usr/lib64/perl5/vendor_perl/5.8.8:/opt/freeware/lib/perl/5.8.8:/opt/freeware/lib/perl/5.8.0:/usr/opt/perl5/lib/site_perl/5.8.2:/usr/lib/perl5/vendor_perl/5.8.5:/usr/share/perl5:/usr/lib/perl5:/usr/opt/perl5/lib/site_perl/5.8.8/aix-thread-multi:/opt/freeware/lib/perl5/vendor_perl/5.8.8/ppc-thread-multi
fi
# add actual paths
PPATH="/opt/freeware/lib/perl5/site_perl/5.22.0/ppc-aix-thread-multi
/usr/lib64/perl5
/opt/freeware/lib/perl
/opt/freeware/lib/perl5/vendor_perl/5.8.8
/usr/opt/perl5/lib/site_perl
/usr/lib/perl5/vendor_perl
/usr/share/perl5/vendor_perl
/opt/csw/share/perl/csw
/opt/csw/lib/perl/site_perl
/usr/opt/perl5/lib/site_perl/5.8.8/aix-thread-multi
/usr/opt/perl5/lib/site_perl/5.10.1/aix-thread-multi
/opt/freeware/lib/perl5/site_perl/5.28.0/ppc-aix-thread-multi
/usr/lib64/perl5/vendor_perl"
# /opt/csw/share/perl/csw is necessary on Solaris
perl_version=`$PERL_act -e 'print "$]\n"'|sed -e 's/0/\./g' -e 's/\.\.\.\./\./g' -e 's/\.\.\./\./g' -e 's/\.\./\./g' -e 's/ //g'`
PLIB=`for ppath in $PPATH
do
echo $PERL5LIB|grep "$ppath/$perl_version" >/dev/null
if [ ! $? -eq 0 -a -d "$ppath/$perl_version" ]; then
echo "$ppath/$perl_version"
else
echo $PERL5LIB|grep "$ppath" >/dev/null
if [ ! $? -eq 0 -a -d "$ppath" ]; then
echo "$ppath"
fi
fi
done|xargs|sed -e 's/ /\:/g' -e 's/\:\:/\:/g'`
if [ `echo "$PERL5LIB"|grep aix-thread-multi|wc -l` -eq 0 ]; then
PERL5LIB="$PERL5LIB:/usr/opt/perl5/lib/site_perl/5.8.8/aix-thread-multi"
fi
if [ `echo "$PERL5LIB"|grep ppc-thread-multi|wc -l` -eq 0 ]; then
PERL5LIB="$PERL5LIB:/opt/freeware/lib/perl5/vendor_perl/5.8.8/ppc-thread-multi"
fi
if [ `echo "$PLIB:$PERL5LIB"|grep "$HOMELPAR/vmware-lib"|wc -l` -eq 0 ]; then
if [ "$PLIB"x = "x" ]; then
PERL5LIB=`echo "$HOMELPAR/vmware-lib:$PERL5LIB"`
else
PERL5LIB=`echo "$HOMELPAR/vmware-lib:$PLIB:$PERL5LIB"`
fi
else
if [ ! "$PLIB"x = "x" ]; then
PERL5LIB=`echo "$PLIB:$PERL5LIB"`
fi
fi
if [ `echo "$PERL5LIB"|egrep "^$HOMELPAR/bin"|wc -l` -eq 0 ]; then
# Placing BINDIR ($HOMELPAR/bin) on start of PERL5LIB : 5.09-21
PERL5LIB=`echo "$HOMELPAR/bin:$PERL5LIB"`
fi
#if [ $os_aix -gt 0 ]; then
# # AIX must have $HOMELPAR/lib on start due to https support
# # No no, VMware requires $HOMELPAR/lib at the end on AIX!!!
# if [ `echo "$PERL5LIB"|egrep "^$HOMELPAR/lib:" |wc -l` -eq 0 ]; then
# PERL5LIB="$HOMELPAR/lib:$PERL5LIB"
# fi
#else
#fi
# Clean up PERL5LIB, place only existing dirs
PERL5LIB_new=""
for lib_path in `echo $PERL5LIB| sed 's/:/ /g'`
do
if [ -d "$lib_path" ]; then
if [ `echo "$PERL5LIB_new" | egrep "$lib_path:|$lib_path$" | wc -l | sed 's/ //g'` -eq 1 ]; then
continue
fi
if [ `echo "$lib_path" | egrep "$HOMELPAR/bin$|$HOMELPAR/vmware-lib$" | wc -l | sed 's/ //g'` -eq 1 ]; then
# exclude $HOMELPAR/bin & $HOMELPAR/vmware-lib; they will be added later on
continue
fi
if [ "$PERL5LIB_new"x = "x" ]; then
PERL5LIB_new=$lib_path
else
PERL5LIB_new=$PERL5LIB_new:$lib_path
fi
fi
done
# $HOMELPAR/vmware-lib must be always on the 2nd possition otherwise error 500 might appear
PERL5LIB=$HOMELPAR/bin:$HOMELPAR/vmware-lib:$PERL5LIB_new
# it must be checked again as $HOMELPAR/lib do not have to exist yet if original version was quite old
if [ `echo "$PERL5LIB"|grep "$HOMELPAR/lib" |wc -l` -eq 0 ]; then
PERL5LIB="$PERL5LIB:$HOMELPAR/lib"
fi
PERL5LIB=`echo "$PERL5LIB"|sed -e 's/::/:/g' -e 's/\//\\\\\\\\\//g' -e 's/ //g'`
if [ "$VER" = "" ]; then
# very old version did not have version string inside, so putting here something lower than 241
VER="100"
fi
VER_ORG=`echo $VER|sed 's/\.//g'`
if [ $DEBUG_UPD -eq 1 ]; then
echo "
$WEBDIR
$HMC_USER
$HMC_LIST
$HMC_HOSTAME
$MANAGED_SYSTEMS_EXCLUDE
$PERL
$RRDTOOL
$SRATE
$VER
$WEBDIR_PLAIN
$HWINFO
$SYS_CHANG
$RRDHEIGHT
$RRDWIDTH
$PERL5LIB
$PICTURE_COLOR
$DEBUG
$EXPORT_TO_CSV
$HEA
$STEP_HEA
$TOPTEN
$LPM
$LPM_LPAR_EXCLUDE
$LPM_SERVER_EXCLUDE
$LPM_HMC_EXCLUDE
"
fi
if [ -f $HOMELPAR/bin/premium.pl -a ! -f bin/premium.pl ]; then
echo ""
echo "You are going to instal a free version over a full version!!!"
echo "This is not supported and it will not work"
echo "Type \"yes\" to delete full version features from your environment:"
# check if it is running from the image, then no wait for the input
if [ "$VM_IMAGE"x = "x" ]; then
read full
else
if [ $VM_IMAGE -eq 0 ]; then
read full
else
echo "yes"
full="yes"
fi
fi
if [ "$full" = "yes" ]; then
rm -f $HOMELPAR/bin/premium* $HOMELPAR/bin/genreport.sh $HOMELPAR/etc/rperf_table.txt
rm -f $HOMELPAR/lpar2rrd-cgi/vcenter-list-cgi.sh $HOMELPAR/bin/vcenter-list-cgi.pl
# cannot be otherwise CWE for core does not work
#rm -f $HOMELPAR/lpar2rrd-cgi/lpar-list-cgi.sh $HOMELPAR/bin/lpar-list-cgi.pl
#rm -f $HOMELPAR/lpar2rrd-cgi/lpar-list-rep.sh $HOMELPAR/bin/lpar-list-rep.pl
echo "Full version features have been deleted."
else
echo "Full version features persist there, it might lead to errors."
fi
fi
if [ ! -f bin/premium.pl ]; then
rm -f $HOMELPAR/lpar2rrd-cgi/vcenter-list-cgi.sh $HOMELPAR/bin/vcenter-list-cgi.pl
# cannot be otherwise CWE for core does not work
#rm -f $HOMELPAR/lpar2rrd-cgi/lpar-list-cgi.sh $HOMELPAR/bin/lpar-list-cgi.pl
#rm -f $HOMELPAR/lpar2rrd-cgi/lpar-list-rep.sh $HOMELPAR/bin/lpar-list-rep.pl
fi
echo "Backing up original version : $version to $HOMELPAR/BACKUP-INSTALL/lpar2rrd-$version"
if [ ! -d $HOMELPAR/BACKUP-INSTALL ]; then
mkdir $HOMELPAR/BACKUP-INSTALL
fi
if [ ! -d $HOMELPAR/BACKUP-INSTALL/lpar2rrd-$version ]; then
mkdir $HOMELPAR/BACKUP-INSTALL/lpar2rrd-$version
fi
#
echo "Saving $version configuration"
#cp -R $HOMELPAR/logs $HOMELPAR/BACKUP-INSTALL/lpar2rrd-$version/ 2>/dev/null
if [ -f "$HOMELPAR/logs/alert_history.log" ]; then
cp -p $HOMELPAR/logs/alert_history.log $HOMELPAR/BACKUP-INSTALL/lpar2rrd-$version/alert_history.log
fi
rm -f $HOMELPAR/logs/* 2>/dev/null # clean up logs
if [ -f "$HOMELPAR/BACKUP-INSTALL/lpar2rrd-$version/alert_history.log" ]; then
# keep alert_history.log through upgrades
mv $HOMELPAR/BACKUP-INSTALL/lpar2rrd-$version/alert_history.log $HOMELPAR/logs/
fi
#gzip -f9 $HOMELPAR/BACKUP-INSTALL/lpar2rrd-$version/logs/* 1>/dev/null 2>&1 #compress old logs
cp -Rp $HOMELPAR/etc $HOMELPAR/bin $HOMELPAR/BACKUP-INSTALL/lpar2rrd-$version/ 2>/dev/null
cp $HOMELPAR/*.cfg $HOMELPAR/*.txt $HOMELPAR/*.sh $HOMELPAR/BACKUP-INSTALL/lpar2rrd-$version/ 2>/dev/null
if [ $VER_ORG -lt 600 ]; then
# house cleaning only for old distros
if [ -d "$HOMELPAR/data/XEN_VMs" ]; then
echo ""
echo "Looks like you have beta tested XEN"
echo "It will not work now, there has been format change"
echo "Remove data manually: rm -r $HOMELPAR/data/XEN* "
fi
fi
if [ $VER_ORG -lt 511 ]; then
# house cleaning only for old distros
if [ -d "$HOMELPAR/data/oVirt/storage" -a "$DEMO"x = "x" ]; then
echo "Removing oVirt storage capacity data, old format"
rm -f $HOMELPAR/data/oVirt/storage/sd-*.rrd
fi
fi
if [ $VER_ORG -lt 239 ]; then
# house cleaning only for old distros
mv $HOMELPAR/*.sh $HOMELPAR/*.pl $HOMELPAR/*.pm $HOMELPAR/BACKUP-INSTALL/lpar2rrd-$version/ 2>/dev/null
mv $HOMELPAR/lpar2rrd-[1-9]* $HOMELPAR/BACKUP-INSTALL/ 2>/dev/null # move away old backups
fi
rm -f $HOMELPAR/html/.v $HOMELPAR/html/.p
cp -Rp $HOMELPAR/html $HOMELPAR/lpar2rrd-cgi $HOMELPAR/bin $HOMELPAR/BACKUP-INSTALL/lpar2rrd-$version/ 2>/dev/null
chown $ID $HOMELPAR
if [ ! $? -eq 0 ]; then
echo "Problem with ownership of $HOMELPAR"
echo "Fix it and run it again : chown $ID $HOMELPAR"
exit 1
fi
# clean up agent directory to do not leave there old versions
if [ -d "$HOMELPAR/agent" ]; then
rm -f $HOMELPAR/agent/*
echo "Download the latest agent from: http://www.lpar2rrd.com/download-xorux.htm" > $HOMELPAR/agent/Readme.txt
echo "Use it even if you are a customer and use LPAR2RRD Enterprise Edition" >> $HOMELPAR/agent/Readme.txt
fi
# save cfg
if [ -f $HOMELPAR/etc/alias.cfg ]; then
mv $HOMELPAR/etc/alias.cfg $HOMELPAR/etc/alias.cfg-org
fi
if [ -f $HOMELPAR/etc/heatmap_exclude.cfg ]; then
mv $HOMELPAR/etc/heatmap_exclude.cfg $HOMELPAR/etc/heatmap_exclude.cfg-org
fi
echo "Copy new version to the target destination"
chmod 644 $HOMELPAR/lib/*pm 2>/dev/null # was some problem in past
cp -R * $HOMELPAR/
if [ $os_aix -gt 0 ]; then
# Font cache refresh, it migh speed up significantly graphs creation on AIX
fc-cache -v 1>/dev/null 2>&1
# extract perl lib for https REST API support (LWP 6.06)
if [ -f ../perl_aix_ssl.tar.Z ]; then
uncompress -f ../perl_aix_ssl.tar.Z
fi
if [ -f ../perl_aix_ssl.tar ]; then
tar xf ../perl_aix_ssl.tar
cp -R lib $HOMELPAR/
else
echo "ERROR during: uncompress -f perl_aix_ssl.tar.Z : install it manually"
echo " uncompress -f perl_aix_ssl.tar.Z; cd $HOMELPAR/; tar xvf perl_aix_ssl.tar"
fi
fi
# Clean agent dir (old agents), no more distributing OS agents with the lpar2rrd server
rm -f $HOMELPAR/agent/lpar2rrd-agent*
# put WEB files immediately after the upgrade to do not have to wait for the end of upgrade
echo "Copy GUI files : $HOMELPAR/www"
cp $HOMELPAR/html/*html $HOMELPAR/www
cp $HOMELPAR/html/*ico $HOMELPAR/www
cp $HOMELPAR/html/*png $HOMELPAR/www
pwd_org=`pwd`
cd $HOMELPAR/html
tar cf - jquery | (cd $HOMELPAR/www; tar xf - )
tar cf - css | (cd $HOMELPAR/www; tar xf - )
cd $pwd_org >/dev/null
if [ ! -f "$HOMELPAR/tmp/menu.txt" -a -f "$HOMELPAR/html/menu_default.txt" ]; then
#place default menu.txt
cp $HOMELPAR/html/menu_default.txt $HOMELPAR/tmp/menu.txt
fi
# return cfg
if [ -f $HOMELPAR/etc/alias.cfg-org ]; then
mv $HOMELPAR/etc/alias.cfg $HOMELPAR/etc/alias.cfg.example
mv $HOMELPAR/etc/alias.cfg-org $HOMELPAR/etc/alias.cfg
fi
if [ -f $HOMELPAR/etc/heatmap_exclude.cfg-org ]; then
mv $HOMELPAR/etc/heatmap_exclude.cfg $HOMELPAR/etc/alias.cfg.example
mv $HOMELPAR/etc/heatmap_exclude.cfg-org $HOMELPAR/etc/heatmap_exclude.cfg
fi
if [ `grep "#VM:" $HOMELPAR/etc/alias.cfg 2>/dev/null| wc -l | sed 's/ //g'` -eq 0 ]; then
echo "#" >> $HOMELPAR/etc/alias.cfg
echo "# VMware" >> $HOMELPAR/etc/alias.cfg
echo "#VM:VC01_VM01:oracle server alias" >> $HOMELPAR/etc/alias.cfg
echo "#" >> $HOMELPAR/etc/alias.cfg
fi
# it mus be here to get configured cfg as soon as possible after copy it over
echo "Configuring new lpar2rrd.cfg"
if [ $VER_ORG -lt 239 ]; then
eval ' sed -e 's/WEBDIR=.*/WEBDIR=$WEBDIR/g' \
-e 's/RRDTOOL=.*/RRDTOOL=$RRD/g' -e 's/SAMPLE_RATE=.*/SAMPLE_RATE=$SAMPLE_RATE/g' \
-e 's/HMC_USER=.*/HMC_USER=$HMC_USER/g' -e 's/HMC_LIST=".*"/HMC_LIST=$HMC_HOSTAME/g' \
-e 's/MANAGED_SYSTEMS_EXCLUDE=.*/MANAGED_SYSTEMS_EXCLUDE=$MANAGED_SYSTEMS_EXCLUDE/g' \
-e 's/PERL=.*/PERL=$PERL/g' -e 's/HWINFO=.*/HWINFO=$HWINFO/g' \
-e 's/DEBUG=.*/DEBUG=$DEBUG_CFG/g' \
$HOMELPAR/etc/lpar2rrd.cfg > $HOMELPAR/etc/lpar2rrd.cfg-new '
else
eval ' sed -e 's/WEBDIR=.*/WEBDIR=$WEBDIR/g' \
-e 's/RRDTOOL=.*/RRDTOOL=$RRD/g' -e 's/SAMPLE_RATE=.*/SAMPLE_RATE=$SAMPLE_RATE/g' \
-e 's/HMC_USER=.*/HMC_USER=$HMC_USER/g' -e 's/HMC_LIST=".*"/HMC_LIST=$HMC_LIST/g' \
-e 's/MANAGED_SYSTEMS_EXCLUDE=.*/MANAGED_SYSTEMS_EXCLUDE=$MANAGED_SYSTEMS_EXCLUDE/g' \
-e 's/PERL=.*/PERL=$PERL/g' -e 's/HWINFO=.*/HWINFO=$HWINFO/g' \
-e 's/SYS_CHANGE=.*/SYS_CHANGE=$SYS_CHANGE/g' -e 's/RRDHEIGHT=.*/RRDHEIGHT=$RRDHEIGHT/g' \
-e 's/RRDWIDTH=.*/RRDWIDTH=$RRDWIDTH/g' -e 's/PERL5LIB=.*/PERL5LIB=$PERL5LIB/g' \
-e 's/DASHB_RRDHEIGHT=.*/DASHB_RRDHEIGHT=$DASHB_RRDHEIGHT/g' -e 's/DASHB_RRDWIDTH=.*/DASHB_RRDWIDTH=$DASHB_RRDWIDTH/g' \
-e 's/PICTURE_COLOR=.*/PICTURE_COLOR=$PICTURE_COLOR/g' -e 's/DEBUG=.*/DEBUG=$DEBUG/g' \
-e 's/HEA=.*/HEA=$HEA/g' -e 's/STEP_HEA=.*/STEP_HEA=$STEP_HEA/g' \
-e 's/TOPTEN=.*/TOPTEN=$TOPTEN/g' -e 's/$hash_ACL_ADMIN_GROUP=.*/ACL_ADMIN_GROUP=$ACL_ADMIN_GROUP/g' \
-e 's/$hash_ACL_GRPLIST_VARNAME=.*/ACL_GRPLIST_VARNAME=$ACL_GRPLIST_VARNAME/g' \
-e 's/LPM=.*/LPM=$LPM/g' -e 's/LPM_HMC_EXCLUDE=.*/LPM_HMC_EXCLUDE=$LPM_HMC_EXCLUDE/g' \
-e 's/LPAR2RRD_AGENT_DAEMON=.*/LPAR2RRD_AGENT_DAEMON=$LPAR2RRD_AGENT_DAEMON/g' \
-e 's/LPAR2RRD_AGENT_DAEMON_PORT=.*/LPAR2RRD_AGENT_DAEMON_PORT=$LPAR2RRD_AGENT_DAEMON_PORT/g' \
-e 's/LPAR2RRD_AGENT_DAEMON_IP=.*/LPAR2RRD_AGENT_DAEMON_IP=$LPAR2RRD_AGENT_DAEMON_IP/g' \
-e 's/LPM_SERVER_EXCLUDE=.*/LPM_SERVER_EXCLUDE=$LPM_SERVER_EXCLUDE/g' \
-e 's/LPM_LPAR_EXCLUDE=.*/LPM_LPAR_EXCLUDE=$LPM_LPAR_EXCLUDE/g' -e 's/IVM_LIST=".*"/IVM_LIST=$IVM_LIST/g' \
-e 's/EXPORT_TO_CSV=.*/EXPORT_TO_CSV=$EXPORT_TO_CSV/g' -e 's/LEGEND_HEIGHT=.*/LEGEND_HEIGHT=$LEGEND_HEIGHT/g' \
-e 's/SSH_WEB_IDENT=.*/SSH_WEB_IDENT=$SSH_WEB_IDENT/g' -e 's/PDF_PAGE_SIZE=.*/PDF_PAGE_SIZE=$PDF_PAGE_SIZE/g' \
-e 's/SSH=.*/SSH=$SSH/g' $HOMELPAR/etc/lpar2rrd.cfg > $HOMELPAR/etc/lpar2rrd.cfg-new '
fi
if [ `cat $HOMELPAR/etc/lpar2rrd.cfg-new|wc -l|sed 's/ //g'` -eq 0 ]; then
echo ""
echo "ERROR: Configuration of $HOMELPAR/etc/lpar2rrd.cfg failed, original file is kept"
echo " This might cause unpredictable problems, contact LPAR2RRD support in case anything is not working fine after the update"
echo ""
cp $CFG-backup $CFG
else
mv $HOMELPAR/etc/lpar2rrd.cfg-new $HOMELPAR/etc/lpar2rrd.cfg
fi
rm -f $CFG-backup
if [ -h $HOMELPAR/realt-error.log ]; then
# must be removed here before chown ...
# it is an old stuff
rm -f $HOMELPAR/realt-error.log
fi
if [ -h $HOMELPAR/logs/error-cgi.log ]; then
rm -f $HOMELPAR/logs/error-cgi.log
fi
echo "Setting file/dir permissions, it might take some time in big environments"
chown $ID $HOMELPAR/* 2>&1|egrep -v "error-cgi|lost+found"
chown -R $ID $HOMELPAR/lpar2rrd-cgi
chown -R $ID $HOMELPAR/html
chown $ID $HOMELPAR/etc
chown $ID $HOMELPAR/etc/*.cfg
chown $ID $HOMELPAR/etc/*.txt
chown $ID $HOMELPAR/etc/*.conf 2>/dev/null
chown -R $ID $HOMELPAR/logs 2>&1|egrep -v "error-cgi"
if [ -f "$HOMELPAR/.magic" ]; then
chown $ID $HOMELPAR/.magic 2>&1
chmod 755 $HOMELPAR/.magic 2>&1
fi
chown -R $ID $HOMELPAR/scripts
chown -R $ID $HOMELPAR/www 2>/dev/null
if [ ! -d $HOMELPAR/tmp ]; then
mkdir $HOMELPAR/tmp
fi
chmod 777 $HOMELPAR/tmp # due to "Refresh" feature which need to save temp files there
chmod 755 $HOMELPAR/logs
chmod -R 755 $HOMELPAR/lib
chmod 644 $HOMELPAR/lib/*pm
chmod 666 $HOMELPAR/logs/* 2>&1|egrep -v "error-cgi"
chmod 755 $HOMELPAR
chmod 755 $HOMELPAR/bin
chmod -R 755 $HOMELPAR/html # must be due tue subdirs jquery, images ...
chmod -R 755 $HOMELPAR/lpar2rrd-cgi
chmod -R o+r $HOMELPAR/www 2>/dev/null
chmod -R o+x $HOMELPAR/www 2>/dev/null
chmod 755 $HOMELPAR/bin/*.pl
chmod 755 $HOMELPAR/bin/*.pm
chmod 755 $HOMELPAR/bin/*.sh
chmod 755 $HOMELPAR/*.sh
# do not touch etc/web_config here!
chmod 644 $HOMELPAR/etc/*.cfg
chmod 644 $HOMELPAR/etc/*.txt
chmod 644 $HOMELPAR/etc/*.conf 2>/dev/null
chmod 755 $HOMELPAR/scripts/*
chmod 644 $HOMELPAR/*.txt
if [ ! -h $HOMELPAR/logs/error-cgi.log ]; then
ln -s /var/tmp/lpar2rrd-realt-error.log $HOMELPAR/logs/error-cgi.log 2>/dev/null
fi
if [ -f /var/tmp/lpar2rrd-realt-error.log ]; then
# remove cgi-bin error log if rights are sufficient
cat /dev/null > /var/tmp/lpar2rrd-realt-error.log 2>/dev/null
fi
if [ "$VM_IMAGE"x = "x" ]; then
# only for non image update, it might take a long time and on image should not happen such things
echo "chmod -R o+r,o+x $HOMELPAR/data"
chmod -R o+r,o+x $HOMELPAR/data 2>&1|egrep -v " path name does not exist|No such file or directory"
#echo "chown -R $ID $HOMELPAR/data"
#chown -R $ID $HOMELPAR/data 2>&1|egrep -v " path name does not exist|No such file or directory"
#echo "chmod -R o+x $HOMELPAR/data"
#chmod -R o+x $HOMELPAR/data 2>&1|egrep -v " path name does not exist|No such file or directory"
echo ""
fi
cd $HOMELPAR
if [ ! -d "$WEBDIR_PLAIN" ]; then
mkdir "$WEBDIR_PLAIN"
fi
if [ ! -d "$HOMELPAR/etc/web_config" ]; then
mkdir "$HOMELPAR/etc/web_config"
fi
if [ "$VM_IMAGE"x = "x" ]; then
chmod 777 "$HOMELPAR/etc/web_config"
chmod 777 "$HOMELPAR/reports"
else
chmod 755 "$HOMELPAR/etc/web_config"
chmod 755 "$HOMELPAR/reports"
fi
if [ ! -f "$HOMELPAR/etc/web_config/htusers.cfg" ]; then
echo 'admin:$apr1$CSoXefyw$wGe9K7Ld5ClOEozE4zC.T1' > $HOMELPAR/etc/web_config/htusers.cfg
if [ "$VM_IMAGE"x = "x" ]; then
chmod 666 $HOMELPAR/etc/web_config/htusers.cfg
else
chmod 600 $HOMELPAR/etc/web_config/htusers.cfg
fi
fi
rm -f $HOMELPAR/bin/load.sh # it comes by a mistake with some version, remove it (fixed definitelly in 4.91 at least)
# Check whether web user has read&executable rights for CGI dir lpar2rrd-cgi
www=`echo "$WEBDIR"|sed 's/\\\//g'`
DIR=""
IFS_ORG=$IFS
IFS="/"
for i in $www
do
IFS=$IFS_ORG
NEW_DIR=`echo $DIR$i/`
#echo "01 $NEW_DIR -- $i -- $DIR ++ $www"
NUM=`ls -dLl $NEW_DIR |$AWK '{print $1}'|sed -e 's/d//g' -e 's/-//g' -e 's/w//g' -e 's/\.//g'| wc -c`
#echo "02 $NUM"
if [ ! $NUM -eq 7 ]; then
echo ""
echo "WARNING, directory : $NEW_DIR has probably wrong rights" | sed 's/\/\//\//g'
echo " $www dir and its subdirs have to be executable&readable for WEB user"
ls -lLd $NEW_DIR| sed 's/\/\//\//g'
echo ""
fi
DIR=`echo "$NEW_DIR/"`
#echo $DIR
IFS="/"
done
IFS=$IFS_ORG
# Check whether web user has read&executable rights for CGI dir lpar2rrd-cgi
CGI="$HOMELPAR/lpar2rrd-cgi"
DIR=""
IFS_ORG=$IFS
IFS="/"
for i in $CGI
do
IFS=$IFS_ORG
NEW_DIR=`echo $DIR$i/`
NUM=`ls -dLl $NEW_DIR |$AWK '{print $1}'|sed -e 's/d//g' -e 's/-//g' -e 's/w//g' -e 's/\.//g'| wc -c`
#echo $NUM
if [ ! $NUM -eq 7 ]; then
echo ""
echo "WARNING, directory : $NEW_DIR has probably wrong rights" | sed 's/\/\//\//g'
echo " it dir has to be executable&readable for WEB user"
ls -lLd $NEW_DIR| sed 's/\/\//\//g'
echo ""
fi
DIR=`echo "$NEW_DIR/"`
#echo $DIR
IFS="/"
done
IFS=$IFS_ORG
if [ $VER_ORG -lt 300 ]; then
echo ""
echo "*******************************************************************"
echo "Now manually remove LPAR2RRD web content by : rm -r $WEBDIR_PLAIN/*"
echo "It will be all recovered during next LPAR2RRD run"
echo "*******************************************************************"
echo ""
fi
if [ $VER_ORG -lt 239 ]; then
echo "Update your web server, following example is for Apache"
echo "Just append following into your httpd.conf and restart Apache by : apachectl restart"
echo ""
echo "# CGI-BIN"
echo "ScriptAlias /lpar2rrd-cgi/ \"$HOMELPAR/lpar2rrd-cgi/\""
echo ""
echo " AllowOverride None"
echo " Options ExecCGI Includes"
echo " Order allow,deny"
echo " Allow from all"
echo ""
echo ""
fi
if [ $VER_ORG -lt 259 ]; then
SSH_WEB_IDENT=`echo $SSH_WEB_IDENT|sed 's/\\\\//g'`
if [ ! -d $HOME/.ssh ]; then
echo "Could not be found directory with ssh-keys ($HOME/.ssh)"
echo "You must do it manually"
echo " - find location of id_dsa or id_rsa file"
echo " - under root do :"
echo " # cp __YOUR_LOCATION__/id_dsa $SSH_WEB_IDENT"
echo " # chown $WWW_USER $SSH_WEB_IDENT"
echo " # chmod 600 $SSH_WEB_IDENT"
echo ""
else
chmod 755 $HOME/.ssh
if [ -f $HOME/.ssh/id_dsa ]; then
cp -f $HOME/.ssh/id_dsa $SSH_WEB_IDENT
chmod 600 $SSH_WEB_IDENT
else
if [ -f $HOME/.ssh/id_rsa ]; then
cp -f $HOME/.ssh/id_rsa $SSH_WEB_IDENT
chmod 600 $SSH_WEB_IDENT
else
echo "Could not be found ssh-keys in ($HOME/.ssh)"
echo "You must do it manually"
echo " - find location of id_dsa or id_rsa file"
echo " - under root do :"
echo " # cp __YOUR_LOCATION__/id_dsa $SSH_WEB_IDENT"
echo " # chown $WWW_USER $SSH_WEB_IDENT"
echo " # chmod 600 $SSH_WEB_IDENT"
echo ""
fi
fi
fi
WWW_USER=`ps -ef|egrep "apache|httpd"|grep -v grep|$AWK '{print $1}'|grep -v "root"|head -1`
WWW_USER_GUESS=0
if [ "$WWW_USER"x = x ]; then
WWW_USER=nobody
WWW_USER_GUESS=1
fi
echo ""
echo "To install \"real-time\" refresh you need to allow to WEB user automatic logon to HMC"
echo "Just copy&past following instructions:"
echo ""
echo " 1. login as root"
if [ $WWW_USER_GUESS -eq 1 ]; then
echo " 2. # chown $WWW_USER $SSH_WEB_IDENT (suppose $WWW_USER is the WEB user)"
else
echo " 2. # chown $WWW_USER $SSH_WEB_IDENT"
fi
echo " 3. # chmod 600 $SSH_WEB_IDENT"
echo ""
echo ""
fi
rm -f $HOMELPAR/tmp/[1-9]* # do not remove everything aas usually, topten files should stay
rm -f $HOMELPAR/lpar_html.pl # distributed in 3.10 by a mistake
#crontab -l 2>/dev/null |grep -i hea >/dev/null
#if [ ! $? -eq 0 ]; then
# echo "to allow IVE (HEA) and FC (only for IVE servers) stats add into cron via "crontab -e":"
# echo "0,5,10,15,20,25,30,35,40,45,50,55 * * * * $HOMELPAR/load_hea.sh > $HOMELPAR/load_hea.out 2>&1"
# echo ""
#fi
# search potential LPM lpars
export INPUTDIR=$HOMELPAR # for compatability rasons
LPM_FOUND=0
# no LPM search any more, 6.00, not necessary
if [ ! -f $INPUTDIR/bin/premium.pl ]; then
#RR="rrm"
#lpm_support
rm -f $INPUTDIR/bin/premium_lpm_find.sh # remove it, it was in free version by a mistake, fixed in 5.08
fi
#if [ $LPM_FOUND -gt 0 ]; then
# echo ""
# echo "*********************************************************************"
# if [ $LPM_FOUND -gt 5 ]; then
# echo "Live Partition Mobility has been very likely identified"
# else
# echo "Live Partition Mobility has been probably identified"
# fi
# echo "LPAR2RRD free version does not support this feature"
# echo "Check http://lpar2rrd.com/support.htm how to obtain LPM aware version"
# echo "LPAR2RRD will work without aware of LPM ..."
# echo "*********************************************************************"
# echo ""
#fi
# fix memory rrdtool, there was limit 1TB for ram
if [ $VER_ORG -lt 402 ]; then
find $HOMELPAR/data -name "mem.rr*" -exec $RRDTOOL tune {} --maximum curr_avail_mem:1000000000000 \;
find $HOMELPAR/data -name "mem.rr*" -exec $RRDTOOL tune {} --maximum conf_sys_mem:1000000000000 \;
find $HOMELPAR/data -name "mem.rr*" -exec $RRDTOOL tune {} --maximum sys_firmware_mem:1000000000000 \;
fi
# move rperf tables from version < 3.20 into etc/
if [ ! -f $HOMELPAR/etc/rperf_user.txt ]; then
if [ -f $HOMELPAR/rperf_user.txt ]; then
mv $HOMELPAR/rperf_user.txt $HOMELPAR/etc/rperf_user.txt
fi
fi
if [ ! -f $HOMELPAR/etc/rperf_table.txt ]; then
if [ -f $HOMELPAR/rperf_table.txt ]; then
mv $HOMELPAR/rperf_table.txt $HOMELPAR/etc/rperf_table.txt
fi
fi
rm -f $HOMELPAR/rperf_table.txt
# copy rperf_user table, do not overwrite it!!
if [ ! -f $HOMELPAR/etc/rperf_user.txt -a -f $HOMELPAR/etc/rperf_user.txt_template ]; then
mv $HOMELPAR/etc/rperf_user.txt_template $HOMELPAR/etc/rperf_user.txt
else
rm -f $HOMELPAR/etc/rperf_user.txt_template
fi
rm -f tmp/[1-9]* error.log error.log-hea apache-cfg.txt lpar2rrd.cfg
rm -rf config
# move old backup dirs into centra backup
for dir in lpar2rrd-[1-3]*
do
if [ -d $dir ]; then
#echo $dir
mv $dir BACKUP-INSTALL/ 2>/dev/null
fi
done
# change #!bin/ksh in shell script to #!bin/bash on Linux platform
os_linux=` uname -a|grep Linux|wc -l`
if [ $os_linux -eq 1 ]; then
# If Linux then change all "#!bin/sh --> #!bin/bash
for sh in $HOMELPAR/bin/*.sh
do
ed $sh << EOF 2>/dev/null 1>&2
1s/\/ksh/\/bash/
w
q
EOF
done
for sh in $HOMELPAR/scripts/*.sh
do
ed $sh << EOF 2>/dev/null 1>&2
1s/\/ksh/\/bash/
w
q
EOF
done
for sh in $HOMELPAR/*.sh
do
ed $sh << EOF 2>/dev/null 1>&2
1s/\/ksh/\/bash/
w
q
EOF
done
for sh in $HOMELPAR/lpar2rrd-cgi/*.sh
do
ed $sh << EOF 2>/dev/null 1>&2
1s/\/ksh/\/bash/
w
q
EOF
done
else
# for AIX Solaris etc, all should be already in place just to be sure ...
# change all "#!bin/sh --> #!bin/bash
for sh in $HOMELPAR/bin/*.sh
do
ed $sh << EOF >/dev/null 2>&1
1s/\/bash/\/ksh/
w
q
EOF
done
for sh in $HOMELPAR/scripts/*.sh
do
ed $sh << EOF >/dev/null 2>&1
1s/\/bash/\/ksh/
w
q
EOF
done
for sh in $HOMELPAR/*.sh
do
ed $sh << EOF >/dev/null 2>&1
1s/\/bash/\/ksh/
w
q
EOF
done
for sh in $HOMELPAR/lpar2rrd-cgi/*.sh
do
ed $sh << EOF >/dev/null 2>&1
1s/\/bash/\/ksh/
w
q
EOF
done
fi
# fix when in config files appeared by a bug .rrm or .rrh sufixes
LIST="$HOMELPAR/etc/alert.cfg $HOMELPAR/etc/favourites.cfg $HOMELPAR/etc/custom_groups.cfg"
for file in $LIST
do
if [ -f $file ]; then
ed $file << EOF 2>/dev/null 1>&2
g/\.rrm/s/\.rrm//
g/\.rrh/s/\.rrh//
w
q
EOF
fi
done
# set graph sending along with alarms, default last 8 hours
if [ $VER_ORG -lt 350 ]; then
if [ -f $HOMELPAR/etc/alert.cfg ]; then
ed $HOMELPAR/etc/alert.cfg << EOF 2>/dev/null 1>&2
g/EMAIL_GRAPH=0/s/EMAIL_GRAPH=0/EMAIL_GRAPH=8/
w
q
EOF
fi
fi
# not necessary since 4.70 due to a new GUI
#echo ""
#echo "Custom groups config file update"
#$HOMELPAR/scripts/update_cfg_custom-groups.sh update
custom_cfg="$HOMELPAR/etc/custom_groups.cfg"
if [ -f "$custom_cfg" -a `grep " WARNING " "$custom_cfg" 2>/dev/null| wc -l` -eq 0 ]; then
mv "$custom_cfg" "$custom_cfg-bck"
cat << END > "$custom_cfg"
#
# !!!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!!!
#
# This configuration file is not more used since v4.70
# Configure Custom Groups directly in the GUI : GUI --> Custom Groups --> Configuration
# http://www.lpar2rrd.com/custom_groups.html
#
# !!!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!!!
#
END
cat "$custom_cfg-bck" >> "$custom_cfg"
rm -f "$custom_cfg-bck"
# change all_pools --> CPU pool : since 4.70
ed $HOMELPAR/etc/$custom_cfg << EOF 2>/dev/null 1>&2
g/:all_pools:/s/:all_pools:/:CPU pool:/
w
q
EOF
fi
# Refresh custom restriction after the upgrade
rm -f $HOMELPAR/tmp/.custom-group-*.cmd 2>/dev/null
# remove custom cmd definitions to be sure that they are reinitiated after upgrade,
rm -f $HOMELPAR/tmp/custom-group-* 2>/dev/null
# remove color file for total HMC graphs, new format came in 4.90
find $HOMELPAR/data . -name lpars.col -exec rm -f {} \;
# no longer used (since 4.75)
#echo ""
#echo "Favourites config file update"
#$HOMELPAR/scripts/update_cfg_favourites.sh update
# no longer used (since 5.00)
#echo ""
#echo "Alert config file update"
#$HOMELPAR/scripts/update_cfg_alert.sh update
# space cheking as new memory rrd files will appera there
if [ $VER_ORG -lt 330 ]; then
no_lpars=`find $HOMELPAR/data -name "*rr[m|h]"|wc -l|sed 's/ //g'`
echo ""
echo "Assure there is at least $no_lpars MB free in the fs where LPAR2RRD is installed!!"
echo "It will be needed for new memory graphs"
echo ""
fi
# delete old AS400 JOB rrd files, new format is there since 4.88
if [ $VER_ORG -lt 488 ]; then
for as400_space in `find $HOMELPAR/data -type d -name \*--AS400-- | sed 's/ /===space===/g'`
do
as400=`echo "$as400_space"| sed 's/===space===/ /g'`
if [ -d "$as400/JOB" ]; then
rm -f $as400/JOB/*
fi
done
fi
# ulimit check
# necessary for big aggregated graphs
#
# AIX:
# chuser data=8388608 lpar2rrd (4GB)
# chuser stack=1048576 lpar2rrd (512MB)
ulimit_message=0
data=`ulimit -d`
stack=`ulimit -s`
if [ $os_aix -eq 0 ]; then
if [ ! "$data" = "unlimited" -a ! "$data" = "hard" -a ! "$data" = "soft" ]; then
if [ $data -lt 4194304 ]; then
echo ""
echo "Warning: increase data ulimit for $ID user, it is actually too low ($data)"
echo "under root: chuser data=8388608 $ID"
ulimit_message=1
fi
fi
if [ ! "$stack" = "unlimited" -a ! "$stack" = "hard" -a ! "$data" = "soft" ]; then
if [ $stack -lt 1048576 ]; then
echo ""
echo "Warning: increase stack ulimit for $ID user, it is actually too low ($stack)"
echo "under root: chuser stack=524288 $ID"
ulimit_message=1
fi
fi
else # Linux
if [ ! "$data" = "unlimited" -a ! "$data" = "hard" -a ! "$data" = "soft" ]; then
if [ $data -lt 4194304 ]; then
echo ""
echo "Warning: increase data ulimit for $ID user, it is actually too low ($data)"
echo "under root: vi /etc/security/limits.conf"
echo "@$ID hard data 4194304"
echo "@$ID soft data 4194304"
ulimit_message=1
fi
fi
if [ ! "$stack" = "unlimited" -a ! "$stack" = "hard" -a ! "$data" = "soft" ]; then
if [ $stack -lt 524288 ]; then
echo ""
echo "Warning: increase stack ulimit for $ID user, it is actually too low ($stack)"
echo "under root: vi /etc/security/limits.conf"
echo "@$ID hard stack 524288"
echo "@$ID soft stack 524288"
ulimit_message=1
fi
fi
fi
if [ $ulimit_message -eq 1 ]; then
echo ""
echo "Assure that the same limits has even web user (apache/nobody/http)"
echo ""
fi
rm -f $HOMELPAR/tmp/ent-run # force to run cpu config advisor
# stop the agent daemon
if [ -f "$HOMELPAR/tmp/lpar2rrd-daemon.pid" ]; then
PID=`cat "$HOMELPAR/tmp/lpar2rrd-daemon.pid"|sed 's/ //g'`
if [ ! "$PID"x = "x" ]; then
echo ""
echo "Stopping LPAR2RRD daemon"
kill `cat "$HOMELPAR/tmp/lpar2rrd-daemon.pid"` 2>/dev/null
fi
fi
run=`ps -ef|grep lpar2rrd-daemon.pl| egrep -v "grep |vi | vim "|wc -l`
if [ $run -gt 0 ]; then
# just to make sure ....
kill `ps -ef|grep lpar2rrd-daemon.pl| egrep -v "grep |vi | vim "|$AWK '{print $2}'` 2>/dev/null
fi
cd $HOMELPAR
if [ $os_aix -eq 0 ]; then
free=`df .|grep -iv filesystem|xargs|$AWK '{print $4}'`
freemb=`echo "$free/1048"|bc 2>/dev/null`
if [ $? -eq 0 -a ! "$freemb"x = "x" ]; then
if [ $freemb -lt 1048 ]; then
echo ""
echo "WARNING: free space in $HOMELPAR is too low : $freemb MB"
echo " note that 1 HMC needs about 1GB space depends on number of servers/lpars"
fi
fi
else
free=`df .|grep -iv filesystem|xargs|$AWK '{print $3}'`
freemb=`echo "$free/2048"|bc 2>/dev/null`
if [ $? -eq 0 -a ! "$freemb"x = "x" ]; then
if [ $freemb -lt 1048 ]; then
echo ""
echo "WARNING: free space in $HOMELPAR is too low : $freemb MB"
echo " note that 1 HMC needs about 1GB space depends on number of servers/lpars"
fi
fi
fi
if [ $VER_ORG -lt 401 ]; then
# fix of 4.00 where was limit for all memory agent related stored values 100GB
echo ""
echo "Fixing memory agent files (the bug in v4.00)"
find $HOMELPAR/data -name "mem.mmm" -exec $RRDTOOL tune {} --maximum in_use_work:102400000000 \; 2>&1 |grep -v "unknown data source"
find $HOMELPAR/data -name "mem.mmm" -exec $RRDTOOL tune {} --maximum in_use_clnt:102400000000 \; 2>&1 |grep -v "unknown data source"
find $HOMELPAR/data -name "mem.mmm" -exec $RRDTOOL tune {} --maximum size:102400000000 \; 2>&1 |grep -v "unknown data source"
find $HOMELPAR/data -name "mem.mmm" -exec $RRDTOOL tune {} --maximum nuse:102400000000 \; 2>&1 |grep -v "unknown data source"
find $HOMELPAR/data -name "mem.mmm" -exec $RRDTOOL tune {} --maximum free:102400000000 \; 2>&1 |grep -v "unknown data source"
find $HOMELPAR/data -name "mem.mmm" -exec $RRDTOOL tune {} --maximum pin:102400000000 \; 2>&1 |grep -v "unknown data source"
fi
if [ $VER_ORG -lt 481 ]; then
# there was a too low limit for LAN/SEA/SAN maximums
echo ""
echo "Fixing max on OS agent files, it can take a minute"
echo "SEA is running"
find $HOMELPAR/data -name "sea-*.mmm" -exec $RRDTOOL tune {} --maximum recv_bytes:12500000000 --maximum trans_bytes:12500000000 --maximum recv_packets:12500000 --maximum trans_packets:12500000 \; 2>&1
echo "SAN is running"
find $HOMELPAR/data -name "san-fcs*.mmm" -exec $RRDTOOL tune {} --maximum recv_bytes:12800000000 --maximum trans_bytes:12800000000 --maximum iops_in:12500000 --maximum iops_out:12500000 \; 2>&1
echo "LAN is running"
find $HOMELPAR/data -name "lan-*.mmm" -exec $RRDTOOL tune {} --maximum recv_bytes:12500000000 --maximum trans_bytes:12500000000 --maximum recv_packets:12500000 --maximum trans_packets:12500000 \; 2>&1
echo "end of the data fix"
fi
use_agent=`find $HOMELPAR/data -name "*.mmm"|wc -l`
use_agent=`find $HOMELPAR/data -name "*.mmm"|wc -l`
# append OS agent info into rperf_user.txt
if [ -f "$HOMELPAR/etc/rperf_user.txt" -a `egrep "When you use OS agent" $HOMELPAR/etc/rperf_user.txt 2>/dev/null|wc -l` -eq 0 ]; then
cat << END >> $HOMELPAR/etc/rperf_user.txt
#
# When you use OS agent feature (V4.00+) on at least of one LPAR per each server/frame then
# you do not need to use this file, CPU frequency is passed from the agents
#
END
fi
# beta popup forcing on demo.lpar2rrd.com
#if [ `hostname` = "demo" ]; then
# echo "export DEMO=1" >> "$HOMELPAR/etc/lpar2rrd.cfg"
#fi
# setting up the font dir (necessary for 1.3 on AIX)
FN_PATH="
/opt/freeware/share/fonts/dejavu
"
if [ ! -f "$HOME/.config/fontconfig/.fonts.conf" -o `grep -i deja "$HOME/.config/fontconfig/.fonts.conf" 2>/dev/null|wc -l` -eq 0 ]; then
if [ ! -d "$HOME/.config" ]; then
mkdir "$HOME/.config"
fi
if [ ! -d "$HOME/.config/fontconfig" ]; then
mkdir "$HOME/.config/fontconfig"
fi
echo $FN_PATH > "$HOME/.config/fontconfig/.fonts.conf"
fi
chmod 644 "$HOME/.config/fontconfig/.fonts.conf"
# no, no, it issues this error:
# Fontconfig warning: "/opt/freeware/etc/fonts/conf.d/50-user.conf", line 9: reading configurations from ~/.fonts.conf is deprecated.
#if [ ! -f "$HOME/.fonts.conf" ]; then
# echo $FN_PATH > "$HOME/.fonts.conf"
# chmod 644 "$HOME/.fonts.conf"
#fi
# for web server user home
if [ ! -d "$HOMELPAR/tmp/home" ]; then
mkdir "$HOMELPAR/tmp/home"
fi
#if [ ! -f "$HOMELPAR/tmp/home/.fonts.conf" ]; then
# echo $FN_PATH > "$HOMELPAR/tmp/home/.fonts.conf"
#fi
if [ ! -d "$HOMELPAR/tmp/home/.config" ]; then
mkdir "$HOMELPAR/tmp/home/.config" 2>/dev/null
if [ ! $? -eq 0 ]; then
# Once we saw tmp/home dir created and under apache user what is wrong, it is a workaround
mv "$HOMELPAR/tmp/home" "$HOMELPAR/tmp/home.$$"
mkdir "$HOMELPAR/tmp/home/"
mkdir "$HOMELPAR/tmp/home/.config"
fi
fi
if [ ! -d "$HOMELPAR/tmp/home/.config/fontconfig" ]; then
mkdir "$HOMELPAR/tmp/home/.config/fontconfig"
fi
if [ ! -f "$HOMELPAR/tmp/home/.config/fontconfig/fonts.conf" ]; then
echo $FN_PATH > "$HOMELPAR/tmp/home/.config/fontconfig/fonts.conf"
fi
chmod 755 "$HOMELPAR/tmp/home"
chmod 755 "$HOMELPAR/tmp/home/.config"
chmod 755 "$HOMELPAR/tmp/home/.config/fontconfig"
chmod 644 "$HOMELPAR/tmp/home/.config/fontconfig/fonts.conf"
# remove new fencybox, we use the older open GNU licensed now:
rm -f $HOMELPAR/html/jquery/jquery.fancybox.pack.js
# Checking installed Perl modules
cd $HOMELPAR
. etc/lpar2rrd.cfg; $PERL bin/perl_modules_check.pl $PERL
echo ""
cd - >/dev/null
if [ ! -f "$HOMELPAR/bin/premium.pl" -a -f "$HOMELPAR/etc/rperf_table.txt" ]; then
# remove rperf_table.txt in free version if there already is, leave only free_rperf_table.txt there
rm -f $HOMELPAR/etc/rperf_table.txt
fi
if [ $use_agent -eq 0 ]; then
# if [ $VER_ORG -lt 480 -a $use_agent -gt 0 ]; then
#echo ""
#echo "Upgrade the OS agent to get additional OS metrics, NMON support and HMC monitoring"
#echo "http://www.lpar2rrd.com/agent.htm"
#echo "http://www.lpar2rrd.com/nmon.htm"
#echo "http://www.lpar2rrd.com/hmc_monitoring.htm"
#echo " or always the latest one here: http://www.lpar2rrd.com/agent-relnotes.htm"
#else
echo "Consider to install the OS agent if you want get more OS metrics like memory usage/LAN/SAN/paging ..."
echo "http://www.lpar2rrd.com/agent.htm"
fi
# RRDTool version checking for graph zooming
rrd=`echo $RRD|sed 's/\\\//g'`
$rrd|grep graphv >/dev/null 2>&1
if [ $? -eq 1 ]; then
# suggest RRDTool upgrade
echo ""
rrd_version=`$rrd -v|head -1|$AWK '{print $2}'`
echo "Condider RRDtool upgrade to version 1.3.5+ (actual one is $rrd_version)"
echo "This will allow graph zooming: http://www.lpar2rrd.com/zoom.html"
echo ""
fi
if [ $os_linux -gt 0 ]; then
# LinuxSE warning
SELINUX=`ps -ef | grep -i selinux| grep -v grep|wc -l`
if [ "$SELINUX" -gt 0 ]; then
GETENFORCE=`getenforce 2>/dev/null`
if [ "$GETENFORCE" = "Enforcing" ]; then
echo ""
echo "Warning!!!!!"
echo "SELINUX status is Enforcing, it might cause problem during Apache setup"
echo "like this in Apache error_log: (13)Permission denied: access to /XXXX denied"
echo ""
fi
fi
fi
# VMware
# following for compatability purposes of old beta releases
if [ ! -d "$HOMELPAR/.vmware" ]; then
if [ -d "$HOME/.vmware" ]; then
mv $HOME/.vmware $HOMELPAR/
else
mkdir $HOMELPAR/.vmware
chmod 755 $HOMELPAR/.vmware
fi
fi
if [ ! -d "$HOMELPAR/.vmware/credstore" ]; then
if [ -d "$HOME/.vmware/credstore" ]; then
mv $HOME/.vmware/credstore $HOMELPAR/.vmware/
else
mkdir $HOMELPAR/.vmware/credstore
fi
fi
if [ ! -d "$HOMELPAR/vmware-lib" -a -d "$HOME/vmware-lib" ]; then
# only for compatability purposes with early beta VMware programm
mv $HOME/vmware-lib $HOMELPAR/
fi
if [ -f "$HOMELPAR/etc/.magic" ]; then
. $HOMELPAR/etc/.magic
fi
if [ "$VM_IMAGE"x = "x" ]; then
# not image, adjust rights (on image web server is running under lpar2rrd so not rights issue)
if [ -d $HOMELPAR/.vmware/credstore ]; then
chmod 777 $HOMELPAR/.vmware/credstore # must be 777 to allow writes of Apache user
if [ -f "$HOMELPAR/.vmware/credstore/vicredentials.xml" ]; then
chmod 666 $HOMELPAR/.vmware/credstore/vicredentials.xml 2>/dev/null # must be 666 to allow writes of Apache user
fi
fi
fi
# do that before ./bin/check_rrdtool.sh to can interupt it
if [ ! "$version_new"x = "x" ]; then
date=`date "+%Y-%m-%d_%H:%M"`
echo "$version_new $date" >> $HOMELPAR/etc/version.txt
fi
echo "$HOMELPAR" > $HOME/.lpar2rrd_home 2>/dev/null
if [ -f "$HOMELPAR/bin/load.sh" ]; then
# load.sh apeard since some version in bin dir what is wrong and it confuses people
rm -f "$HOMELPAR/bin/load.sh"
fi
# CPU ready
# do not use CPU ready data since 4.96, they are wrong, make timestamp
if [ $VER_ORG -lt 496 ]; then
if [ -d "$HOMELPAR/data/vmware_VMs" ]; then
if [ ! -f "$HOMELPAR/data/vmware_VMs/CPU_ready_time.txt" ]; then
date "+%s" > "$HOMELPAR/data/vmware_VMs/CPU_ready_time.txt"
fi
fi
fi
rm -f $HOMELPAR/www/heatmap-*html $HOMELPAR/html/heatmap-*html
rm -f $HOMELPAR/www/heatmap-*html $HOMELPAR/html/heatmap-*html
# remove old JSON, very old one might cause a problem, actually it is distributed in lib
rm -f $HOMELPAR/bin/JSON*pm
# Apache authorization
cat << END > $HOMELPAR/html/.htaccess
SetEnv XORUX_ACCESS_CONTROL 1
AuthUserFile $HOMELPAR/etc/web_config/htusers.cfg
AuthName "Authorized personnel only."
AuthType Basic
Require valid-user
END
# WEB GUI cleaning
rm -f $HOMELPAR/tmp/menu.cache $HOMELPAR/tmp/env.cache
rm -f $HOMELPAR/html/app.manifest $HOMELPAR/www/app.manifest $WEBDIR/app.manifest
if [ "$VM_IMAGE"x = "x" -a "$VI_IMAGE"x = "x" ]; then
# this is intended only for image env, making changes for ACL in httpd.conf
rm -f $HOMELPAR/bin/acl_enable.sh
fi
# fix for perl 5.26+ in VMware API
if [ -f $HOMELPAR/vmware-lib/URI/Escape.pm ]; then
perl -pi $HOMELPAR/bin/URI_Escape_patch.pl $HOMELPAR/vmware-lib/URI/Escape.pm
fi
crontab_tmp="/tmp/crontab.$$"
crontab -l > $crontab_tmp
if [ ! "$VM_IMAGE"x = "x" ]; then
if [ $VM_IMAGE -eq 1 ]; then
grep "load_hmc_rest_api.sh" $crontab_tmp >/dev/null 2>&1
if [ ! $? -eq 0 ]; then
echo "" >> $crontab_tmp
echo "# IBM Power Systems - REST API" >> $crontab_tmp
echo "0,20,40 * * * * $HOMELPAR/load_hmc_rest_api.sh > $HOMELPAR/load_hmc_rest_api.out 2>&1" >> $crontab_tmp
fi
# MS Hyper-V
grep "load_hyperv.sh" $crontab_tmp >/dev/null 2>&1
if [ ! $? -eq 0 ]; then
echo "" >> $crontab_tmp
echo "# MS Hyper-V support " >> $crontab_tmp
echo "0,20,40 * * * * $HOMELPAR/load_hyperv.sh > $HOMELPAR/load_hyperv.out 2>&1 " >> $crontab_tmp
fi
# XEN
grep "load_xenserver.sh" $crontab_tmp >/dev/null 2>&1
if [ ! $? -eq 0 ]; then
echo "" >> $crontab_tmp
echo "# XEN Server support " >> $crontab_tmp
echo "0,20,40 * * * * $HOMELPAR/load_xenserver.sh > $HOMELPAR/load_xenserver.out 2>&1 " >> $crontab_tmp
fi
grep "load_ovirt.sh" $crontab_tmp >/dev/null 2>&1
if [ ! $? -eq 0 ]; then
echo "" >> $crontab_tmp
echo "# oVirt / RHV Server support " >> $crontab_tmp
echo "0,20,40 * * * * $HOMELPAR/load_ovirt.sh > $HOMELPAR/load_ovirt.out 2>&1 " >> $crontab_tmp
fi
if [ -s $crontab_tmp ]; then
crontab < $crontab_tmp
else
echo "ERROR: crontab has not been updated, perhaps not enough space in /tmp, Hyper-V, XEN, oVirt / RHV and IBM Power REST API support miss in crontab"
echo ""
fi
fi
else
# Non image environment
# IBM Power
# first check if HMC is used (mean IBM Power is configured), if so then place crontab automatically
for hmc in $HMC_LIST
do
if [ `ls -ld data/*/$hmc 2>/dev/null| wc -l | sed 's/ //g'` -gt 0 ]; then
# HMC is configured and used, go ahead!
if [ `grep load.sh $crontab_tmp| sed 's/#.*$//g'| grep "$HOMELPAR"| wc -l | sed 's/ //g'| wc -l` -gt 0 ]; then
# musi tam uz byt i load.sh jinak nic nedelat
if [ `grep load_hmc_rest_api.sh $crontab_tmp| sed 's/#.*$//g'| grep "$HOMELPAR"| wc -l | sed 's/ //g'| wc -l` -eq 0 ]; then
# add it
echo "" >> $crontab_tmp
echo "# IBM Power Systems - REST API" >> $crontab_tmp
echo "0,20,40 * * * * $HOMELPAR/load_hmc_rest_api.sh > $HOMELPAR/load_hmc_rest_api.out 2>&1" >> $crontab_tmp
if [ -s $crontab_tmp ]; then
crontab < $crontab_tmp
crontab -l > $crontab_tmp
else
echo "ERROR: crontab has not been updated, perhaps not enough space in /tmp, IBM Power REST API misses in entry in crontab"
echo ""
fi
break
fi
fi
fi
done
# MS Hyper-V
grep "load_hyperv.sh" $crontab_tmp >/dev/null 2>&1
if [ ! $? -eq 0 ]; then
echo "" >> $crontab_tmp
echo "# MS Hyper-V support " >> $crontab_tmp
echo "0,20,40 * * * * $HOMELPAR/load_hyperv.sh > $HOMELPAR/load_hyperv.out 2>&1 " >> $crontab_tmp
if [ -s $crontab_tmp ]; then
crontab < $crontab_tmp
else
echo "ERROR: crontab has not been updated, perhaps not enough space in /tmp, Hyper-V support misses in crontab"
echo ""
fi
fi
# XEN
grep "load_xenserver.sh" $crontab_tmp >/dev/null 2>&1
if [ ! $? -eq 0 ]; then
echo "" >> $crontab_tmp
echo "# XEN Server support " >> $crontab_tmp
echo "0,20,40 * * * * $HOMELPAR/load_xenserver.sh > $HOMELPAR/load_xenserver.out 2>&1 " >> $crontab_tmp
if [ -s $crontab_tmp ]; then
crontab < $crontab_tmp
else
echo "ERROR: crontab has not been updated, perhaps not enough space in /tmp, XEN Server support misses in crontab"
echo ""
fi
fi
# oVirt
grep "load_ovirt.sh" $crontab_tmp >/dev/null 2>&1
if [ ! $? -eq 0 ]; then
echo "" >> $crontab_tmp
echo "# oVirt / RHV support " >> $crontab_tmp
echo "0,20,40 * * * * $HOMELPAR/load_ovirt.sh > $HOMELPAR/load_ovirt.out 2>&1 " >> $crontab_tmp
if [ -s $crontab_tmp ]; then
crontab < $crontab_tmp
else
echo "ERROR: crontab has not been updated, perhaps not enough space in /tmp, oVirt / RHV support misses in crontab"
echo ""
fi
fi
fi
rm -f $crontab_tmp
# Hyper-V: fix of an error when was placed in crontab this wrong path (in 6.00):
# 0,20,40 * * * * $HOMELPAR/lpar2rrd/load_hyperv.sh > $HOMELPAR/load_hyperv.out 2>&1 "
#
if [ `crontab -l| egrep "$HOMELPAR/lpar2rrd/load_hyperv.sh " | wc -l | sed 's/ //g'` -gt 0 ]; then
crontab -l | egrep -v "$HOMELPAR/lpar2rrd/load_hyperv.sh|Hyper-V" > $crontab_tmp
echo "" >> $crontab_tmp
echo "# MS Hyper-V support " >> $crontab_tmp
echo "0,20,40 * * * * $HOMELPAR/load_hyperv.sh > $HOMELPAR/load_hyperv.out 2>&1 " >> $crontab_tmp
crontab < $crontab_tmp
rm -f $crontab_tmp
fi
cron_all=`crontab -l 2>/dev/null| egrep "\/load.sh|\/load_.*sh " | grep lpar2rrd | egrep -v "#"|sed -e 's/ >.*//g' -e 's/^.*\* //g'| wc -l`
cron_uniq=`crontab -l 2>/dev/null| egrep "\/load.sh|\/load_.*sh " | grep lpar2rrd | egrep -v "#"|sed -e 's/ >.*//g' -e 's/^.*\* //g' |sort|uniq|wc -l`
if [ $cron_all -gt $cron_uniq ]; then
echo "ERROR: You have probably duplicated rows in crontab, check it manually via: crontab -e:"
echo "=========="
crontab -l 2>/dev/null| egrep "\/load.sh|\/load_.*sh " | grep lpar2rrd | egrep -v "#"|sed -e 's/ >.*//g' -e 's/^.*\* //g'| sort
echo "=========="
echo ""
fi
if [ $os_aix -eq 1 ]; then
# AIX (at least) rrdtool 1.7 issue when prints mem profiling info to pwd/mon.out
touch $HOMELPAR/lpar2rrd-cgi/mon.out
chmod 777 $HOMELPAR/lpar2rrd-cgi/mon.out
touch $HOMELPAR/bin/mon.out
chmod 777 $HOMELPAR/bin/mon.out
# refresh font caching
fc-cache -fv >/dev/null 2>&1
fi
# lpar2rrd v5.08-6+ (new Solaris implementation uses that as a directory)
if [ -h "$HOMELPAR/data/Solaris" ]; then
rm -f "$HOMELPAR/data/Solaris"
fi
# remove menu cache files if they exist
rm -f $HOMELPAR/tmp/env.cache $HOMELPAR/tmp/menu.cache
# clean out from old programs
rm -f $HOMELPAR/scripts/update_cfg_alert.sh $HOMELPAR/scripts/update_cfg_custom-groups.sh $HOMELPAR/scripts/update_cfg_custom-groups.sh_pre_4.70 $HOMELPAR/scripts/update.sh $HOMELPAR/bin/qs_volume.pl
rm -f $HOMELPAR/bin/hyperv_cmd.pl $HOMELPAR/bin/hyperv_load.pl $HOMELPAR/bin/check_stor2rrd $HOMELPAR/bin/alrt_ext.pl $HOMELPAR/bin/AlertStor2rrd.pm
echo ""
echo "Upgrade to version $version_new is done"
echo "Now you can start the tool:"
echo ""
echo " cd $HOMELPAR"
echo " ./load.sh | tee logs/load.out-initial"
echo ""
echo "Wait for finishing of that, then refresh the GUI (Ctrl-F5)"
echo ""
if [ "$VM_IMAGE"x = "x" -a $check -eq 1 -a $VER_ORG -lt 480 ]; then
# not for image so far, it might be too slow
echo ""
echo "Checking consistency of all RRDtool DB files, it might take a few minutes in a big environment"
echo "You can leave it running or interupt it by Ctrl-C and start it whenever later on"
echo " just check out the results when it finishes"
echo "cd $HOMELPAR; ./bin/check_rrdtool.sh silent"
cd $HOMELPAR
./bin/check_rrdtool.sh silent
cd - >/dev/null
fi
lpar2rrd-6.02/Copyright.txt 0000664 0001750 0001750 00000062077 13442733703 015554 0 ustar pahampl pahampl Copyright (C) 2007-2012 Pavel Hampl. All rights reserved.
Distributed under the terms of the GNU General Public License v3
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Copyright (C)
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
.
lpar2rrd-6.02/lpar2rrd.tar.Z 0000664 0001750 0001750 00014354243 13442733703 015517 0 ustar pahampl pahampl d̡*\ȰÇ#"Aƍ5 TFkxH$3hАqcƌ0fhF @dȳϟ@# p
.mիXjh/挑9UKcƍ?9dɓ)W|sK9wL8P:D"UԩVL_ %km8d)e3_̄s\AsYkoAƅ+Rn۔2QdL2ېcP'>
c֡k/Ĥqbl#Ѓ-@SL< Db<6IoL1b:i BdWc ЁFn(`Tnء.!0b'hQct e iTcF~!eiBcQGD_oȑW1keGkWן 0ER DdeHcxT }
HUntgoGQg&/< D>LzIx,.Ȯi+%z%!kadLtf.}qBDf^QGcc( K@5&bnzpHE
E8PZaQ$bjIdsAU:'.k1}%` x
;{E
mi"fV7=oF9ROv# !Pz/%euS A]IZDh}*d2eMTbʐ&KIDYɃG6mjk*g;ܱ
O^pfmbJGJrd6x
D%FVKWG|
a***!_[ӓlA4j@ = Q:{4I&,
K2hbu%1|1#?-[P⠐(_CdaAXƈ%8\uW* Ȱ \Uw`Ưir@9LV[>L
]1-l2O.
9