Ad Widget

Collapse

RedHat/Fedora zabbix.spec or init files??

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • welshpjw
    Member
    • Mar 2005
    • 50

    #1

    RedHat/Fedora zabbix.spec or init files??

    So, looks like the zabbix.spec files are entirely geared toward SUSE and someone is somewhat actively maintaining it. Does anyone have (and want to contribute) updated RedHat/Fedora working zabbix.spec or init files? I have hacked my way through both groups, but not in a way that will work for the SUSE peeps.

    The zabbix.spec, however has been left behind in the 1.1aplha6 version world as a hardcoded "version".

    Just as a note to all of you "rpmbuild -tb" RedHat/Fedora dorks (like me), I have had to
    1. extract the source
    2. fix the .spec (source,version, configure,pre,post sections)
    3. fix the init's
    4. re-tar
    5. rpmbuild -tb

    Still a couple of minor issues, however like with the .log and .pid files.

    Just looking for a better brain to have done these things "right" instead of the cr@p I put together
  • araw
    Member
    • May 2005
    • 31

    #2
    I'm working mostly with Fedora, so I'll put my .spec's and some other stuff up tomorrow. Can't say they're not "cr@p", but they work

    Comment

    • Alexei
      Founder, CEO
      Zabbix Certified Trainer
      Zabbix Certified SpecialistZabbix Certified Professional
      • Sep 2004
      • 5654

      #3
      Support for automake, etc

      By the way, is anyone here with good automake/autoconf experience? I'd need a hand with automake scripts, I have no good understanding how it works.

      Many thanks.
      Alexei Vladishev
      Creator of Zabbix, Product manager
      New York | Tokyo | Riga
      My Twitter

      Comment

      • welshpjw
        Member
        • Mar 2005
        • 50

        #4
        Alexei: Sorry I'm not a programmer and I don't play one on TV . I would be useless without Google for most of the compiling problems I have, so I would not be a any help with automake/autoconf.

        araw: I look forward to your info/input! I'm sure it't better than what I have done to the .spec and init files...

        Comment

        • xaeth
          Member
          • Nov 2004
          • 67

          #5
          well i was looking for init scripts that work with chkconfig today, and ended up composing these 2 scripts that can be found here. Mind you they have only been tested on rhel4 (i'll probably check rhel3 next week, and probably core3 and 4 as well). This is my first time writing them, but i played with them a bit and they seem to be fully functional, and look/behave like many of the native init scripts, or atleast that was the goal.

          -xaeth

          Comment

          • welshpjw
            Member
            • Mar 2005
            • 50

            #6
            Cool! Thank you very much! I too like to use chkconfig when I have no provided .spec files.

            Comment

            • greypanda
              Junior Member
              • Jul 2005
              • 1

              #7
              Init Scripts

              I have been out of the Zabbix club for a couple of years. I see that my Redhat 8.0 init scripts are still in the misc directory. I'll see if I can get them updated to Fedora 4 in the next couple of weeks. I have used them on Fedora by just changing the "sucker" to "server".

              John Crunk

              Comment

              • xaeth
                Member
                • Nov 2004
                • 67

                #8
                i had the qmail and mysql monitors stop working on my boxes (twice and once respectively), and zabbix had a huge amount of bindings in the TIME_WAIT state, so it took killing the application and leaving it down to get everything back up, but the startup script didn't accomidate for port already bound ( i think named was having this issue on rhel3 as well), so I am gonna look into that.

                But anyways... it seems to be just as functional on rhel3/4 and fc3/4.

                Comment

                • jetfu
                  Junior Member
                  • Feb 2006
                  • 3

                  #9
                  Red hat ES 4 init scripts

                  I've created some simplified init.d scripts for RedHat ES 4. Basically as root just copy the two scripts into the /etc/init.d directory removing the extenstion. Then just run

                  # chkconfig --add zabbixServerd
                  # chkconfig --add zabbixAgentd

                  to have them start on boot up

                  # chkconfig zabbixServerd on
                  # chkconfig zabbixAgentd on

                  from there on out you can
                  service zabbixServerd {start|stop|restart|condrestart|status}
                  service zabbixAgentd {start|stop|restart|condrestart|status}

                  zabbixServerd:

                  #!/bin/bash
                  #
                  # Zabbix Startup script for the Zabbix Server
                  #
                  # chkconfig: - 99 02
                  # description: Zabbix network and host monitoring
                  # processname: zabbix_server
                  # config: /etc/zabbix/zabbix_server.conf
                  # pidfile: /var/tmp/zabbix_server.pid

                  # Source function library.
                  . /etc/rc.d/init.d/functions

                  if [ -f /etc/sysconfig/zabbix_server ]; then
                  . /etc/sysconfig/zabbix_server
                  fi

                  server_cfgfile=/etc/zabbix/zabbix_server.conf
                  pidfile=${PIDFILE-/var/tmp/zabbix_server.pid}
                  zabbix_server=${ZABBIX_SERVER-/usr/local/bin/zabbix_server}
                  prog=zabbix_server

                  start() {
                  echo -n $"Starting $prog: "
                  daemon $zabbix_server
                  RETVAL=$?
                  echo
                  [ $RETVAL = 0 ]
                  return $RETVAL
                  }
                  stop() {
                  echo -n $"Stopping $prog: "
                  killproc $zabbix_server
                  RETVAL=$?
                  echo
                  [ $RETVAL = 0 ] && rm -f ${pidfile}
                  }


                  # See how we were called.
                  case "$1" in
                  start)
                  start
                  ;;
                  stop)
                  stop
                  ;;
                  status)
                  status $zabbix_server
                  RETVAL=$?
                  ;;
                  restart)
                  stop
                  start
                  ;;
                  condrestart)
                  if [ -f ${pidfile} ] ; then
                  stop
                  start
                  fi
                  ;;
                  *)
                  echo $"Usage: $prog {start|stop|restart|condrestart|status}"
                  exit 1
                  esac

                  exit $RETVAL

                  zabbixAgentd:

                  #!/bin/bash
                  #
                  # Zabbix Startup script for the Zabbix Server
                  #
                  # chkconfig: - 99 02
                  # description: Zabbix network and host monitoring
                  # processname: zabbix_server
                  # config: /etc/zabbix/zabbix_server.conf
                  # pidfile: /var/tmp/zabbix_server.pid

                  # Source function library.
                  . /etc/rc.d/init.d/functions

                  if [ -f /etc/sysconfig/zabbix_agentd ]; then
                  . /etc/sysconfig/zabbix_agentd
                  fi

                  agentd_cfgfile=/etc/zabbix/zabbix_agentd.conf
                  pidfile=${PIDFILE-/var/tmp/zabbix_agentd.pid}
                  zabbix_agentd=${ZABBIX_AGENTD-/usr/local/bin/zabbix_agentd}
                  prog=zabbix_agentd

                  start() {
                  echo -n $"Starting $prog: "
                  daemon $zabbix_agentd
                  RETVAL=$?
                  echo
                  [ $RETVAL = 0 ]
                  return $RETVAL
                  }
                  stop() {
                  echo -n $"Stopping $prog: "
                  killproc $zabbix_agentd
                  RETVAL=$?
                  echo
                  [ $RETVAL = 0 ] && rm -f ${pidfile}
                  }


                  # See how we were called.
                  case "$1" in
                  start)
                  start
                  ;;
                  stop)
                  stop
                  ;;
                  status)
                  status $zabbix_agentd
                  RETVAL=$?
                  ;;
                  restart)
                  stop
                  start
                  ;;
                  condrestart)
                  if [ -f ${pidfile} ] ; then
                  stop
                  start
                  fi
                  ;;
                  *)
                  echo $"Usage: $prog {start|stop|restart|condrestart|status}"
                  exit 1
                  esac

                  exit $RETVAL
                  Attached Files

                  Comment

                  • johanpre44
                    Member
                    • Apr 2006
                    • 40

                    #10
                    Anyone built an RPM yet?

                    Just wondering if any of you did the rpm yet? Seems like the init scripts are sorted out though.

                    Comment

                    • vrtareg
                      Senior Member
                      • May 2006
                      • 293

                      #11
                      Hi

                      See thread: http://www.zabbix.com/forum/showthread.php?t=3283

                      Areg
                      Last edited by vrtareg; 29-06-2006, 14:03. Reason: update

                      Comment

                      Working...