I am not sure what is supposed to be happening here but normally I would create a function to return a value or false. Then in the probe error line perform the error checking.
For example here is a function that returns Linux CPU or false;
LinuxCPU: if(string_size(oid(“1.3.6.1.4.1.2620.1.6.7.2.4.0”,10,5)), oid(“1.3.6.1.4.1.2620.1.6.7.2.4.0”,10,5)+1,“False”)
Then in the probe Check for false in the available line
Available: Linux_CPU_a() <> “False”
Then in the error line if there is a value it will be returned and then checked to see if it is higher than 92% if so it will warn high cpu or if it is false it will complain that the value failed to be read.
Error: if(Linux_CPU_a()<>“False”, if(Linux_CPU_a() -1< 92, “”, concatenate(“Warning: high CPU =”, Linux_CPU_a(), “%”)) , “Failed to read CPU OID”)
NOTE I add 1 in case 0% CPU, you can subtract it on the graphing line and the error line…
Change the function to return a value or false. NOTE: I don’t know what value is supposed to be returned. if it is 0 that is reverse logic since 0 is FALSE, add 1 to make it true.
Function:
rogue:if(ros_command(“/interface bridge filter print count-only where comment=rogue”)=0,ros_command(“/interface bridge filter print count-only where comment=rogue”),“False”))
Available line
Available: rogue() <> “False”
Probe error line
Error: if(rogue()<>“False”, if(rogue()=1, “”, concatenate(“Rogue has is what=”, rogue(), “device”)) , “Rogue tracking counter is False”)
Sorry I can not test this but if you are able to use this function then you can mess with negative cache times to fix false positives. Search my posts on negative cache.
If negative cache is causing your issue this should fix it.
This will not fix your issue but the code in your existing available line is going to be evaluated as always true by the dude
An often overlooked troubleshooting tip is to place your function on a device label and examine the return values.
You can place these on a device label to better understand the evaluation of variables…
[rogue()]
[if(0,“zero is true”,“zero is false”)]
[if(1,“one is true”,“one is false”)]
[if(-1,“-1 is true”,“-1 is false”)]#