Ad Widget

Collapse

Problems with 1.3.3

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • schulzor2004
    Junior Member
    • Mar 2007
    • 3

    #1

    Problems with 1.3.3

    Hallo,

    I am not sure if this is a bug, or if I am missing something. I have several Problems, that I try to describe as good as possible:

    The first one is relative simple, when I start following command:

    Code:
    zabbix_get -s127.0.0.1 -k"system.cpu.load[all,avg1]"
    I get as result: zabbix_get [13582]: Error on gethost(). [Success]

    And I tried everything as server, the local IP, the real IP, servername, etc... all the same. When I use the "zabbix_get" from the previous stable version, it works.

    ------------

    Ok, my second problem:

    I have a linux server with ssh on it, and I collect the item "SSH server is running" on it (it is from the template standalone_t). Suddenly, the Trigger "SSH server is down on Standalone_t" raised and it never got back, although the ssh was running and the Item value (last values) was correct, saying, that SSH is running. I tried to resave the trigger, but it didn't change. The only thing that worked, was to change the Datatype of this item to numeric(float) instead of Integer. After that it worked.

    This is only an example of problems I have with that version. It also does not work (nearly the same way as described above) with other items and triggers, for example the trigger, that looks for a checksum change in the passwd.

    Do I do anything wrong ? Or is this "unstable" Version of zabbix is really this kind of buggy ?
  • schulzor2004
    Junior Member
    • Mar 2007
    • 3

    #2
    Solved

    ok, I discovered the error. Problem is, that in the eval-functions "diff" and "prev" the wrong values are loaded, when working with INTEGER64 values. To correct this, edit the file:

    .../src/zabbix_server/evalfunc.c

    in Line 862: change
    Code:
    item->prevvalue_dbl
    to
    Code:
    item->prevvalue_uint64
    and

    in Line 1014: change
    Code:
    if(item->lastvalue_dbl == item->prevvalue_dbl)
    to
    Code:
    if(item->lastvalue_uint64 == item->prevvalue_uint64)
    short after that the function should return 0 instead of 1 if the values match :

    Code:
                                    case ITEM_VALUE_TYPE_UINT64:
                                            if(item->lastvalue_uint64 == item->prevvalue_uint64)
                                            {
                                                    strcpy(value,"0");
                                            }
                                            else
                                            {
                                                    strcpy(value,"1");
                                            }
                                            break;
    because interpreting an integer value as a double leads to strange values...

    It's a bit of strange, that nobody else discovered this error, due to the fact, that even some of the basic functions like checking passwd checksum, did not work....

    But now it is solved , please fix it in your future version.
    Last edited by schulzor2004; 16-03-2007, 15:21.

    Comment

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

      #3
      Thanks for reporting this!
      Alexei Vladishev
      Creator of Zabbix, Product manager
      New York | Tokyo | Riga
      My Twitter

      Comment

      • esther1024p
        Junior Member
        • Mar 2007
        • 3

        #4
        Re: "gethost() error " when running zubbix_get

        Hello,
        I was having the same problem with zabbix_get (version 1.3.3) and that is how I have found your bugfix suggestion. So far so good. But when I tried to apply it, I could not find the lines to modify. Somehow my source for evalfunc.c is not the same as yours. I have loaded my distribution from zabbix.com on march 13, 2007. Could you please post more lines around the ones that need changes, so I could identify the area. Thank you.

        Comment

        • monsieurcanard
          Member
          • Mar 2007
          • 40

          #5
          Hi there,

          I had the same problem with 1.3.3 and also couldn't find the right lines to correct. With a bit of guestimation, I think I found the right parts. Please find the patch below:

          Code:
          --- zabbix-1.3.3-old/src/zabbix_server/evalfunc.c   Tue Mar 20 18:51:51 2007
          +++ zabbix-1.3.3/src/zabbix_server/evalfunc.c     Fri Mar 23 17:08:08 2007
          @@ -886,7 +886,7 @@
                                                  del_zeroes(value);
                                                  break;
                                          case ITEM_VALUE_TYPE_UINT64:
          -                                       zbx_snprintf(value,MAX_STRING_LEN,ZBX_FS_UI64,item->prevvalue_dbl);
          +                                       zbx_snprintf(value,MAX_STRING_LEN,ZBX_FS_UI64,item->prevvalue_uint64);
                                                  break;
                                          default:
                                                  strcpy(value,item->prevvalue_str);
          @@ -1079,13 +1079,13 @@
                                                  }
                                                  break;
                                          case ITEM_VALUE_TYPE_UINT64:
          -                                       if(item->lastvalue_dbl == item->prevvalue_dbl)
          +                                       if(item->lastvalue_uint64 == item->prevvalue_uint64)
                                                  {
          -                                               strcpy(value,"1");
          +                                               strcpy(value,"0");
                                                  }
                                                  else
                                                  {
          -                                               strcpy(value,"0");
          +                                               strcpy(value,"1");
                                                  }
                                                  break;
                                          default:
          Hope that helps!
          Matt

          Comment

          • monsieurcanard
            Member
            • Mar 2007
            • 40

            #6
            PS Can someone please confirm if my patch above looks correct?

            Matt
            Last edited by monsieurcanard; 23-03-2007, 19:16.

            Comment

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

              #7
              Yes, your patch is correct! We are applying it for 1.3.4.

              Note that the patch does not fix the zabbix_get problem which we have difficulties to replicate on our test systems.
              Alexei Vladishev
              Creator of Zabbix, Product manager
              New York | Tokyo | Riga
              My Twitter

              Comment

              Working...