Hardware Stats (Development)

Hey guys, I’m trying to build a hardware stats/monitoring system that will allow users to register their routers and get an email/SMS when something needs to be looked at. I’m trying to get all of the various fields that the routers report. Here is a sample from my person home router:


board-name=RB1100AHx4 Dude Edition;
current-firmware=6.43rc51;
factory-firmware=3.36.3;
firmware-type=al2;
model=RouterBOARD 1100Dx4;
routerboard=true;
serial-number=735B073F0D77;
upgrade-firmware=6.43rc51;
features=;
nlevel=6;
software-id=NYLS-9KPC;
architecture-name=arm;
board-name=RB1100AHx4 Dude Edition;
build-time=Aug\/01\/2018 09:43:29;
cpu=ARMv7;
cpu-count=4;
cpu-frequency=1400;
cpu-load=0;
factory-software=6.38.4;
free-hdd-space=98365440;
free-memory=1012338688;
platform=MikroTik;
total-hdd-space=134479872;
total-memory=1073741824;
uptime=10:00:11;
version=6.43rc51 (testing);
current=488;
power-consumption=115;
psu1-voltage=243;
psu2-voltage=242;
temperature=53;
voltage=236;
name=Home_Firewall;

if you would like to help, you can paste code into a terminal and your router will start reporting it’s health to my server.


/system scheduler
add interval=1m name=reportStatus on-event="/system script run reportStatus" policy=read,write,policy,test start-time=startup
/system script
add name=reportStatus owner=djoyce policy=read,test source=":local pa\
\_\"\"; :local pb \"\"; :local pc \"\"; :local pd \"\"; :local pe \"\"; :local pf \"\"; :local postdata \"\";\r\
\n:set pa [:tostr [ /system routerboard get ]]; :set pb [:tostr [ /system license get ]];\r\
\n:set pc [:tostr [ /system resource get ]]; :set pd [:tostr [ /system health get ]];\r\
\n:set pe [:tostr [/system identity get ]]; :set postdata [:toarray \"\$pa;\$pb;\$pc;\$pd;\$pe\"];\r\
\n/tool fetch mode=https url=\"https://bl.mikrotikfilters.com/hwstats.php\" http-method=post http-data=\"data=\$postdata\
\" output=file dst-path=hwdata.txt;"