Community discussions

MikroTik App
 
apiel1
newbie
Topic Author
Posts: 29
Joined: Fri Apr 28, 2017 6:50 pm

Trouble with Custom Function and probe

Fri Mar 23, 2018 5:07 pm

I am trying to build a custom function in the dude 4.0b3 to capture the 1 minute average CPU usage of a Cisco SG300 switch. I have snmp walked the device and determined the specific oid i need is:
1.3.6.1.4.1.9.6.1.101.1.7.0
I have been trying to follow along with the following post to build the function
https://wiki.mikrotik.com/wiki/Getting_ ... and_probes
After the function is built, I would like to build a custom probe and graph the data for the switch. Everything I have tried is giving me a parse failed error on the device service tab when added as a probe. I have attached a picture of the function and probe settings. Could someone please look at this and let me know where i am going wrong here.

Thanks

This is the code for the function
if(array_size(oid_column("1.3.6.1.4.1.9.6.1.101.1.7")),oid("1.3.6.1.4.1.9.6.1.101.1.7.0")+1,"False")
You do not have the required permissions to view the files attached to this post.
 
apiel1
newbie
Topic Author
Posts: 29
Joined: Fri Apr 28, 2017 6:50 pm

Re: Trouble with Custom Function and probe

Fri Mar 30, 2018 5:42 pm

Anyone??
 
User avatar
geoffsmith31
Member Candidate
Member Candidate
Posts: 155
Joined: Fri Nov 05, 2010 6:08 am
Location: Toowoomba, Australia

Re: Trouble with Custom Function and probe

Mon Apr 02, 2018 1:59 am

To determine if the problem is with the function or the probe, try the following:

Right-click the device icon and select appearance. In the Label section put
[Cisco_SG_CPU_a()]
The device icon should then show the CPU % as part of the device label. If it doesn't, then there is probably something wrong with the syntax of the function.
If it does, then the issue is with the syntax of the probe.

I've normally found that syntax issues are to do with backets in the wrong place.

Sorry if this is not an exact answer, but it may help you figure out the problem easier.
 
boxpik
just joined
Posts: 7
Joined: Fri Jul 29, 2016 1:28 am

Re: Trouble with Custom Function and probe

Mon Apr 02, 2018 11:02 am

Try the simplified version, then edit it according for your needs.
Function:
max(array(oid("1.3.6.1.4.1.9.6.1.101.1.7.0"), 1))

Probe:
Available: Cisco_SG_CPU_a()
Error: if(Cisco_SG_CPU_a(), "", "")
Value: Cisco_SG_CPU_a()
Unit: %

Probe interval: 1m

Who is online

Users browsing this forum: No registered users and 62 guests