Community discussions

MikroTik App
 
User avatar
Stubbed
just joined
Topic Author
Posts: 15
Joined: Tue May 13, 2008 8:18 am

Probe Help

Thu Jul 21, 2011 3:23 am

From what I can tell The Dude doesn't differentiate between "0" and a Null reply as being different. I have some probes setup where a result of "0" is perfectly acceptable, but a Null result is an actual down.

Unfortunately when using the built in if function it appears to treat them the same, so I can't get a realistic Up/Down status.

Any easy way around this?
 
User avatar
geoffsmith31
Member Candidate
Member Candidate
Posts: 155
Joined: Fri Nov 05, 2010 6:08 am
Location: Toowoomba, Australia

Re: Probe Help

Sat Jul 23, 2011 5:20 am

I had the same issue and have encapsulated the "real" probe test within a test to see if the device is responding to SNMP queries. This has solved my false positives.

This is the probe I am using to test if batteries need to be replaced in an APC UPS. First it cheks to see if the UPS will return its description OID. If not the probe is marked as "Down". If anything comes back as the description then the value of the "replace battery" OID is tested.

if(string_size(snmp_description())=0,"Down",if(oid_raw("1.3.6.1.4.1.318.1.1.1.2.2.4.0")=1, "", oid("1.3.6.1.4.1.318.1.1.1.2.2.4.0")))
 
lebowski
Forum Guru
Forum Guru
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: Probe Help

Mon Jul 25, 2011 5:22 pm

Yes this is so frustrating 0 is not down. If you get a result from SNMP and it is 0 that is a VALID result but the dude has been broke for years in this aspect. You can find several posts of mine trying to deal with it. For now I use a function to get the value and add 1 to it then I subtract 1 from it when I check the value. A Cisco CPU can run an average 0%. I suppose I could subtract 1 when I graph as well...

Also to eliminate false positives I reduce the negative cache time to 10 seconds and the cache time to 5 seconds as well as return false instead of 0 if the device is not responding. This takes a lot of extra work but once done the dude works much smoother.

Cisco_CPU function
if(array_size(oid_column("1.3.6.1.4.1.9.2.1.57", 10 ,5)), oid("1.3.6.1.4.1.9.2.1.57.0", 10, 5)+1 ,"False")

Cisco_CPU Probe
Available:Cisco_CPU_a() <> "False"
Error: if(Cisco_CPU_a()<>"False",if(Cisco_CPU_a() -1< 70, "", concatenate("Warning: high CPU = ", Cisco_CPU_a(), "%")), "Cisco Device down")
Value: oid("1.3.6.1.4.1.9.2.1.57.0", 10, 29)

Who is online

Users browsing this forum: No registered users and 24 guests