Community discussions

MikroTik App
 
User avatar
vixxant
newbie
Topic Author
Posts: 38
Joined: Thu Mar 17, 2011 7:36 pm
Contact:

SMS and check interface usage

Wed Jul 11, 2012 9:45 am

need some help in this , i am trying to monitor interface usage by sending a sms like below
interface monitor-traffic [/interface find name=ether1] once do={
:local tx (tx-bits-per-second / 1024);
:local rx (rx-bits-per-second / 1024);
:put $tx;
:put $rx;
/tool sms send usb2 phone-number=989xxxx message="tx = $tx rx = $rx" channel=1
}
this part is working fine but i want to pass a variable to the script to define interface like
interface monitor-traffic [/interface find name=$var] once do={
:local tx (tx-bits-per-second / 1024);
:local rx (rx-bits-per-second / 1024);
:put $tx;
:put $rx;
/tool sms send usb2 phone-number=989xxxx message="tx = $tx rx = $rx" channel=1
}
the sms format which i am sending is
:cmd password script scriptname var=ether1
pls point me in the right direction
 
CyberT
Member Candidate
Member Candidate
Posts: 172
Joined: Tue Feb 01, 2011 1:39 pm
Location: Johannesburg, South Africa
Contact:

Re: SMS and check interface usage

Tue Jul 31, 2012 12:15 pm

try building the message first as a variable and then sending that string, i managed to do this once for the device to sms me its current ip.

think your script this way must look more like
message="tx = "&$tx&" rx = "&$rx
if i'm not mistaken.

could also have to include some commas, but i think the one above should be closer, whats your current output?

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], neitro and 132 guests