Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-41

Zabbix Agent RPM (Completed)

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Won't fix
    • Icon: Major Major
    • 1.4.3
    • 1.4.3
    • None
    • None

      heres an updated one for 1.4.2

      I didn't modify any of the files in the zabbix-1.4.2.tar.gz.

      You just need to do a rpmbuild -ba /path/to/zabbix.spec

      built on a centos 5 machine with all yum updates applied. Has been compiled and then tested on fedora core 7 and centos 4. Statically linked libs probably make this rpm a little more versatile.

      Make sure you change the variables to suit your own purposes

      and change the server name! once you do a rpm -i /path/to/zabbix_agentd-1.4.2-1.i386.rpm it will install the zabbix agent, start the service and do a service zabbix_agentd status as well. For quick deployment, try to have everything configured before building.

      Code:

      %define debug_package %

      {nil}

      Name: zabbix_agentd Version: 1.4.2 Release: 1 Group: System Environment/Daemons License: GPL Summary: ZABBIX network monitor agent Vendor: ZABBIX SIA URL: http://www.zabbix.org Packager: Sol Tutaki <[email protected]> Source: %

      {name}%{version}%{release}.tar.gz Autoreq: no Buildroot: %{_tmppath}/%{name}

      -%

      {version}%{release}-buildroot Prefix: /opt/zabbix Requires: sed Requires(post): chkconfig, initscripts Requires(preun): chkconfig, initscripts Requires(postun): initscripts %define zabbix_bindir %{prefix}/bin %define zabbix_confdir %{prefix}/etc %define zabbix_initdir /etc/init.d %define zabbix_docdir /usr/share/doc/%{name}%{version}

      -%

      {release}

      %define zabbix_piddir /var/tmp %define zabbix_logdir %

      {prefix}/log %define zabbix_server 127.0.0.1 %description The ZABBIX agent is a network monitor %prep %setup %build %configure --prefix=%{prefix}

      --enable-static --enable-agent make %clean rm -fr $RPM_BUILD_ROOT %pre # create ZABBIX group if [ -z "`grep zabbix /etc/group`" ]; then /usr/sbin/groupadd zabbix >/dev/null 2>&1 fi # create ZABBIX user if [ -z "`grep zabbix /etc/passwd`" ]; then /usr/sbin/useradd -g zabbix -c "Zabbix user account" -s /bin/false zabbix >/dev/null 2>&1 fi %install rm -fr $RPM_BUILD_ROOT # copy documentation install -d %

      {buildroot}%{zabbix_docdir} install -m 644 AUTHORS %{buildroot}

      %

      {zabbix_docdir}/AUTHORS install -m 644 COPYING %{buildroot}%{zabbix_docdir}

      /COPYING install -m 644 NEWS %

      {buildroot}%{zabbix_docdir}/NEWS install -m 644 README %{buildroot}

      %

      {zabbix_docdir}/README install -m 644 ChangeLog %{buildroot}%{zabbix_docdir}

      /ChangeLog # copy binaries install -d %

      {buildroot}%{zabbix_bindir} install -s -m 755 src/zabbix_agent/zabbix_agentd %{buildroot}

      %

      {zabbix_bindir}/zabbix_agentd # copy config files install -d %{buildroot}%{zabbix_confdir} install -m 755 misc/conf/zabbix_agentd.conf %{buildroot}%{zabbix_confdir}/zabbix_agentd.conf # copy startup script install -d %{buildroot}%{zabbix_initdir} install -m 755 misc/init.d/fedora/core5/zabbix_agentd %{buildroot}%{zabbix_initdir}/zabbix_agentd install -d %{buildroot}%{zabbix_logdir} %post # configure ZABBIX agent daemon %{__sed} -i -e "s#Hostname=localhost#Hostname=`uname -n`#g" \ -e "s#PidFile=/var/tmp/zabbix_agentd.pid#PidFile=%{zabbix_piddir}/zabbix_agentd.pid#g" \ -e "s#LogFile=/tmp/zabbix_agentd.log#LogFile=%{zabbix_logdir}/zabbix_agentd.log#g" \ -e "s#Timeout=3#Timeout=30#g" \ -e "s#127.0.0.1#%{zabbix_server}#g" \ %{zabbix_confdir}/zabbix_agentd.conf %{__sed} -i -e "s#/etc/zabbix/zabbix_agentd.conf#%{zabbix_confdir}/zabbix_agentd.conf#g" \ -e "s#/usr/bin/zabbix_agentd#%{zabbix_bindir}

      /zabbix_agentd#g" \ %

      {zabbix_initdir}/zabbix_agentd chkconfig --add zabbix_agentd chkconfig --levels 345 zabbix_agentd on if [ -z "`grep -i "Zabbix agent" /etc/services`" ]; then cat >>etc/services <<EOF zabbix_agentd 10050/tcp # Zabbix agent EOF fi service zabbix_agentd start service zabbix_agentd status %preun if [ -n "`/sbin/pidof zabbix_agentd`" ]; then service zabbix_agentd stop sleep 2 fi %postun rm -f %{zabbix_piddir}/zabbix_agentd.pid rm -f %{zabbix_logdir}/zabbix_agentd.log %files %dir %attr(0755,zabbix,zabbix) %{zabbix_docdir} %attr(0644,root,root) %{zabbix_docdir}/AUTHORS %attr(0644,root,root) %{zabbix_docdir}/COPYING %attr(0644,root,root) %{zabbix_docdir}/NEWS %attr(0644,root,root) %{zabbix_docdir}/README %attr(0644,root,root) %{zabbix_docdir}/ChangeLog %dir %attr(0755,zabbix,zabbix) %{zabbix_confdir} %attr(0644,zabbix,zabbix) %config(noreplace) %{zabbix_confdir}/zabbix_agentd.conf %dir %attr(0755,zabbix,zabbix) %{zabbix_bindir} %attr(0755,zabbix,zabbix) %{zabbix_bindir}/zabbix_agentd %attr(0755,root,root) %{zabbix_initdir}

      /zabbix_agentd %dir %attr(0755,zabbix,zabbix) %

      {zabbix_logdir}

      %changelog * Fri Aug 24 2007 Sol Tutaki <[email protected]> - 1.4.2-1 - Updated packaging to 1.4.2 (release 1) * Wed Oct 11 2006 Sol Tutaki <[email protected]> - 1.1.1-2 - Moved zabbix user check to pre install - Cleaned up directory structure * Wed Jul 19 2006 Alexey Zilber <[email protected]> - 1.1.1 - Updated packaging, cleaned up directory structure for - RedHat compatibility, added uninstall,build checks. * Thu Dec 01 2005 Eugene Grigorjev <[email protected]> - 1.1beta2 - initial packaging

      http://www.zabbix.com/forum/showthread.php?t=3920

            Unassigned Unassigned
            alexei Alexei Vladishev
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: