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

network interface statistics return 0 on Solaris 11

XMLWordPrintable

      In src/libs/zbxsysinfo/solaris/net.c a "kstat_lookup(kc, NULL, -1, (char *)name)" is done without specifying the module (NULL) nor the instance (-1).

      On Solaris 10 this was working because the module was unique (and was the interface name without the number, for instance "bge" for interface "bge0"):

      $ kstat -n bge0 -s class -p
      bge:0:bge0:class        net
      $ kstat -n bge0 -s obytes64 -p
      bge:0:bge0:obytes64     1766201164
      

      But on Solaris 11, with its completely new network stack, it does not work anymore because, for one interface, you have statistics in the "unix" module and in the "link" module, and useful statistics are coming from the link module only:

      $ kstat -n net0 -s class -p
      link:0:net0:class       net
      unix:0:net0:class       flow
      $ kstat -n net0 -s obytes64 -p
      link:0:net0:obytes64    319278589464
      

      ...and we are not lucky, the loose kstat_lookup() returns the bad one, the "unix" one, which does not have the stats we need.

      So, for Solaris 11 and following only, the net.c line 39 should like like:

        if (NULL == (kp = kstat_lookup(kc, "link", 0, (char *)name)))
      

      I set the instance number to 0 because, on the global zone, you may get several net0 interfaces in the link kstats: for the global zone (the first instance to be created, so 0) and for some other zones.

            Unassigned Unassigned
            pierre4031 Dehaen Pierre
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: