cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4544
Views
55
Helpful
39
Replies

Monitoring the number of active calls in a gateway from HUM

cmartinvalle
Level 1
Level 1

Hi,

we are configuring HUM and we want to display the number of active calls in a gateway but we can't find any OID's that show exactly what we want. So we are going to use the EXPRESSION-MIB in order to calculate some values we need.

In MRTG we launch a snmpwalk query against the OID 1.3.6.1.4.1.9.9.63.1.3.1.1.9 (cvCallActiveInSignalLevel) and we count with a counter the number of rows obtained from that snmpwalk. The calculation is as follows:

@ret=snmpwalk(sigint03.'@'.'x.x.x.x'.'1.3.6.1.4.1.9.9.63.1.3.1.1.9');

foreach $campo (@ret) {

     $cuenta=$cuenta+1;

}

print $cuenta."\n";

But we don't know how to implement the "foreach" loop with the EXPRESSION-MIB... and we don't know any other way for getting the number of active calls.

Can anybody please help me?

Regards.

1 Accepted Solution

Accepted Solutions

Okay, let's try this:

snmpset -v 2c -c private router expNameStatus.110.110.110.110.110 i 6
snmpset -v 2c -c private router expNameStatus.110.110.110.110.110 i 5
snmpset -v 2c -c private router expExpressionIndex.110.110.110.110.110 gauge 1
snmpset -v 2c -c private router expExpressionComment.1 octetstring "numeroEntradas"
snmpset -v 2c -c private router expExpression.1 octetstring '$1 >= 1'
snmpset -v 2c -c private router expObjectID.1.1 o 1.3.6.1.4.1.9.9.63.1.3.1.1.5
snmpset -v 2c -c private router expExpressionValueType.1 i 4
snmpset -v 2c -c private router expObjectIDWildcard.1.1 i 1
snmpset -v 2c -c private router expObjectStatus.1.1 i 1
snmpset -v 2c -c private router expNameStatus.110.110.110.110.110 i 1

snmpset -v 2c -c private router expNameStatus.111.111.111.111.111 i 6
snmpset -v 2c -c private router expNameStatus.111.111.111.111.111 i 5
snmpset -v 2c -c private router expExpressionIndex.111.111.111.111.111 gauge 2
snmpset -v 2c -c private router expExpressionComment.2 octetstring "sumaEntradas"
snmpset -v 2c -c private router expExpression.2 octetstring 'sum($1)'
snmpset -v 2c -c private router expObjectID.2.1 o expValueInteger32Val.1.0.0
snmpset -v 2c -c private router expExpressionValueType.2 i 4
snmpset -v 2c -c private router expObjectIDWildcard.2.1 i 1
snmpset -v 2c -c private router expObjectStatus.2.1 i 1
snmpset -v 2c -c private router expNameStatus.111.111.111.111.111 i 1

View solution in original post

39 Replies 39

Joe Clarke
Cisco Employee
Cisco Employee

What version of IOS as the EXPRESSION-MIB objects will be different depending on the version?  Essentially, though, you will use a wildcard to sum up all of the instances.  See the comments in the EXPRESSION-MIB for more details.  Essentially, your object will be 1.3.6.1.4.1.9.9.63.1.3.1.1.9, and you will use a wildcard with the expression sum($1).

Whoops, I think I missed a step.  You're just checking to see if this object is set, then adding to your count.  In that case, you will need two expressions.  The second will be sum($1) as I said (but using an EXPRESSION-MIB OID), but the first will exists($1) using the 1.3.6.1.4.1.9.9.63.1.3.1.1.9 OID.

Great!

Where can I find more information about these wildcards? I cannot find anything...

Regards.

It's all documented in the EXPRESSION-MIB.  Look at the comments under "Wildcarding example" and the documentation of the expExpression object.

Sorry but it's my first time with the EXPRESSION-MIB and I'm very confused

So I don't know how to implement the counter I need: if I use the calculation counter32(.*), do I have the number of entries in the table?

Thank you very much.

You shouldn't be using counter(32) as your expression.  I'm fairly confident that using exists($1) for your first expression and sum($1) as your second expression should work. 

I have to check of the object is set and then adding to the count, but these objects are part of 1.3.6.1.4.1.9.9.63.1.3.1.1.9 OID, and its type is integer32, do I have to check for all the possible objects??? Or can I do it with exists($1), and $1=1.3.6.1.4.1.9.9.63.1.3.1.1..* ?

I have written down the expressions as I think they are but I'm afraid of not being well and they can cause a crash in the device. File with the expressions is attached.

I will appreciate a lot if you could take a look at them.

You need to leave the ".*" off of the end of the OIDs.  For wildcards, just put in the OID without any instances, then set the wildcard object to true.  Your sum($2) expression should be sum($1).  And your second OID needs to point to the entry in expValueTable:

expValueInteger32Val.1.0.0

I think everything else is right.

Hi, I've applied the snmpset commands but it doesn' work. The entry in expValueTable seems to be empty. Please find attached the sequence of commands and the results of some snmpwalks. Could you please help me to debug the expression?

Many thanks.

I still don't know the version of IOS you're using.  Knowing that would allow me to properly test things locally.

Upps! Sorry.

I'm trying with a couple of routers which have following IOS:

- 12.4(3e)
- 12.4(11)T4

Many thanks!

Thanks, I'll play with this tomorrow, and send you an update.

Many thanks, I appreciate your help.

First, 12.4(11)T supports a new standards version of the EXPRESSION-MIB with an entire new object ID, and new configuration structure.  But, as for 12.4 mainline, this should get you what you want:

snmpset -v 2c -c private router expNameStatus.110.110.110.110.110 i 6

snmpset -v 2c -c private router expNameStatus.110.110.110.110.110 i 5

snmpset -v 2c -c private router expExpressionIndex.110.110.110.110.110 gauge 1

snmpset -v 2c -c private router expExpressionComment.1 octetstring "numeroEntradas"

snmpset -v 2c -c private router expExpression.1 octetstring '$1 >= 0'

snmpset -v 2c -c private router expObjectID.1.1 o 1.3.6.1.4.1.9.9.63.1.3.1.1.1

snmpset -v 2c -c private router expExpressionValueType i 4

snmpset -v 2c -c private router expObjectIDWildcard.1.1 i 1

snmpset -v 2c -c private router expObjectStatus.1.1 i 1

snmpset -v 2c -c private router expNameStatus.110.110.110.110.110 i 1

snmpset -v 2c -c private router expNameStatus.111.111.111.111.111 i 6

snmpset -v 2c -c private router expNameStatus.111.111.111.111.111 i 5

snmpset -v 2c -c private router expExpressionIndex.101.50.101.120.112 gauge 2

snmpset -v 2c -c private router expExpressionComment.2 octetstring "sumaEntradas"

snmpset -v 2c -c private router expExpression.2 octetstring 'sum($1)'

snmpset -v 2c -c private router expObjectID.2.1 o expValueInteger32Val.1.0.0

snmpset -v 2c -c private router expExpressionValueType i 4

snmpset -v 2c -c private router expObjectIDWildcard.2.1 i 1

snmpset -v 2c -c private router expObjectStatus.2.1 i 1

snmpset -v 2c -c private router expNameStatus.111.111.111.111.111 i 1

Then, an snmpget on expValueInteger32.2.0.0.0 should give you the sum.  Confirm this works before moving on to the new syntax.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Innovations in Cisco Full Stack Observability - A new webinar from Cisco