-
Notifications
You must be signed in to change notification settings - Fork 16
/
installesmon.sh
58 lines (51 loc) · 1.61 KB
/
installesmon.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#! /bin/sh
# This script to prepare the installation
cd "$(dirname "$0")"
THIS_PATH=`pwd`
#install dependents packages
cd RPMS/rhel7
rpm -ivh python*.rpm
rpm -ivh libyaml*.rpm
rpm -ivh Py*.rpm
TMPDIR="/tmp/estmp_$RANDOM"
mkdir $TMPDIR
cd $THIS_PATH
cd python_library
for pylib in certifi-2017.7.27.1 pytz-2017.2 six-1.10.0 \
python-dateutil-2.6.1 urllib3-1.22 idna-2.6 \
chardet-3.0.4 requests-2.18.4 influxdb-4.1.1 \
Unidecode-0.04.21 python-slugify-1.2.4
do
cp $pylib.tar.gz $TMPDIR/
cd $TMPDIR
tar -xf $pylib.tar.gz
cd $pylib
python setup.py install
cd "$THIS_PATH"
cd python_library
done
#backup old settings
if [ -f /etc/esmon_install.conf ]
then
cp -f /etc/esmon_install.conf /etc/esmon_install.conf.bak
fi
yum -y remove esmon
cd "$THIS_PATH"
cd RPMS/rhel7
rpm -ivh esmon*.rpm
if [ $? -ne 0 ];then
echo "ESMON package install failed"
exit -1
fi
#restore old settings
if [ -f /etc/esmon_install.conf.bak ]
then
mv -f /etc/esmon_install.conf.bak /etc/esmon_install.conf
fi
echo "******************************************************************************"
echo "* ESMON package has been installed *"
echo "*Please set your servers' information into /etc/esmon.conf *"
echo "*And please make sure you can access all these server by ssh with keyfile *"
echo "*Please close server's firewall or open 3000 port for monitor system *"
echo "*Then please run esmon_install to continue *"
echo "******************************************************************************"