upnort
September 16, 2019, 9:15pm
1
I want to collect some basic device data and save the information to a file that can be used off device. The information I want to store is something like this:
:local Resource [/system resource print]
:local Routerboard [/system routerboard print]
:local Identity [system identity print]
:local Service [/ip service print]
I want to concatenate the information with something like this:
:local DeviceInfo ($Resource $Routerboard $Identity $Service)
Then paste that information into a file.
do something with “$DeviceInfo” file=DeviceInfo.txt
Thanks again. )
upnort
September 23, 2019, 3:33pm
2
I’m still looking for some coaching.
Jotne
September 24, 2019, 4:57am
3
In my project Mikrotik for Splunk, I do get this information using syslog to send it out of all routers. See example here: http://forum.mikrotik.com/t/tool-using-splunk-to-analyse-mikrotik-logs-3-3-graphing-everything/121810/1
upnort
September 26, 2019, 3:44pm
4
In my project Mikrotik for Splunk, I do get this information using syslog to send it out of all routers.
Not what I was looking for, but I see what you did. Thanks. I’m looking to store the information directly into a file rather than a remote log server.
did you ever get this working? im trying to figure something out as well in the same vein now
Jotne
October 8, 2022, 5:41am
6
Remember that high write counts of file may wear out the routers flash.
:local Resource [/system resource print]
:local Routerboard [/system routerboard print]
:local Identity [system identity print]
:local Service [/ip service print]
:local DeviceInfo ($Resource . "\r" . $Routerboard . "\r" . $Identity . "\r" . $Service)
:execute script=":put $DeviceInfo" file=DeviceInfo.txt
Better this…
:execute script="/system resource print; /system routerboard print; /system identity print; /ip service print;" file=DeviceInfo.txt