Skip to content

Commit

Permalink
Healthcheck Implementation (#16)
Browse files Browse the repository at this point in the history
1. New health command
2. SMD sync healthcheck
3. Feature for Collectinfo should dump data in both JSON and multiple snapshot in single collectinfo request.
4. Create new library for collectinfo parser
5. Separate out log-analyzer and collectinfo-analyzer as two different modes on operations of asadm.
  • Loading branch information
hbpatre authored and citrusraj committed Mar 14, 2017
1 parent 907deab commit e87cc69
Show file tree
Hide file tree
Showing 85 changed files with 19,199 additions and 9,506 deletions.
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,29 @@ Start the tool with *asadm* and run the *help* command to get started.
## Installing Aerospike Admin
```
sudo ./asadm-deps/install.sh
make
sudo make
sudo make install
```

## Running Aerospike Admin in Cluster Mode
## Running Aerospike Admin in Live Cluster Mode.
asadm -h <Aerospike Server Address>
Admin> help

## Running Aerospike Admin in Log-analyser Mode
## Running Aerospike Admin in Log-analyser Mode.
asadm -l [-f <location of logs>]
Admin> help

## Running Aerospike Admin in Collectinfo Mode.
asadm -c [-f <location of collectinfo>]
Admin> help


## Dependencies
- python 2.6+ (< 3)

### Python Modules
- ply: >= 3.4
- pexpect: >= 3.0
- pyOpenSSL: 16.2.0

### Installing Python Module Dependencies
Expand Down
69 changes: 69 additions & 0 deletions asadm-deps/deb/python-pexpect/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#!/usr/bin/env bash
################################################################################

PYMODULE=pexpect

PACKAGE=python-pexpect

################################################################################

command_exists () {
type "$1" &> /dev/null ;
}

################################################################################

if [ $EUID -ne 0 ]; then
echo "This script requires root or sudo privileges."
exit 1
fi

python <<EOF
try:
import ${PYMODULE}
print "pexpect already installed on this machine"
import sys
sys.exit(0)
except Exception as e:
import sys
sys.exit(1)
EOF
has_pymodule=$?

if [ $has_pymodule -eq 0 ]; then
exit 0
fi

if [ -f /etc/os-release ]; then
. /etc/os-release
fi

distro_id=${ID,,}
distro_version=${VERSION_ID}

case "$distro_id:$distro_version" in
'debian:8' | 'ubuntu:'* )
echo Installing ${PACKAGE}
apt-get install -y ${PACKAGE}
;;
* )
if ! command_exists pip ; then
echo Installing python-dev
apt-get install -y python-dev

echo Installing python-setuptools
apt-get install -y python-setuptools

echo Installing pip
easy_install pip

if ! command_exists pip ; then
echo "Error while installing pip. Please install pip and run this installation again."
exit 1
fi
fi

echo Installing ${PYMODULE}
pip install ${PYMODULE}
;;
esac
71 changes: 71 additions & 0 deletions asadm-deps/deb/python-ply/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#!/usr/bin/env bash
################################################################################

PYMODULE=ply

PACKAGE=python-ply

################################################################################

command_exists () {
type "$1" &> /dev/null ;
}

################################################################################

if [ $EUID -ne 0 ]; then
echo "This script requires root or sudo privileges."
exit 1
fi

DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )

python <<EOF
try:
import ${PYMODULE}
print "ply already installed on this machine"
import sys
sys.exit(0)
except Exception as e:
import sys
sys.exit(1)
EOF
has_pymodule=$?

if [ $has_pymodule -eq 0 ]; then
exit 0
fi

if [ -f /etc/os-release ]; then
. /etc/os-release
fi

distro_id=${ID,,}
distro_version=${VERSION_ID}

case "$distro_id:$distro_version" in
'debian:8' | 'ubuntu:'* )
echo Installing ${PACKAGE}
apt-get install -y ${PACKAGE}
;;
* )
if ! command_exists pip ; then
echo Installing python-dev
apt-get install -y python-dev

echo Installing python-setuptools
apt-get install -y python-setuptools

echo Installing pip
easy_install pip

if ! command_exists pip ; then
echo "Error while installing pip. Please install pip and run this installation again."
exit 1
fi
fi

echo Installing ${PYMODULE}
pip install ${PYMODULE}
;;
esac
45 changes: 45 additions & 0 deletions asadm-deps/mac/python-pexpect/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/usr/bin/env bash
################################################################################

PYMODULE=pexpect

################################################################################

command_exists () {
type "$1" &> /dev/null ;
}

################################################################################

if [ $EUID -ne 0 ]; then
echo "This script requires root or sudo privileges."
exit 1
fi

python <<EOF
try:
import ${PYMODULE}
print "pexpect already installed on this machine"
import sys
sys.exit(0)
except Exception as e:
import sys
sys.exit(1)
EOF
has_pymodule=$?

if [ $has_pymodule -eq 0 ]; then
exit 0
fi

if ! command_exists pip ; then
echo Installing pip
easy_install pip

if ! command_exists pip ; then
echo "Error while installing pip. Please install pip and run this installation again."
exit 1
fi
fi
echo Installing ${PYMODULE}
pip install ${PYMODULE}
45 changes: 45 additions & 0 deletions asadm-deps/mac/python-ply/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/usr/bin/env bash
################################################################################

PYMODULE=ply

################################################################################

command_exists () {
type "$1" &> /dev/null ;
}

################################################################################

if [ $EUID -ne 0 ]; then
echo "This script requires root or sudo privileges."
exit 1
fi

python <<EOF
try:
import ${PYMODULE}
print "ply already installed on this machine"
import sys
sys.exit(0)
except Exception as e:
import sys
sys.exit(1)
EOF
has_pymodule=$?

if [ $has_pymodule -eq 0 ]; then
exit 0
fi

if ! command_exists pip ; then
echo Installing pip
easy_install pip

if ! command_exists pip ; then
echo "Error while installing pip. Please install pip and run this installation again."
exit 1
fi
fi
echo Installing ${PYMODULE}
pip install ${PYMODULE}
56 changes: 56 additions & 0 deletions asadm-deps/rpm/python-pexpect/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/usr/bin/env bash
################################################################################

PYMODULE=pexpect

################################################################################

command_exists () {
type "$1" &> /dev/null ;
}

################################################################################

if [ $EUID -ne 0 ]; then
echo "This script requires root or sudo privileges."
exit 1
fi

python <<EOF
try:
import ${PYMODULE}
print "pexpect already installed on this machine"
import sys
sys.exit(0)
except Exception as e:
import sys
sys.exit(1)
EOF
has_pymodule=$?

if [ $has_pymodule -eq 0 ]; then
exit 0
fi

pip_command="pip"
if ! command_exists ${pip_command} ; then
echo Installing epel-release
yum install epel-release

echo Installing pip
yum install -y python-pip

if ! command_exists ${pip_command} ; then
if command_exists pip-python ; then
pip_command="pip-python"
elif command_exists python-pip ; then
pip_command="python-pip"
fi
fi
if ! command_exists ${pip_command} ; then
echo "Error while installing pip. Please install pip and run this installation again."
exit 1
fi
fi
echo Installing ${PYMODULE}
${pip_command} install ${PYMODULE}
56 changes: 56 additions & 0 deletions asadm-deps/rpm/python-ply/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/usr/bin/env bash
################################################################################

PYMODULE=ply

################################################################################

command_exists () {
type "$1" &> /dev/null ;
}

################################################################################

if [ $EUID -ne 0 ]; then
echo "This script requires root or sudo privileges."
exit 1
fi

python <<EOF
try:
import ${PYMODULE}
print "ply already installed on this machine"
import sys
sys.exit(0)
except Exception as e:
import sys
sys.exit(1)
EOF
has_pymodule=$?

if [ $has_pymodule -eq 0 ]; then
exit 0
fi

pip_command="pip"
if ! command_exists ${pip_command} ; then
echo Installing epel-release
yum install epel-release

echo Installing pip
yum install -y python-pip

if ! command_exists ${pip_command} ; then
if command_exists pip-python ; then
pip_command="pip-python"
elif command_exists python-pip ; then
pip_command="python-pip"
fi
fi
if ! command_exists ${pip_command} ; then
echo "Error while installing pip. Please install pip and run this installation again."
exit 1
fi
fi
echo Installing ${PYMODULE}
${pip_command} install ${PYMODULE}
Loading

0 comments on commit e87cc69

Please sign in to comment.