Ad Widget

Collapse

1.4 agent hanging on AIX 5.3

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wurm
    Junior Member
    • Jun 2007
    • 12

    #1

    1.4 agent hanging on AIX 5.3

    Hi,

    I've successfully compiled and set up the server and an agent on a SuSe server, and now am trying to monitor an AIX host. I've tried compiling the agent on the AIX machine many different ways, and keep having the same problem. When I su to zabbix and run zabbix_agentd, it hangs and uses 100% of a processor. After pressing ctrl-c, when I look, there is no log file. I've looked from another session while it is hanging and there is no log or pid file then, either. The zabbix user can create and delete files in the log and pid directories that I have in zabbix_agentd.conf.

    I have the appropriate settings in /etc/services (10050 and 10051) and have configured /etc/zabbix/zabbix_agentd.conf with server set to the IP address of the Zabbix server, and hostname set to the hostname of the AIX host. I've tried it with Active enabled and disabled.

    I am using the xl C 9.0 EE compiler and the AIX system is a p575 LPAR with 2 CPUs and AIX is 5.3 TL 4 running in 64 bit mode.

    I've tried using the following as CC: xlc xlC xlc_r xlC_r
    I've tried the following options: -q64 -qarch=pwr5 -qtune=pwr5 -qsmp=auto
    I've tried it with OBJECT_MODE set to 64 and I've tried it unset
    I've tried it with MALLOCALIGN set to 16 and I've tried it unset
    I've tried just about every combination.

    I don't know if it is a bug, or if it is the way I'm compiling it. I haven't seen anyone else in the forums with this problem using 1.4.

    Another clue: I thought I'd try the zabbix_agent, but that doesn't do anything. It doesn't hang, but after running it, there are no zabbix_agent processes in the process table. I even added the appropriate line to inetd.conf and refreshed inetd.

    Does anyone know what is wrong with my agent? What am I missing?

    Thanks for any help you can give.
  • Thomas Williams
    Junior Member
    • Feb 2007
    • 7

    #2
    FWIW, I'm having the same issues with both AIX 5.2 and 5.3. I've tried compiling from the official 1.4 source as well as the latest code from CVS. I've got quite a few AIX boxes to monitor, so hopefully someone will see this thread and have some insight on the issue.

    Comment

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

      #3
      The AIX problem is already fixed in the latest code and the patch is available somewhere in ZABBIX forums.
      Alexei Vladishev
      Creator of Zabbix, Product manager
      New York | Tokyo | Riga
      My Twitter

      Comment

      • fips
        Member
        • Sep 2005
        • 38

        #4
        AIX 5.3 fix

        The zabbix_agentd was hanging on parsing the command line. Old code:

        int main(int argc, char **argv)
        {
        int listenfd;
        socklen_t addrlen;
        int i;

        char host[128];
        int ch;
        char *s;
        int task = ZBX_TASK_START;
        char *TEST_METRIC = NULL;

        static struct sigaction phan;

        progname = argv[0];
        /* Parse the command-line. */
        while ((ch = getopt_long(argc, argv, "c:hvpt:", longopts, NULL)) !=
        EOF){

        ...


        New working code:
        static zbx_task_t parse_commandline(int argc, char **argv)
        {
        zbx_task_t task = ZBX_TASK_START;
        char ch = '\0';

        /* Parse the command-line. */
        while ((ch = zbx_getopt_long(argc, argv, shortopts, longopts, NULL)) != (char)EOF){
        ...


        There changed the type of ch. On Linux systems this still works, but on AIX 5.3 machine EOF is int and the program was never getting out of the while loop!

        Comment

        • tronite
          Senior Member
          • Jun 2007
          • 147

          #5
          thanks fips, good doing.

          Comment

          • wurm
            Junior Member
            • Jun 2007
            • 12

            #6
            Re: AIX 5.3 Fix

            Originally posted by fips
            New working code:
            static zbx_task_t parse_commandline(int argc, char **argv)
            {
            zbx_task_t task = ZBX_TASK_START;
            char ch = '\0';

            /* Parse the command-line. */
            while ((ch = zbx_getopt_long(argc, argv, shortopts, longopts, NULL)) != (char)EOF){
            ...


            There changed the type of ch. On Linux systems this still works, but on AIX 5.3 machine EOF is int and the program was never getting out of the while loop!

            I changed the line in zabbix_agentd.c and zabbix_agent.c, recompiled, and now it works! Many thanks fips!!!

            Comment

            • Thomas Williams
              Junior Member
              • Feb 2007
              • 7

              #7
              Thanks! That produced a working binary under both AIX 5.2 and 5.3 PPC. Additionally, making the same change on RHEL4 and SLES9 S390 produces a usable agent where previously they'd hang on execution.

              Comment

              • jrdnyquist
                Junior Member
                • Jun 2007
                • 6

                #8
                Originally posted by fips
                The zabbix_agentd was hanging on parsing the command line. Old code:

                int main(int argc, char **argv)
                {
                int listenfd;
                socklen_t addrlen;
                int i;

                char host[128];
                int ch;
                char *s;
                int task = ZBX_TASK_START;
                char *TEST_METRIC = NULL;

                static struct sigaction phan;

                progname = argv[0];
                /* Parse the command-line. */
                while ((ch = getopt_long(argc, argv, "c:hvpt:", longopts, NULL)) !=
                EOF){

                ...


                New working code:
                static zbx_task_t parse_commandline(int argc, char **argv)
                {
                zbx_task_t task = ZBX_TASK_START;
                char ch = '\0';

                /* Parse the command-line. */
                while ((ch = zbx_getopt_long(argc, argv, shortopts, longopts, NULL)) != (char)EOF){
                ...


                There changed the type of ch. On Linux systems this still works, but on AIX 5.3 machine EOF is int and the program was never getting out of the while loop!

                I had no success using XLC v8, once I installed XLC v9 it worked like a charm using this modification.

                Thanks!

                EDIT:I can't spell
                Last edited by jrdnyquist; 20-06-2007, 00:38.

                Comment

                • bryancan
                  Junior Member
                  • Sep 2006
                  • 22

                  #9
                  I can get the compile to happen OK in AIX 5.3, but when I start the zabbix_agentd, I get a message that reads:
                  " zabbix_agentd [21576]: Error in line [74] "
                  but then the agent seems to work and I see my data in the gui.
                  Any ideas?
                  Bryancan

                  Comment

                  Working...