Page 1 of 1

SMS and check interface usage

Posted: Wed Jul 11, 2012 9:45 am
by vixxant
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

Re: SMS and check interface usage

Posted: Tue Jul 31, 2012 12:15 pm
by CyberT
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?