Monitor system load

using the SDK. Please start this script after boot.

monitor_system_load.are
/* DESC: This script monitors the system load
 * and makes warning entries in the log file
 *
 * Copyright 2016 NetModule AG, Switzerland (rfa)
 * http://wiki.netmodule.com/sdk/monitor-system-load
 */
CPUCORES=1;
// 1 for NB1600, 2700, 2710, 3700, 3710
// 2 for NB2800, NB3701, NB3711, NB3800
 
for(;;) {
  s = sysinfo();
  if (s.loads[0] > 1.0 * CPUCORES)
    nb_syslog("Warning: system load last minute above %3.2f percent", 100 * s.loads[0] / CPUCORES);
  if (s.loads[1] > 0.7 * CPUCORES)
    nb_syslog("Warning: system load last 5 minutes above %3.2f percent", 100 * s.loads[1] / CPUCORES);
  if (s.loads[2] > 0.7 * CPUCORES)
    nb_syslog("Warning: system load last 15 minutes above %3.2f percent", 100 * s.loads[2] / CPUCORES);
  sleep(60);
}