Community discussions

MikroTik App
 
butteryak
newbie
Topic Author
Posts: 40
Joined: Fri Sep 12, 2008 1:16 am

Help with simple script to email bytes from an interface

Fri Apr 24, 2015 6:05 am

I can't seem to figure this out, it should be simple but I'm getting empty data values. empty email
:local counter [/interface ethernet get ether1 rx-byte]
:local traffic ($counter + [/interface ethernet get ether1 tx-byte])

/tool e-mail send to=chris@example.com from=chris@example.com  subject="bytes" body="$traffic" tls=yes

the $traffic variable is empty. when I " put [/interface ethernet get ether1 rx-byte]" into a terminal the value is blank.

I've tried many variations with no luck :-/

sometimes I see "driver-rx-byte" used in various examples, sometimes I find "rx-bytes" used.
If anyone could help clarify the proper way to do this, I would be greatly appreciative.

this is for routeros V-4.17
 
butteryak
newbie
Topic Author
Posts: 40
Joined: Fri Sep 12, 2008 1:16 am

Re: Help with simple script to email bytes from an interface

Fri Apr 24, 2015 6:40 am

Near as I can tell, it's because I'm not using a RouterBoard? I have this installed on an ALIX board, are these statistics not supported? Is there any other way to get them?
 
User avatar
kensoual
just joined
Posts: 4
Joined: Mon Feb 09, 2015 4:42 pm

Re: Help with simple script to email bytes from an interface

Mon May 04, 2015 1:27 pm

/tool e-mail send to=chris@example.com from=chris@example.com subject="bytes" body=($traffic) tls=yes

You may try like this