Community discussions

MikroTik App
 
ezrollin
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 52
Joined: Mon Jul 28, 2014 8:04 am

cpu-load help

Tue Oct 21, 2014 8:06 am

I searched but still having trouble with knowing the syntax to get the cpu-load %.
Am I even close? thanks

:local checkLOAD[/system resource get cpu-load]
if (checkLOAD > 10) do={
:log info "High CPU load"
}
 
User avatar
payday
Member Candidate
Member Candidate
Posts: 233
Joined: Thu Aug 16, 2012 11:05 pm

Re: cpu-load help

Tue Oct 21, 2014 10:01 pm

When you are referencing variables you have to use dollar sign:
if ($checkLOAD > 10) do={
If this variable is not needed later you don't have to create it. You can just write it short in one line:
if ([/system resource get cpu-load] > 10) do={:log info "High CPU load"}
...and 10% is not a high CPU load. ;)
 
ezrollin
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 52
Joined: Mon Jul 28, 2014 8:04 am

Re: cpu-load help

Tue Oct 21, 2014 11:04 pm

Hi,
I just didnt think that was the correct way to get the system cpu load because when I set it low like 10% and I know I'm actually higher than that, nothing happens.
thanks!
 
n21roadie
Forum Guru
Forum Guru
Posts: 1949
Joined: Fri Aug 07, 2009 10:36 pm
Location: Limerick,Ireland

Re: cpu-load help

Wed Oct 22, 2014 5:05 pm

Not sure what you are trying to accomplish but I had a script to detect average CPU % and reboot if 100% but I quickly discovered if the CPU was running at 100%, it would not run this script correctly and would either not complete or give incorrect average results and not reboot the router?

My plan now to detect if a AP CPU is running at 100% is to run a script on a few CPE's to obtain ping time average to several websites and send email alert if result is above a certain level?

Who is online

Users browsing this forum: No registered users and 7 guests