Community discussions

MikroTik App
 
cicserver
Member
Member
Topic Author
Posts: 303
Joined: Sun Jul 24, 2011 12:04 pm

Display Value divid formula [SOLVED]

Tue Sep 02, 2014 12:55 pm

I have a Temperature & Humidity monitoring device (Emerson IRM-S02TH)
I can get its value via snmp, but it gives value like this

temperature,
1.3.6.1.4.1.13400.2.62.2.1.2.0 = 2220
so to show it correctly in Dude DISPLAY, i use this
Temperature: [oid("1.3.6.1.4.1.13400.2.62.2.1.2.0")/100] 
and it works fine. and shows proper temperature like 22.x

Now i have a probe which should warn me if temperature goes above but how can I insert DIVIDE value

PROBE:
Name: NOC Room Temperature Over 
Type: Function
Available: if(oid("1.3.6.1.4.1.13400.2.62.2.1.2.0")0, 1, -1)
Error: if(oid("1.3.6.1.4.1.13400.2.62.2.1.2.0")<25, "", "NOC Room Temperature above 25 c,  Please check A.C")
Value: 1.3.6.1.4.1.13400.2.62.2.1.2.0
Unit: C
( If I enter value 2500, it give me error of not available)
Last edited by cicserver on Wed Sep 03, 2014 12:45 pm, edited 1 time in total.
 
User avatar
tomaskir
Trainer
Trainer
Posts: 1162
Joined: Sat Sep 24, 2011 2:32 pm
Location: Slovakia

Re: Display Value divid formula

Tue Sep 02, 2014 1:14 pm

Create a function which will read and divide the temperature:
name: getTemperature
Code: oid("1.3.6.1.4.1.13400.2.62.2.1.2.0") / 100

Use that function in the probe:
Value: getTemperature()
 
cicserver
Member
Member
Topic Author
Posts: 303
Joined: Sun Jul 24, 2011 12:04 pm

Re: Display Value divid formula

Tue Sep 02, 2014 1:24 pm

I created FUNCTION as you suggested, but still I am not getting DIVIDED value. see the snap of my Function & PROBE.
1234.JPG
123.jpg
You do not have the required permissions to view the files attached to this post.
 
User avatar
tomaskir
Trainer
Trainer
Posts: 1162
Joined: Sat Sep 24, 2011 2:32 pm
Location: Slovakia

Re: Display Value divid formula

Tue Sep 02, 2014 1:52 pm

Try to use that function in the label display, to see if the function returns a correct value.
 
cicserver
Member
Member
Topic Author
Posts: 303
Joined: Sun Jul 24, 2011 12:04 pm

Re: Display Value divid formula

Tue Sep 02, 2014 1:55 pm

Try to use that function in the label display, to see if the function returns a correct value.
Yes I am getting value in appearance / label. something like
temp.JPG
You do not have the required permissions to view the files attached to this post.
Last edited by cicserver on Tue Sep 02, 2014 2:01 pm, edited 1 time in total.
 
User avatar
tomaskir
Trainer
Trainer
Posts: 1162
Joined: Sat Sep 24, 2011 2:32 pm
Location: Slovakia

Re: Display Value divid formula

Tue Sep 02, 2014 2:00 pm

Go to the device's label on the map, go to Appearance.

In "Label" field, click it, you can modify it. To use a function in there, use it in this format:
Temp from function: [getTemperature()]c
Just add that below all that is already in there.
 
cicserver
Member
Member
Topic Author
Posts: 303
Joined: Sun Jul 24, 2011 12:04 pm

Re: Display Value divid formula

Tue Sep 02, 2014 2:02 pm

yes i m getting value in appearance using the FUNCTION. but unabel to get DIVIDED value in the FUNCTION/PROBE :(
temp.JPG
You do not have the required permissions to view the files attached to this post.
 
User avatar
tomaskir
Trainer
Trainer
Posts: 1162
Joined: Sat Sep 24, 2011 2:32 pm
Location: Slovakia

Re: Display Value divid formula

Tue Sep 02, 2014 2:35 pm

If the function returns correctly in the label, it has to return correctly in the Probe as well.

Check if you have multiple Probes, check if you are using the right Probe, check if you didnt accidentaly click Cancel when saving the Probe etc.

It really should work, lets check if its not something simple first :)
 
lebowski
Forum Guru
Forum Guru
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: Display Value divid formula

Tue Sep 02, 2014 6:47 pm

Your error line on your probe shoould be;
if(getTemperature()<25, "", "NOC Room Temperature above 25 c, Please check A.C")

Lebowski
 
User avatar
tomaskir
Trainer
Trainer
Posts: 1162
Joined: Sat Sep 24, 2011 2:32 pm
Location: Slovakia

Re: Display Value divid formula

Tue Sep 02, 2014 7:26 pm

Your error line on your probe shoould be;
if(getTemperature()<25, "", "NOC Room Temperature above 25 c, Please check A.C")

Lebowski
Nice catch, exactly! :)
 
cicserver
Member
Member
Topic Author
Posts: 303
Joined: Sun Jul 24, 2011 12:04 pm

Re: Display Value divid formula

Wed Sep 03, 2014 11:56 am

Finally got it. I think I had to add "getTemperature()" in AVAILABLE section too. attached is image of working config.
Thank you every one for your suggestions and guidance which encourage me to solve the issue :) ,

So I guess encouragement is the key to success ;)
final_resukltok.JPG
You do not have the required permissions to view the files attached to this post.

Who is online

Users browsing this forum: No registered users and 3 guests