Ad Widget

Collapse

Installing Zabbix 2.2 on a redhad based system

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • louigi600
    Junior Member
    • Nov 2013
    • 6

    #1

    Installing Zabbix 2.2 on a redhad based system

    Although there is now a repository on repo.zabbix.com (set up by installing this package zabbix-release-2.2-1.el6.noarch.rpm) it's missing some dependencies that are not on the RedHat/CentOS repositories, but can be found on epel.
    Epel on the other hand, at the time of writing, lacks the zabbix 2.2 packages.

    Until all the required packages get into a repo this makes it a little troublesome to install anc upgrade zabbix.
    I've worked around this by creating a local repository with all that is neaded:

    Code:
    Z_VER=2.2
    PLATFORM=$(uname -m)
    case $PLATFORM in
     i?86) PLATFORM=i386;;
     x86_64|amd64) PLATFORM=x86_64;
    esac
    OS_REL=$(lsb_release -r | awk '{print $NF}')
    OS_REL_M=$(echo "$OS_REL" |awk -F. '{print $1}')
    OS_DIST=$(lsb_release -i | awk '{print tolower($NF)}')
    
    case $OS_DIST in
      centos*|redhat*) DISTRO_TYPE=rhel ;;
    esac
    
    REPO_NAME="Zabbix $Z_VER for $DISTRO_TYPE $OS_REL_M $PLATFORM based systems"
    mkdir -p /var/zabbix
    cd /var/zabbix
    rm -rf ./*
    wget -q -nd -r -l 1 -L -X '' -X ..,Parent\ Directory,index\*  http://repo.zabbix.com/zabbix/$Z_VER/$DISTRO_TYPE/$OS_REL_M/${PLATFORM}/
    EXTRA_PACKAGES=$(links -dump http://dl.fedoraproject.org/pub/epel/$OS_REL_M/$PLATFORM/ |grep -E "/iksemel|/fping" |awk '{printf("%s ",$NF)}')
    wget -q -nd -r -l 1 -L -X '' -X ..,Parent\ Directory,index\*  $EXTRA_PACKAGES
    rm -f index.html*
    createrepo -S --content "$REPO_NAME" --repo zabbix .
    
    cat << EOF > /etc/yum.repos.d/Zabbix.repo
    # Name: Zabbix RPM Repository
    # URL: http://repo.zabbix.com/zabbix/$Z_VER/$DISTRO_TYPE/$OS_REL_M/${PLATFORM}/
    [zabbix]
    name = $REPO_NAME
    baseurl=file:///var/zabbix
    gpgcheck=0
    enabled=1
    EOF
    I've tested this on a CentOS 6 and it works fine, it might need som editing for other redhat based distros.

    After running the above shell script you may simply install/upgrade zabbix with yum:

    Code:
    yum install zabbix-server-mysql zabbix-web-mysql

    Hope this is helpfull.
    Last edited by louigi600; 18-11-2013, 09:38.
Working...