DX NetOps Manager

Expand all | Collapse all

Vendor Certification: Get the number of entries

Jump to Best Answer
  • 1.  Vendor Certification: Get the number of entries

    Posted 07-03-2017 04:58 PM

    I created a metric family to collect E1 utilization in my voice gateways. The metric family has 3 metrics:

     

    inUse: total channels in use

    total: total number of channels available

    utilizationinUse / total * 100

     

    getting inUse is simple since I have an OID with that information. There is no OID for total, but I could calculate the total multiplying the total number of entries of a table by 30. Is that possible? What I want is like getting the number of interfaces of a router by counting the number of entries of an OID like ifName for example.



  • 2.  Re: Vendor Certification: Get the number of entries
    Best Answer

    Posted 07-04-2017 02:34 AM

    Hello,

    yes, starting with PM 2.8 you can use explicit snmpGet / snmpGetTable calls in your vendor cert.

    See Functions and Global Variables - CA Performance Management - 3.1 - CA Technologies Documentation 

    For example, see the following snippet with a variable to calculate the number of interfaces with operUpStatus.

    If you just need the number of elements, then list.size() would be your friend.

     

    <Expressions>
    <ExpressionGroup destCert="{http://im.ca.com/normalizer}NormalizedInterfaceStatistics" name="InterfaceStatsTable">
    <VariableGroup>
    <Variable name="operUpStatus">
    response=snmpGetTable("1.3.6.1.2.1.2.2.1.8");
    list=response.getResult();
    status=0;
    for (i=0; i &lt; list.size(); i++) {
    value=list.get(i).getValue();
    if (value==1) {
    status++;
    }
    };
    return status;
    </Variable>

    ....

    </VariableGroup>

    ...

    use that variable in the metric assignment such as

    <Expression destAttr="InterfaceOperUpStatus">operUpStatus</Expression>

     

    Hope that helps,

    Lutz.