Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated agent installer to actually work for 32bit #171

Merged
merged 5 commits into from
Jun 21, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions amon/templates/install/agent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@ function add_repos(){

printf "\033[92m\n* Adding Repositories ...\n\033[0m\n"

if [ $DISTRO == 'debian' ]; then
if [ "$DISTRO" == "debian" ]; then

$sudo_cmd sh -c "echo 'deb http://packages.amon.cx/repo amon contrib' > /etc/apt/sources.list.d/amonagent.list"
$sudo_cmd apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv AD53961F

# Update once
$sudo_cmd apt-get update

elif [ $DISTRO == 'rpm' ]; then
elif [ "$DISTRO" == "rpm" ]; then
$sudo_cmd sh -c "echo -e '[amon]\nname = Amon.\nbaseurl = http://packages.amon.cx/rpm/\nenabled=1\ngpgcheck=0\npriority=1' > /etc/yum.repos.d/amon.repo"
$sudo_cmd yum install -y epel-release

Expand All @@ -99,16 +99,22 @@ function add_repos(){
function install_agent() {

# Install the necessary package sources
if [ $DISTRO == 'rpm' ]; then
if [ "$DISTRO" == "rpm" ]; then
printf "\033[92m* Installing the Amon Agent package for RPM distros\n\033[0m\n"

$sudo_cmd yum -y install amonagent

elif [ $DISTRO == 'debian' ]; then
elif [ "$DISTRO" == "debian" ] && ([ "$ARCHITECTURE" == "x86_64" ] || [ "$ARCHITECTURE" == "i686" ]); then
printf "\033[92m\n* Installing the Amon Agent package for Debian distros\n\033[0m\n"

$sudo_cmd apt-get install -y --force-yes amonagent

#Added in reply to https://github.com/amonapp/amon/issues/170
ARCHITECTURE=`uname -m`

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is there a check above for the ARCHITECTURE yet it isn't set until here?

This is causing installs to not work at all.

if [ "$ARCHITECTURE" == "i686" ] ; then
sed -i "s/\/usr\/bin\/amonagent/\/usr\/bin\/amonagent32/" /etc/systemd/system/amonagent.service
fi

else
printf "\033[31mYour OS or distribution are not supported by this install script.
Please follow the instructions on the Agent setup page:
Expand Down Expand Up @@ -147,7 +153,7 @@ printf "\033[32m All done.

----------------------------------

The binary for the agent is located in /usr/local/bin/amonagent
The binary for the agent is located in /usr/local/bin/amonagent or /usr/bin/amonagent

Run:

Expand Down