ZABBIX BUGS AND ISSUES
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-5609

change default disk check in freebsd from hda to da0

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.0
    • Fix Version/s: 2.0.4rc1, 2.1.0
    • Component/s: Agent (G)
    • Labels:
    • Environment:
      FreeBSD

      Description

      `zabbix_agent -p` crashes on FreeBSD. The attached patch at least prevents the crash, though it doesn't prevent zabbix_agentd from returning prematurely. This patch also includes a small fix for vfs.dev.*. FreeBSD doesn't have hda, it uses da0 (most likely).

        Activity

        Hide
        richlv added a comment -

        crash is probably a duplicate of ZBX-5473 (already fixed for 2.0.3)

        let's leave this issue for changing default disk device

        Show
        richlv added a comment - crash is probably a duplicate of ZBX-5473 (already fixed for 2.0.3) let's leave this issue for changing default disk device
        Hide
        Alexander Vladishev added a comment -

        Yes, crash has been already fixed in ZBX-5473.

        Show
        Alexander Vladishev added a comment - Yes, crash has been already fixed in ZBX-5473 .
        Hide
        Alexander Vladishev added a comment -

        FreeBSD disk organization: http://www.freebsd.org/doc/handbook/disk-organization.html

        Disk Device Codes
        Code Meaning
        ad ATAPI (IDE) disk
        da SCSI direct access disk
        acd ATAPI (IDE) CDROM
        cd SCSI CDROM
        fd Floppy disk
        Sample Disk, Slice, and Partition Names
        Name Meaning
        ad0s1a The first partition (a) on the first slice (s1) on the first IDE disk (ad0).
        da1s2e The fifth partition (e) on the second slice (s2) on the second SCSI disk (da1).

        Use of "da0" will be more logical. It should be corrected.

        Show
        Alexander Vladishev added a comment - FreeBSD disk organization: http://www.freebsd.org/doc/handbook/disk-organization.html Disk Device Codes Code Meaning ad ATAPI (IDE) disk da SCSI direct access disk acd ATAPI (IDE) CDROM cd SCSI CDROM fd Floppy disk Sample Disk, Slice, and Partition Names Name Meaning ad0s1a The first partition (a) on the first slice (s1) on the first IDE disk (ad0). da1s2e The fifth partition (e) on the second slice (s2) on the second SCSI disk (da1). Use of "da0" will be more logical. It should be corrected.
        Hide
        Sean Chittenden added a comment -

        Correct. Given that almost all disks these days are SAS/SATA and show up as da(4) devices, use of da(4) is correct (vs ada(4)).

        Show
        Sean Chittenden added a comment - Correct. Given that almost all disks these days are SAS/SATA and show up as da(4) devices, use of da(4) is correct (vs ada(4)).
        Hide
        Alexander Vladishev added a comment -

        The same problem with OpenBSD.

        Related link: http://www.openbsd.org/faq/faq14.html#intro

        Code Meaning
        wd IDE disks (and devices that look like IDE disks, for example, SATA, MFM or ESDI disks, or a flash device with an appropriate adapter) attached to a wdc(4) or pciide(4) interface.
        sd Devices that utilize SCSI commands, such as SCSI disks attached to a SCSI adapter, USB disks, SATA disks attached to an ahci(4) interface, and disk arrays attached to a RAID controller.

        "sd0" should be used as example.

        Show
        Alexander Vladishev added a comment - The same problem with OpenBSD. Related link: http://www.openbsd.org/faq/faq14.html#intro Code Meaning wd IDE disks (and devices that look like IDE disks, for example, SATA, MFM or ESDI disks, or a flash device with an appropriate adapter) attached to a wdc(4) or pciide(4) interface. sd Devices that utilize SCSI commands, such as SCSI disks attached to a SCSI adapter, USB disks, SATA disks attached to an ahci(4) interface, and disk arrays attached to a RAID controller. "sd0" should be used as example.
        Hide
        Alexander Vladishev added a comment -

        Fixed in the development branch svn://svn.zabbix.com/branches/dev/ZBX-5609 r30371.

        Show
        Alexander Vladishev added a comment - Fixed in the development branch svn://svn.zabbix.com/branches/dev/ZBX-5609 r30371.
        Hide
        Andris Mednis added a comment -

        Successfully tested.

        Show
        Andris Mednis added a comment - Successfully tested.
        Hide
        Alexander Vladishev added a comment -

        Fixed in pre-2.0.4 r30504 and pre-2.1.0 (trunk) r30505.

        Show
        Alexander Vladishev added a comment - Fixed in pre-2.0.4 r30504 and pre-2.1.0 (trunk) r30505.
        Hide
        Sean Chittenden added a comment -

        Actually, this doens't crash any more, but the vfs.dev.read and vfs.dev.write are returning not supported, incorrectly.

        zabbix_agentd -p | grep vfs.dev
        vfs.dev.read [m|ZBX_NOTSUPPORTED]
        vfs.dev.write [m|ZBX_NOTSUPPORTED]

        But when I run manually:

        zabbix_agentd -t 'vfs.dev.read[da0,operations]'
        vfs.dev.read[da0,operations] [u|2105562]

        It returns the right count. Omitting the second argument, things error out because ops isn't implemented correctly?

        zabbix_agentd -t 'vfs.dev.read[da0]'
        vfs.dev.read[da0] [m|ZBX_NOTSUPPORTED]

        zabbix_agentd -t 'vfs.dev.read[da0,ops]'
        vfs.dev.read[da0,ops] [m|ZBX_NOTSUPPORTED]
        zabbix_agentd -t 'vfs.dev.read[da0,operations]'
        vfs.dev.read[da0,operations] [u|2105641]
        zabbix_agentd -t 'vfs.dev.read[da0,bytes]'
        vfs.dev.read[da0,bytes] [u|110616835392]
        zabbix_agentd -t 'vfs.dev.read[da0,bps]'
        vfs.dev.read[da0,bps] [m|ZBX_NOTSUPPORTED]

        Could we maybe change the default to be operations and not bps? operations per second is a much more useful metric than the bandwidth transferred, tbh. -sc

        Index: src/libs/zbxsysinfo/freebsd/diskio.c
        ===================================================================
        — src/libs/zbxsysinfo/freebsd/diskio.c (revision 30681)
        +++ src/libs/zbxsysinfo/freebsd/diskio.c (working copy)
        @@ -124,7 +124,7 @@
        if (0 != get_param(param, 2, tmp, sizeof(tmp)))
        *tmp = '\0';

        • if ('\0' == *tmp || 0 == strcmp(tmp, "bps")) /* default parameter */
          + if ('\0' == *tmp || 0 == strcmp(tmp, "operations")) /* default parameter */
          type = ZBX_DSTAT_TYPE_BPS;
          else if (0 == strcmp(tmp, "ops"))
          type = ZBX_DSTAT_TYPE_OPS;
        Show
        Sean Chittenden added a comment - Actually, this doens't crash any more, but the vfs.dev.read and vfs.dev.write are returning not supported, incorrectly. zabbix_agentd -p | grep vfs.dev vfs.dev.read [m|ZBX_NOTSUPPORTED] vfs.dev.write [m|ZBX_NOTSUPPORTED] But when I run manually: zabbix_agentd -t 'vfs.dev.read [da0,operations] ' vfs.dev.read [da0,operations] [u|2105562] It returns the right count. Omitting the second argument, things error out because ops isn't implemented correctly? zabbix_agentd -t 'vfs.dev.read [da0] ' vfs.dev.read [da0] [m|ZBX_NOTSUPPORTED] zabbix_agentd -t 'vfs.dev.read [da0,ops] ' vfs.dev.read [da0,ops] [m|ZBX_NOTSUPPORTED] zabbix_agentd -t 'vfs.dev.read [da0,operations] ' vfs.dev.read [da0,operations] [u|2105641] zabbix_agentd -t 'vfs.dev.read [da0,bytes] ' vfs.dev.read [da0,bytes] [u|110616835392] zabbix_agentd -t 'vfs.dev.read [da0,bps] ' vfs.dev.read [da0,bps] [m|ZBX_NOTSUPPORTED] Could we maybe change the default to be operations and not bps? operations per second is a much more useful metric than the bandwidth transferred, tbh. -sc Index: src/libs/zbxsysinfo/freebsd/diskio.c =================================================================== — src/libs/zbxsysinfo/freebsd/diskio.c (revision 30681) +++ src/libs/zbxsysinfo/freebsd/diskio.c (working copy) @@ -124,7 +124,7 @@ if (0 != get_param(param, 2, tmp, sizeof(tmp))) *tmp = '\0'; if ('\0' == *tmp || 0 == strcmp(tmp, "bps")) /* default parameter */ + if ('\0' == *tmp || 0 == strcmp(tmp, "operations")) /* default parameter */ type = ZBX_DSTAT_TYPE_BPS; else if (0 == strcmp(tmp, "ops")) type = ZBX_DSTAT_TYPE_OPS;
        Hide
        Sean Chittenden added a comment -

        The second argument needs to be changed in order to be useful to people.

        Show
        Sean Chittenden added a comment - The second argument needs to be changed in order to be useful to people.
        Hide
        Alexander Vladishev added a comment -

        What version you used?

        The crash was fixed under ZBX-5473 in version 2.0.3.
        The default arguments for vfs.dev.read/write was fixed in version pre-2.0.4 (not released).

        Show
        Alexander Vladishev added a comment - What version you used? The crash was fixed under ZBX-5473 in version 2.0.3. The default arguments for vfs.dev.read/write was fixed in version pre-2.0.4 (not released).
        Hide
        Sean Chittenden added a comment -

        2.0.3, and yes, in 2.0.3 the agent didn't crash, but its default values returned no information.

        I haven't tried anything from svn/branches/2.0 yet, but it looks like r30710 of branches/2.0/src/libs/zbxsysinfo/freebsd/diskio.c is still showing "bps" and not operations. Wouldn't it make more sense to have the default operations always be counters and not rates? Requiring state in either the kernel or the agent to yield a rate seems like it should be optional and derived value, but shouldn't replace "truth" in the form of a raw counter.

        Show
        Sean Chittenden added a comment - 2.0.3, and yes, in 2.0.3 the agent didn't crash, but its default values returned no information. I haven't tried anything from svn/branches/2.0 yet, but it looks like r30710 of branches/2.0/src/libs/zbxsysinfo/freebsd/diskio.c is still showing "bps" and not operations. Wouldn't it make more sense to have the default operations always be counters and not rates? Requiring state in either the kernel or the agent to yield a rate seems like it should be optional and derived value, but shouldn't replace "truth" in the form of a raw counter.
        Hide
        Andris Mednis added a comment -

        For "zabbix_agentd -p" keys "vfs.dev.read" and "vfs.dev.write" the default parameter was changed to "operations" while fixing this ZBX-5609 (in files src/libs/zbxsysinfo/freebsd/freebsd.c, src/libs/zbxsysinfo/linux/linux.c, src/libs/zbxsysinfo/openbsd/openbsd.c, src/libs/zbxsysinfo/solaris/solaris.c).
        For other cases we cannot change current default parameter (e.g. "bps") to "operations" amidst current version, but can discuss it for the next version.

        Show
        Andris Mednis added a comment - For "zabbix_agentd -p" keys "vfs.dev.read" and "vfs.dev.write" the default parameter was changed to "operations" while fixing this ZBX-5609 (in files src/libs/zbxsysinfo/freebsd/freebsd.c, src/libs/zbxsysinfo/linux/linux.c, src/libs/zbxsysinfo/openbsd/openbsd.c, src/libs/zbxsysinfo/solaris/solaris.c). For other cases we cannot change current default parameter (e.g. "bps") to "operations" amidst current version, but can discuss it for the next version.

          People

          • Assignee:
            Unassigned
            Reporter:
            Sean Chittenden
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: