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

system.uname differences

    XMLWordPrintable

Details

    • Incident report
    • Resolution: Fixed
    • Blocker
    • 2.2.10rc1, 2.4.6rc1, 2.5.0
    • 2.4.0, 2.4.1
    • Agent (G)
    • HP-UX 11.31 on IA-64

    Description

      Depending on what preprocessor conditionals are taken in the <sys/utsname.h> OS header, the struct utsname member strings are different lengths. If using the compiler provided by HP, the system.uname item functions normally. If using gcc, the uname function that fills these character arrays runs into some kind of memory issue where only the sysname member gets populated and doesn't seem to get properly terminated with a null character. The agent was reporting HP-UX 11.31 followed by some random values to the server. I read through utsname.h and found a fix that works in my environment. I changed the following line in src/libs/zbxsysinfo/hpux/system.c from:

      struct utsname name;

      to:

      struct utsname_hpux_v1 name;

      This seems to function correctly with the HP C compiler and gcc. I attached my modified source file. Using the utsname_hpux_v1 declaration forces 9 byte member strings rather than the 257 byte strings.

      Attachments

        1. uname.c
          0.6 kB
        2. system.c
          1 kB

        Issue Links

          Activity

            People

              Unassigned Unassigned
              tburns@hrsd.com Tyler Burns
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: