Jump to content

Recommended Posts

Posted

Хочу по API забирать данные команды /interface lte info [find where name=lte1] once

Казалось бы чего проще, отправь ему

/interface/lte/info

?name=lte1

=once=

 

Но увы, микрот API не знает таких команд, отдел API не дружит с отделом LTE.

 

Надумался вариант регулярно выполнять скрипт по расписанию, который заберет данные в переменную:

 

:local lteinfo [/interface lte info [find where name=lte1] once as-value]

 

Внимание вопрос, как эти данные забрать через API _БЕЗ_ использования промежуточного файла (чтобы не убить фрешку) ?

Есть идеи?

Posted

Пока пришел к такому:

 

/system script
add dont-require-permissions=no name=lteinfo owner=busadmin policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=\
    ":global lteinfo [/interface lte info [find] once as-value]; :global lteinfotime [/system clock print as-value]"
/system scheduler
add interval=1m name=lteinfo_1min on-event=lteinfo

Забирать данные можно так:

 

/system/script/environment/print
=.proplist=name,value
?name=lteinfo
?name=lteinfotime
?#|

Слава костылям! Скриптам слава!

  • 1 month later...
Posted

Если кому интересно, на официальном форуме нашелся добрый человек и подсказал:

 

/interface/lte/info
=number=0
=once

Магический параметр number=0

 

# mktik_api_cmd -i 10.100.26.153 /interface/lte/info =number=0 =once
!re
	 =imsi : 250012384422491
	 =functionality : full
	 =registration-status : registered
	 =current-operator : MTS RUS
	 =current-cellid : 161324567
	 =phy-cellid : 78
	 =access-technology : Evolved 3G (LTE)
	 =session-uptime : 3w4d21h29m27s
	 =cqi : 8
	 =pin-status : no password required
	 =revision : "MikroTik_CP_2.160.000_v008"
	 =uicc : 89701012823844224913
	 =subscriber-number : +CME ERROR: 100
	 =rsrp : -83
	 =rsrq : -13
	 =sinr : 5
	 =sector-id : 23
	 =imei : 355654090034211
	 =manufacturer : "MikroTik"
	 =model : "R11e-LTE"
	 =lac : 17200
	 =enb-id : 630174
	 =earfcn : 1777 (band 3, bandwidth 15Mhz)

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...