ExportXMLWordPrintable

    • Type: Problem report
    • Resolution: Unresolved
    • Priority: Trivial
    • None
    • Affects Version/s: None
    • Component/s: Templates (T)
    • None

      The official FortiGate by SNMP template contains the calculated item:

      vfs.fs.pfree (Free disk percentage)

      whose expression is:

      100-(last(//vfs.fs.used[fgSysDiskUsage.0])/last(//vfs.fs.total[fgSysDiskCapacity.0])*100)

      On FortiGate models without internal storage, the SNMP agent reports:

      vfs.fs.total[fgSysDiskCapacity.0] = 0
      vfs.fs.used[fgSysDiskUsage.0] = 0

      As a result, the expression attempts to evaluate:

      100 - (0 / 0 * 100)

      which causes the calculated item to become unsupported with the error:

      Cannot evaluate expression:
      division by zero at "/last(//vfs.fs.total[fgSysDiskCapacity.0])*100)"

      This affects FortiGate appliances that legitimately do not have local storage.

      Expected result

      The template should gracefully handle devices that report a filesystem size of zero, for example by:

      avoiding the calculation when vfs.fs.total equals 0;
      not creating the filesystem percentage item for such devices/filesystems;
      or otherwise preventing the calculated item from becoming unsupported.

      Additional observation

      I also tested the Check for not supported value preprocessing step on the calculated item.

      The preprocessing test successfully matches the error message:

      division by zero ...

      and executes the configured action (Discard value).

      However, during normal polling, the calculated item still becomes unsupported with:

      Cannot evaluate expression: division by zero ...

      It appears that Check for not supported value is not executed for calculated expression evaluation errors.

      If this behavior is intentional, the documentation should explicitly state that Cannot evaluate expression errors generated by calculated items are not processed by Check for not supported value. Otherwise, this may be a bug, as the preprocessing test indicates that such errors can be matched and handled.

            Assignee:
            Zabbix Support Team
            Reporter:
            Tiago Alves
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - Not Specified
                Not Specified
                Logged:
                Time Spent - 2h
                2h