Log Statusdata to the internal syslog. Example with LTE Data for two links.
/* DESC: A Script that can be used for a longtime logging of a NetModule Wireless Router. The Target is the syslog. * Copyright (C) 2013 NetModule AG, Switzerland */ INTERVAL = 15; w1upsince=0; w2upsince=0; while (true) { w = nb_status("wan"); ww = nb_status("wwan"); st = nb_status("system"); if(w.WANLINK3_STATE=="up" && w1upsince == 0) { w1upsince=uptime(); } if (w.WANLINK4_STATE=="up" && w2upsince == 0) { w2upsince=uptime(); } log=""; log=sprintf("%s|%s",log,w.WANLINK3_STATE); log=sprintf("%s|%s",log,w.WANLINK4_STATE); log=sprintf("%s|%s",log,ww.MOBILE1_SERVICE_TYPE); log=sprintf("%s|%s",log,ww.MOBILE2_SERVICE_TYPE); log=sprintf("%s|%s",log,right(w.WANLINK3_STATE_UP_SINCE,8)); log=sprintf("%s|%s",log,right(w.WANLINK4_STATE_UP_SINCE,8)); log=sprintf("%s|%s",log,right(w.WANLINK3_ADDRESS,6)); log=sprintf("%s|%s",log,right(w.WANLINK4_ADDRESS,6)); log=sprintf("%s|%s",log,st.SUPPLY_VOLTAGE); log=sprintf("%s|%s",log,st.IGNITION_VOLTAGE); log=sprintf("%s|%i|%i",log,w1upsince,w2upsince); nb_syslog(log); sleep(INTERVAL); } exit(0);