Network Router User Manual

A-22
Cisco 7304 Router MIB Specifications Guide
OL-4925-02
Appendix A Using MIBs
Monitoring Quality of Service
Sample QoS Applications
This section presents examples of sample code showing how to retrieve information from the
CISCO-CLASS-BASED-QOS-MIB to use for QoS billing operations. You can use these examples to
help you develop billing applications. The sample code shows how to:
Checking Customer Interfaces for Service Policies
Retrieving QoS Billing Information
Checking Customer Interfaces for Service Policies
This section describes a sample algorithm that checks the CISCO-CLASS-BASED-QOS-MIB for
customer interfaces with service policies, and marks those interfaces for further application processing
(such as billing for QoS services).
The algorithm uses two SNMP get-next requests for each customer interface. For example, if the router
has 2000 customer interfaces, 4000 SNMP get-next requests are required to determine whether those
interfaces have transmit and receive service policies associated with them.
Note This algorithm is for informational purposes only. Your application needs may be different.
Check the MIB to see which interfaces are associated with a customer. Create a pair of flags to show
whether a service policy has been associated with the transmit and receive directions of a customer
interface. Mark non-customer interfaces TRUE (so no more processing is required for them).
FOR each ifEntry DO
IF (ifEntry represents a customer interface) THEN
servicePolicyAssociated[ifIndex].transmit = FALSE;
servicePolicyAssociated[ifIndex].receive = FALSE;
ELSE
servicePolicyAssociated[ifIndex].transmit = TRUE;
servicePolicyAssociated[ifIndex].receive = TRUE;
END-IF
END-FOR
Examine the cbQosServicePolicyTable and mark each customer interface that has a service policy
attached to it. Also note the direction of the interface.
x = 0;
done = FALSE;
WHILE (!done)
status = snmp-getnext (
ifIndex = cbQosIfIndex.x,
direction = cbQosPolicyDirection.x
);
IF (status != ‘noError’) THEN
done = TRUE
ELSE
x = extract cbQosPolicyIndex from response;
IF (direction == ‘output’) THEN
servicePolicyAssociated[ifIndex].transmit = TRUE;
ELSE
servicePolicyAssociated[ifIndex].receive = TRUE;
END-IF
END-IF
END-WHILE