Community discussions

MikroTik App
 
rgroothuis
Member Candidate
Member Candidate
Topic Author
Posts: 126
Joined: Tue Sep 06, 2016 12:11 am

Dude monitor RegistrationTable unexpected outcome

Tue Mar 15, 2022 11:28 am

I want to monitor and register the number of WIFI clients in my network so that I can measure what the busy times are on the network. I've created a function/probe to get the number of clients with:

ros_command("/caps-man registration-table print count-only")

This will give me a number each time the function/probe is executed, see also screenshot.

When the number of WIFI clients are above 210 I want to get a notification. With the current setup/configuration even that the number is only 23, it is already stating that the number of WIFI clients is above 210. Why? What is wrong in the function?

It looks like the if statement: CountRegisteredClientsTable() > 210 is not returning false even when the number of WIFI client is 23. What is wrong with this IF statement.

Full IF statement (see also screenshot) is: if(CountRegisteredClientsTable() > 210, "Number of WIFI clients below 210", "Number of WIFI Clients above 210! ")
Screenshot 2022-03-15 at 10.24.03.png
Screenshot 2022-03-15 at 10.23.12.png
Screenshot 2022-03-15 at 10.22.54.png
You do not have the required permissions to view the files attached to this post.
 
User avatar
smyers119
Member Candidate
Member Candidate
Posts: 232
Joined: Sat Feb 27, 2021 8:16 pm
Location: USA

Re: Dude monitor RegistrationTable unexpected outcome  [SOLVED]

Tue Mar 15, 2022 2:02 pm

Note: up=no value so it should be:

try:
if(CountRegisteredClientsTable() < 210, "", "Number of WIFI Clients above 210! ")
 
rgroothuis
Member Candidate
Member Candidate
Topic Author
Posts: 126
Joined: Tue Sep 06, 2016 12:11 am

Re: Dude monitor RegistrationTable unexpected outcome

Tue Mar 15, 2022 2:24 pm

Thanks, that is the trick. Strange this reverse logic. I was trying to find the syntax and/or explanation of the error text line but was not able to find anything.
 
User avatar
smyers119
Member Candidate
Member Candidate
Posts: 232
Joined: Sat Feb 27, 2021 8:16 pm
Location: USA

Re: Dude monitor RegistrationTable unexpected outcome

Tue Mar 15, 2022 2:32 pm

Thanks, that is the trick. Strange this reverse logic. I was trying to find the syntax and/or explanation of the error text line but was not able to find anything.
Doesn't have to be I was going off what you already had, below should also work.
if(CountRegisteredClientsTable() > 210, "Number of WIFI Clients above 210! ")

Who is online

Users browsing this forum: No registered users and 13 guests