Ad Widget

Collapse

Calculated Item in Interface Discovery

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Chalmo
    Junior Member
    • Jan 2014
    • 8

    #1

    Calculated Item in Interface Discovery

    Hi All,

    I'm trying to setup a calculated item in a Cisco ASA template that runs already runs a discovery for all the interfaces.

    Incoming traffic: ifInOctets[{#SNMPVALUE}]
    Outgoing traffic: ifOutOctets[{#SNMPVALUE}]

    What I want to do is create a 'Total traffic' item then add it onto the graph as-well.

    Which would be ifInOctets[{#SNMPVALUE}] + ifOutOctets[{#SNMPVALUE}] = ifTotalOctets[{#SNMPVALUE}].

    My calculated item key is ifTotalOctets[{#SNMPVALUE}] and formula last("ifInOctets[{#SNMPVALUE}]")+last("ifOutOctets[{#SNMPVALUE}]".

    When I apply the template there is an error on the item - 'Format error or unsupported operator. Exp: [last("ifOutOctets[AdaptiveSecurityAppliance'dc1]'

    Anybody done this before?
  • aib
    Senior Member
    • Jan 2014
    • 1615

    #2
    Yes, I did.
    My formula for Item Prototype is absolutely the same
    last("ifInOctets[{#SNMPVALUE}]")+last("ifOutOctets[{#SNMPVALUE}]")

    I hope that you just mistyped when copy-pasted your formula and lost the last round bracket ")"

    In your case it looks like the name of interface contains single quote and because of that you cannot use it in Formula expression.
    Do you mind to change the name of interface by replacing single quota to underscore, for example?
    Sincerely yours,
    Aleksey

    Comment

    • Chalmo
      Junior Member
      • Jan 2014
      • 8

      #3
      Thanks for the reply aib, I didn't notice my typo!

      Is your key something similar to ifTotalOctets[{#SNMPVALUE}] as-well?

      I'm not sure where its getting the single quote from. My discovered items are Incoming traffic on Adaptive Security Appliance 'clients' interface for example.

      My item discovery is
      Name: Incoming traffic on $1
      Key: ifInOctets[{#SNMPVALUE}]
      SNMP OID: IF-MIB::ifInOctets.{#SNMPINDEX}

      Couldn't it just be pulling the single quote from the ASA?

      Comment

      • Chalmo
        Junior Member
        • Jan 2014
        • 8

        #4
        I get an error on my item Cannot evaluate function [last()] after its discovered.

        Are you able to export your template and attach it here? Take out any company info if you have any of course.

        Comment

        • Chalmo
          Junior Member
          • Jan 2014
          • 8

          #5
          Spoke to soon it works! Must've been because the Incoming and Outgoing weren't updated before Total tried to calculate.

          Thanks.

          Comment

          • aib
            Senior Member
            • Jan 2014
            • 1615

            #6
            Any time!

            Usually it takes time to fill up all data and calculate the formulas.
            Sincerely yours,
            Aleksey

            Comment

            • jaipsharma
              Junior Member
              • Dec 2012
              • 18

              #7
              I'm still getting an error on my item Cannot evaluate function [last()] after its discovered.

              Name = Total Traffic on {#SNMPVALUE}
              Type = Calculated
              Key = Total_Traffic["{#SNMPINDEX}"]
              Formula = last("ifInOctets[{#SNMPVALUE}]")+last("ifOutOctets[{#SNMPVALUE}]")
              Type of information = Numeric (unassigned)
              Data type = Decimal
              Units = bps

              Please help!!!

              Comment

              • aib
                Senior Member
                • Jan 2014
                • 1615

                #8
                Originally posted by jaipsharma
                I'm still getting an error on my item Cannot evaluate function [last()] after its discovered.

                Name = Total Traffic on {#SNMPVALUE}
                Type = Calculated
                Key = Total_Traffic["{#SNMPINDEX}"]
                Formula = last("ifInOctets[{#SNMPVALUE}]")+last("ifOutOctets[{#SNMPVALUE}]")
                Type of information = Numeric (unassigned)
                Data type = Decimal
                Units = bps

                Please help!!!
                I hope you have three Item prototypes configured:
                - Inbound traffic: Key = ifInOctets[{#SNMPVALUE}]
                - Outbound traffic: Key = ifOutOctets[{#SNMPVALUE}]
                - Total traffic: Formula = last("ifInOctets[{#SNMPVALUE}]")+last("ifOutOctets[{#SNMPVALUE}]")

                If any of inbound/outbound keys look different - please, change Total formula to correct name of keys.

                And one more time - you cannot have only Total. You need all three Item prototype.

                Finally, typically it takes (3*Update_interval_for_Item + Update_interval_for_Discovery_rule) seconds to fill up all data in Income/Outgoing/Total traffic items.
                Sincerely yours,
                Aleksey

                Comment

                Working...