Mon Oct 01, 2012 5:03 pm
The problem is there is no way to set a variable in the dude, what you would do is find the array size in
iso.org.dod.internet.private.enterprises.mot.whispRoot.whispProducts.whispAps.whispLinkTable.whispLinkEntry.linkReRegCount.1
Then do a loop (which also does not exist) through the array of values.... This functionality would really shine. Mikrotik!
It is possible to build a series of if statements you will have to build it to have a maximum number of ifs and just configure it to return 1 even if that oid is not present. For example each if statement that didn't end in error would call another if statement, you could make it recurse 10 times so it would track the first 10 connections on the AP.
I would be very careful if you run this kind of thing on hundreds of access points since the dude has an upper limit of the number of ifs it can process in a given time frame. It is in the 10,000 range but I have broke my dude setup by running through too many ifs.
The array of if statements method would "break" when the first if statement read a value over 5 and then it would send you an email, what would you do then, reset the count or go visit the offending wireless user? Then determine if their machine is acting screwy?
If I was going to build this (the only way it can seem to work with out variables) I would start like this...
Note: adding 1 keeps the code running since an empty OID returns "false" which would stop further code from running.
Test 1 user;
if(oid("linkReRegCount.1")+1>6,,"User 1 exceeds reasonable re-registration count")
Test 2 users;
if(oid("linkReRegCount.1")+1>6,
if(oid("linkReRegCount.2")+1>6,
,"User 2 exceeds reasonable re-registration count")
,"User 1 exceeds reasonable re-registration count")
Test 3 users;
if(oid("linkReRegCount.1")+1>6,
if(oid("linkReRegCount.2")+1>6,
if(oid("linkReRegCount.3")+1>6,
,"User 3 exceeds reasonable re-registration count")
,"User 2 exceeds reasonable re-registration count")
,"User 1 exceeds reasonable re-registration count")
Test 4 users;
if(oid("linkReRegCount.1")+1>6,
if(oid("linkReRegCount.2")+1>6,
if(oid("linkReRegCount.3")+1>6,
if(oid("linkReRegCount.4")+1>6,
,"User 4 exceeds reasonable re-registration count")
,"User 3 exceeds reasonable re-registration count")
,"User 2 exceeds reasonable re-registration count")
,"User 1 exceeds reasonable re-registration count")
Just make that as big as you want to and make it a function then make a probe that calls the function.
The function...
name:reregchk9
if(oid("linkReRegCount.1")+1>6,
if(oid("linkReRegCount.2")+1>6,
if(oid("linkReRegCount.3")+1>6,
if(oid("linkReRegCount.4")+1>6,
if(oid("linkReRegCount.5")+1>6,
if(oid("linkReRegCount.6")+1>6,
if(oid("linkReRegCount.7")+1>6,
if(oid("linkReRegCount.8")+1>6,
if(oid("linkReRegCount.9")+1>6,
,"User 9 exceeds reasonable re-registration count")
,"User 8 exceeds reasonable re-registration count")
,"User 7 exceeds reasonable re-registration count")
,"User 6 exceeds reasonable re-registration count")
,"User 5 exceeds reasonable re-registration count")
,"User 4 exceeds reasonable re-registration count")
,"User 3 exceeds reasonable re-registration count")
,"User 2 exceeds reasonable re-registration count")
,"User 1 exceeds reasonable re-registration count")
The probe...
In the available line of the probe you can put "1" but if you are using auto discover this service will be added to every device automatically.
Try to put something that determines if the device is an ap. if(oid"device type"=ap1200) - this type of statement in an available line needs to be tested extensively.
In the error line just call the function.
if(reregchk9(),"","something else went wrong")
Graphing is a pita since you don't want to graph the last value read and you have to manually remove graphing from every device you add the probe to.
Note: Replace linkReRegCount with the entire oid.
HTH,
Lebowski
[Edit - spelling, grammar, and readability]