Monitoring the number of active calls in a gateway from HUM

Answered Question
Feb 10th, 2010

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.

I have this problem too.
0 votes
Correct Answer by Joe Clarke about 6 years 9 months ago

Okay, let's try this:

snmpset -v 2c -c private router expNameStatus.110.110.110.110.110 i 6<br/>snmpset -v 2c -c private router expNameStatus.110.110.110.110.110 i 5<br/>snmpset -v 2c -c private router expExpressionIndex.110.110.110.110.110 gauge 1<br/>snmpset -v 2c -c private router expExpressionComment.1 octetstring "numeroEntradas"<br/>snmpset -v 2c -c private router expExpression.1 octetstring '$1 >= 1'<br/>snmpset -v 2c -c private router expObjectID.1.1 o 1.3.6.1.4.1.9.9.63.1.3.1.1.5<br/>snmpset -v 2c -c private router expExpressionValueType.1 i 4<br/>snmpset -v 2c -c private router expObjectIDWildcard.1.1 i 1<br/>snmpset -v 2c -c private router expObjectStatus.1.1 i 1<br/>snmpset -v 2c -c private router expNameStatus.110.110.110.110.110 i 1<br/><br/>snmpset -v 2c -c private router expNameStatus.111.111.111.111.111 i 6<br/>snmpset -v 2c -c private router expNameStatus.111.111.111.111.111 i 5<br/>snmpset -v 2c -c private router expExpressionIndex.111.111.111.111.111 gauge 2<br/>snmpset -v 2c -c private router expExpressionComment.2 octetstring "sumaEntradas"<br/>snmpset -v 2c -c private router expExpression.2 octetstring 'sum($1)'<br/>snmpset -v 2c -c private router expObjectID.2.1 o expValueInteger32Val.1.0.0<br/>snmpset -v 2c -c private router expExpressionValueType.2 i 4<br/>snmpset -v 2c -c private router expObjectIDWildcard.2.1 i 1<br/>snmpset -v 2c -c private router expObjectStatus.2.1 i 1<br/>snmpset -v 2c -c private router expNameStatus.111.111.111.111.111 i 1<br/>
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (11 ratings)
Loading.
Joe Clarke Wed, 02/10/2010 - 16:55

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).

Joe Clarke Wed, 02/10/2010 - 17:03

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.

cmartinvalle Thu, 02/11/2010 - 10:11

Great!

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

Regards.

Joe Clarke Thu, 02/11/2010 - 10:51

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

cmartinvalle Mon, 02/15/2010 - 13:58

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.

Joe Clarke Mon, 02/15/2010 - 21:14

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. 

cmartinvalle Mon, 02/22/2010 - 07:26

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.

Joe Clarke Mon, 02/22/2010 - 09:32

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.

cmartinvalle Wed, 02/24/2010 - 10:01

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.

Joe Clarke Wed, 02/24/2010 - 22:02

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

cmartinvalle Thu, 02/25/2010 - 03:35

Upps! Sorry.

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

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

Many thanks!

Joe Clarke Sat, 02/27/2010 - 11:44

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.

cmartinvalle Tue, 03/02/2010 - 08:06


Hi, I've only changed the command:

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

with:

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

and

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

because, an error message appeared if not using the index. So, finally, the commands used are the following:

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.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

But there are no entries in the expValueInteger32Val OID, so later, in the sum expression, there is no elements to sum. Please, find attached 2 files with the snmpwalk outputs.

How could we get to have values in expValueTable?

Many thanks.

Joe Clarke Tue, 03/02/2010 - 12:08

Yes, sorry, I forgot the indexes.  Post the output of an SNMP Walk of

1.3.6.1.4.1.9.9.63.1.3.1.1<br/>
Correct Answer
Joe Clarke Thu, 03/04/2010 - 11:31

Okay, let's try this:

snmpset -v 2c -c private router expNameStatus.110.110.110.110.110 i 6<br/>snmpset -v 2c -c private router expNameStatus.110.110.110.110.110 i 5<br/>snmpset -v 2c -c private router expExpressionIndex.110.110.110.110.110 gauge 1<br/>snmpset -v 2c -c private router expExpressionComment.1 octetstring "numeroEntradas"<br/>snmpset -v 2c -c private router expExpression.1 octetstring '$1 >= 1'<br/>snmpset -v 2c -c private router expObjectID.1.1 o 1.3.6.1.4.1.9.9.63.1.3.1.1.5<br/>snmpset -v 2c -c private router expExpressionValueType.1 i 4<br/>snmpset -v 2c -c private router expObjectIDWildcard.1.1 i 1<br/>snmpset -v 2c -c private router expObjectStatus.1.1 i 1<br/>snmpset -v 2c -c private router expNameStatus.110.110.110.110.110 i 1<br/><br/>snmpset -v 2c -c private router expNameStatus.111.111.111.111.111 i 6<br/>snmpset -v 2c -c private router expNameStatus.111.111.111.111.111 i 5<br/>snmpset -v 2c -c private router expExpressionIndex.111.111.111.111.111 gauge 2<br/>snmpset -v 2c -c private router expExpressionComment.2 octetstring "sumaEntradas"<br/>snmpset -v 2c -c private router expExpression.2 octetstring 'sum($1)'<br/>snmpset -v 2c -c private router expObjectID.2.1 o expValueInteger32Val.1.0.0<br/>snmpset -v 2c -c private router expExpressionValueType.2 i 4<br/>snmpset -v 2c -c private router expObjectIDWildcard.2.1 i 1<br/>snmpset -v 2c -c private router expObjectStatus.2.1 i 1<br/>snmpset -v 2c -c private router expNameStatus.111.111.111.111.111 i 1<br/>
cmartinvalle Mon, 03/08/2010 - 08:28

Great!!! It works!!!! Thank you very much!!!!

We can retrieve the number of active calls asking to the OID 1.3.6.1.4.1.9.10.22.1.4.1.1.4.2.0.0 by means of snmpwalk command but now I have another problem : I cannot query that OID from HUM. I have loaded the Expression-MIB and create a new template but, when defining the OID while creating the template, it's impossible to choose this OID. I can choose the expValueInteger32Val, but an error message appears when HUM look for the instances.

How can we choose this 1.3.6.1.4.1.9.10.22.1.4.1.1.4.2.0.0 OID?

Thank you very much.

cmartinvalle Mon, 03/08/2010 - 13:46

Great, the calculation works!!!!

We can retrieve the number of active calls asking to the OID 1.3.6.1.4.1.9.10.22.1.4.1.1.4.2.0.0 by means of snmpwalk command but now I have another problem : I cannot query that OID from HUM. I have loaded the Expression-MIB and create a new template but, when defining the OID while creating the template, it's impossible to choose this OID. I can choose the expValueInteger32Val, but an error message appears when HUM look for the instances.

How can we choose this 1.3.6.1.4.1.9.10.22.1.4.1.1.4.2.0.0 OID?

Joe Clarke Mon, 03/08/2010 - 22:24

It's working for me.  I have HUM 1.2.1, and I loaded the EXPRESSION-MIB, then defined a Template for expValueInteger32Val.  I then defined a poller, and when I clicked Next, I saw all the instances of that object on the device.  You should see one of those instances as 2.0.0.0.  I didn't get any errors, and the poller is now running.

cmartinvalle Tue, 03/09/2010 - 08:47

OK, we're going to update HUM to version 1.2.1 and we will try to define the poller again. I will keep you updated.

Thank you very much for your help!

cmartinvalle Wed, 03/10/2010 - 06:30

Hi, finally we have updated to HUM 1.2.1 and have created again the template for expValueInteger32Val but when defining the poller, we see only the 1.0.0.* values (the active calls IDs) but not the 2.0.0.0. I don't know what it's happening because if we execute a snmpwalk to the 2.0.0.0 OID, we can see its value.

How can we get in HUM the OID we need? Is it necessary to configure the Expression MIB persistence?

Please find attached a file with the output of the snmpwalk and 2  screenshots with the poller and template created.

Attachment: 
cmartinvalle Wed, 03/10/2010 - 08:50

Hi, I get this:

E:\CSCOpx\objects\jt\bin>snmpwalk.exe -v 2c -c comm 10.132.15.4 .1.3.6.1.4.1.9.10.22.1.4.1

iso.3.6.1.4.1.9.10.22.1.4.1.1.4.1.0.0.3949614539.1 = INTEGER: 1
iso.3.6.1.4.1.9.10.22.1.4.1.1.4.1.0.0.3949715557.1 = INTEGER: 1
iso.3.6.1.4.1.9.10.22.1.4.1.1.4.1.0.0.3949721347.1 = INTEGER: 1
iso.3.6.1.4.1.9.10.22.1.4.1.1.4.1.0.0.3949727014.1 = INTEGER: 1
iso.3.6.1.4.1.9.10.22.1.4.1.1.4.1.0.0.3949731285.1 = INTEGER: 1
iso.3.6.1.4.1.9.10.22.1.4.1.1.4.2.0.0.0 = INTEGER: 5

Joe Clarke Wed, 03/10/2010 - 11:28

Those indexes may be causing a problem.  I don't have a router with dial or voice on which to test, so I was using instances from the ifTable (essentially I just counted all of my interfaces).  I didn't see any problems.  Perhaps HUM can't deal with wrapping of the 32-bit signed numbers.  Post a sniffer trace of all SNMP traffic to this router when trying to define a poller.

Joe Clarke Fri, 03/12/2010 - 15:21

You have stumbled across a fundamental flaw in our SNMP manager stack in LMS.  It cannot properly encode OID elements which exceed the signed 32-bit maximum (2^31-1).  Therefore, HUM is unable to properly walk the rows of the expValueTable as you have defined them.  I believe I have created a working patch for this, but I cannot test it.  If you want to try it, you can open a TAC service request, and have your engineer contact me directly.  I will warn you, though, that the code being touched is central to numerous components in LMS, and may cause some unforeseen problems.

Joe Clarke Sat, 03/13/2010 - 16:29

I should also point out that in your case, the large indexes are coming from the fact that your device has been up for a while.  If you reload the device, then recreate your expressions, the index will be low.  You can then define your poller, and it should continue to work even after the device has been up over 249 days.

cmartinvalle Mon, 03/15/2010 - 09:49

Great!! Thank you very much for your involvement with this issue, I really appreciate it. I have opened a TAC service request in order to get the patch.

Would this patch be available as an update in following dates? I ask it because, if it is going to be tested, our customer preffers to wait until it will be released as an official update.

cmartinvalle Wed, 03/17/2010 - 10:01

Hi, we have contacted TAC for getting the patch and we have started the LMS following the steps required but unfortunatelly the result is the same and HUM is still unable to manage the OID we need.

Joe Clarke Wed, 03/17/2010 - 10:11

Confirm with TAC that the patch is properly installed, and the file which was installed has the proper checksum.  Then get a sniffer trace to confirm the problem.

cmartinvalle Wed, 03/17/2010 - 10:11

/* Style Definitions */ table.MsoNormalTable {mso-style-name:"Tabla normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin-top:0cm; mso-para-margin-right:0cm; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0cm; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin;} Hi, we have contacted the TAC and they have passed the patch to us. We have started the LMS following the steps that TAC has told us but HUM is still unable to manage the OID we need and the result is the same (we can see the active calls OIDs but not their sum). We have also tried with another router with sysUpTime less than 249 days but with the same result. Please find attached a new capture of a sniffer taken when creating the poller.

What else can we try?

Joe Clarke Wed, 03/17/2010 - 10:26

This device has been up for ~ 464 days.  If this is a trace of HUM, then the patch does appear to be working.  HUM is not sending the invalid OID, and it is getting to the end of the expValueTable.  What are you seeing in HUM now?

cmartinvalle Wed, 03/17/2010 - 10:56

Yes, this device is up for 464 days but we have tried in another one that is up for 246 days.

Now in HUM we see the active calls (the iso.3.6.1.4.1.9.10.22.1.4.1.1.4.1.0.0.*.1 entries) but not the iso.3.6.1.4.1.9.10.22.1.4.1.1.4.2.0.0.0 entry (which is the one we need). I can send you a screenshot to you tomorrow because now the customer has finished his working day.

Joe Clarke Wed, 03/17/2010 - 15:50

Seeing the screenshot as well as the screenshot from the router which has not been up as long would be helpful.  I couldn't reproduce when I used signed indexes.

cmartinvalle Thu, 03/18/2010 - 09:37

Hi, please find attached 2 compressed files:

- Nicaragua.rar: it contains the output of a snmpwalk, the screenshot and a sniffer trace of the router that it's up for almost 500 days.

- Colombia.rar: it contains the same files but applied to the other router (that it's up for 247 days).

Thank you very much.

Joe Clarke Thu, 03/18/2010 - 23:14

I see no obvious problems here  I tried again to reproduce, even using some indexes close to the signed 32-bit limit, and I cannot reproduce.  The patch is working correctly, so there must be something wrong with your HUM setup.  I recommend you work with your TAC engineer to schedule a WebEx session with the end customer so this can be analyzed in real time.

cmartinvalle Mon, 03/22/2010 - 07:50

OK, then I will get in contact with the TAC in order to schedule a WebEx session.

Thank you very very much for your help with this issue!

Actions

This Discussion