Ad Widget

Collapse

How Do I get the Zabbix agent to run as a service in AIX 6.1?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DrElvis
    Junior Member
    • Aug 2014
    • 4

    #1

    How Do I get the Zabbix agent to run as a service in AIX 6.1?

    I downloaded the latest agent to run on our AIX 6.1 server and upon uncompressing it and untarring it, all I have are the basic files but no install files. So, I am looking for straightforward instructions on how to install the agent as a service so that I don't have to manually run the agent every time I reboot the server. I saw the other thread on how to run the agent manually and have it running right now, but sure could use some instructions for getting it to run as a service.

    I read through the user guide, but it really doesn't have a good clearly marked simple procedure for doing this. Has anyone already compiled this version for AIX 6.1 so that it does this for you? Or, are there any easy to follow procedures somewhere out there besides that rather foggy instructions in the user guide?

    Thanks
  • mb78
    Junior Member
    • Dec 2006
    • 4

    #2
    add to /etc/rc.local

    Code:
    #!/bin/ksh
    echo "Starting User Applications...."
    echo "Starting Application Zabbix"
    su zabbix "-c /usr/sbin/zabbix_agentd"
    echo "Startup of User Applications completed"

    Comment

    • DrElvis
      Junior Member
      • Aug 2014
      • 4

      #3
      Thank you for your suggestion mb78.

      You wrote:

      >>add to /etc/rc.local

      I checked and I do not have a /etc/rc.local

      I could create one, however, in reading up on running things out of rc.local, I am also seeing posts that suggest running things like this from the inittab.

      If I was to create an rc.local file, I would think there are probably more things I would want to do to ensure it runs properly like adding "2>&1 &" at the end of the commnad line, and maybe putting a nohup at the beginning. Here is what I have so far:
      Code:

      #!/bin/ksh
      echo "Starting User Applications...."
      echo "Starting Application Zabbix"
      su zabbix "- c nohup /usr/local/zabbix/sbin/zabbix_agentd /etc/zabbix/zabbix_agentd.conf 2>&1 &"
      echo "Startup of User Applications completed"
      exit 0

      =====
      The paths of the zabbix agent and the conf file reflect the proper location on my server.

      Your thoughts?

      Comment

      • aib
        Senior Member
        • Jan 2014
        • 1615

        #4
        There was a good man who did all preparation for you

        Zabbix Agent for AIX 6.1 (RPM edition)
        Sincerely yours,
        Aleksey

        Comment

        • DrElvis
          Junior Member
          • Aug 2014
          • 4

          #5
          Thanks aib. That would be the ultimate solution, if only those files were not from 2009. I saw those too (a couple weeks ago) and at first thought I had found the answer to all my prayers.... that is until I looked at how old they were. I was hoping for something current (like 2.2.5), but I do not believe it is available in that format. I'm toying around with the regular files right now on a test AIX server, so hopefully I have some success with that. If not, I will leave this thread open in case anyone knows of a current Zabbix rpm format for AIX.

          Comment

          • aib
            Senior Member
            • Jan 2014
            • 1615

            #6
            I hope you know that most part of functionality comes from Zabbix Server.
            And the modern version of Zabbix Server easily works with old version of agent.

            So, it's not important to have a modern version of Zabbix Agent to achieve the same goals.
            Sincerely yours,
            Aleksey

            Comment

            • DrElvis
              Junior Member
              • Aug 2014
              • 4

              #7
              Thanks Aleksey. I too, have read that. Unfortunately, what drove this whole effort was that we were already using an old agent which appeared to have been creating a lot of excessive chatter to the Zabbix server. The newer agent I have running manually seems to have quieted down the chatter and solved the problem, but the issue still remains on how to run it from startup.

              Comment

              • aib
                Senior Member
                • Jan 2014
                • 1615

                #8
                Well, if you have only one problem - How to start the agent? - I will advice you this procedure :
                - Install old agent from RPM. RPM installer creates all directories, copies all files and creates the startup scripts.
                - compile a modern agent on any AIX system.
                - stop the old agent.
                - REPLACE the old binary files to new, freshly compiled modern agent's binaries. (zabbix_agentd | zabbix_get | zabbix_send)

                After that procedure you will have :
                - old startup scripts which is fully compatible with new binaries
                - new binaries which has the whole functionality which you need.

                Looks like a plan?

                PS BTW, after that you can just copy all zabbix directories to any different AIX server, renew the Hostname= keyword in zabbix_agentd.conf file and start it on new place.
                Sincerely yours,
                Aleksey

                Comment

                • TherioN
                  Junior Member
                  • Mar 2016
                  • 1

                  #9
                  Zabbix ON AIX

                  This is the right recipe:




                  Dowload zabbix Agent AIX version archive.
                  Extract archive and go inside content.
                  There will be direcotries like:
                  bin
                  conf
                  sbin
                  Install Zabbix Agent
                  #create zabbix group
                  mkgroup zabbix

                  #create zabbix user and at it to zabbix group
                  mkuser pgrp='zabbix' groups='zabbix' zabbix

                  #make configuration direcotry
                  mkdir /etc/zabbix

                  #make log directory
                  mkdir /var/log/zabbix/

                  #log directory belongs to user zabbix and group zabbix
                  chown -R zabbix:zabbix /var/log/zabbix/

                  #make configuration direcotry
                  mkdir -p /usr/local/etc/

                  #create direoctory for zabbix process file
                  mkdir -p /var/run/zabbix/

                  #process files directory belong to zabbix
                  chown -R zabbix:zabbix /var/run/zabbix/

                  #install zabbix_get and zabbix_sender binary
                  cp bin/zabbix_* /bin/

                  #install zabbix_agent and zabbix_agentd binary
                  cp sbin/zabbix_agent* /sbin/

                  #copy configuration files
                  cp -r conf/zabbix_agent* /etc/zabbix/

                  #link configiguration file
                  ln -s /etc/zabbix/zabbix_agentd.conf /usr/local/etc/zabbix_agentd.conf

                  #backup original configuration file
                  mv /etc/zabbix/zabbix_agentd.conf /etc/zabbix/zabbix_agentd.conf_bck

                  #create your own configuration file
                  cat > /etc/zabbix/zabbix_agentd.conf << EOF
                  DebugLevel=3
                  EnableRemoteCommands=1
                  Hostname=hostname.goes.here
                  LogFile=/var/log/zabbix/zabbix_agentd.log
                  PidFile=/var/run/zabbix/zabbix_agentd.pid
                  Server=x.y.z.w
                  EOF

                  #start zabbix agent
                  zabbix_agentd
                  Check if zabbix is installed to boot at startup
                  lsitab zabbix
                  Set Zabbix Agent to boot at startup
                  mkitab "zabbix:2nce:/sbin/zabbix_agentd >/dev/null 2>&1"
                  For debugging purpose use:
                  #check procesees
                  ps aux|grep [z]abbix

                  #kill zabbix agent by process
                  kill 12345

                  #clear zabbix agent log
                  > /var/log/zabbix/zabbix_agentd.log

                  #start zabbix agent
                  zabbix_agentd

                  #check if process exists
                  ps aux|grep [z]abbix

                  #check log
                  cat /var/log/zabbix/zabbix_agentd.log

                  Comment

                  • geniepage
                    Member
                    • Sep 2015
                    • 34

                    #10
                    Great job

                    Hello TherioN,
                    great job and nice manual how to.

                    For zabbix on aix is problem that on some aix servers zabbix agents have the problems with zombie state for looong time or unresponsivnes or higher cpu usage. And it is problem to debug it where is the problem.

                    Thanks

                    Genie

                    Comment

                    Working...