This is an old revision of the document!


Get status values via SNMP

using the SDK. Please do not forget to enable SNMP v3.

Sample script

can be run in the SDK test window.

status_snmp.are
/* DESC: This script extends MIB entries of the SNMP agent 
 * with values from nb_status
 * Copyright (coffee) 2014 NetModule AG, Switzerland
 */
 
if (nb_snmp_register("TEMPERATURE", 1, "s", "ro") == -1)
   exit(1);
if (nb_snmp_register("RSRQ", 2, "s", "ro") == -1)
   exit(2);
 
if (nb_snmp_link() == -1)
   exit(3);
 
while (1) {
   status = nb_status("wwan");
   if (nb_snmp_update("TEMPERATURE", struct_get(status, "MOBILE1_MODULE_TEMPERATURE")) == -1)
      exit(4);
   if (nb_snmp_update("RSRQ", struct_get(status, "MOBILE1_RSRQ")) == -1)
      exit(5);
   sleep(5); /* update frequency */
} 

Access via SNMP

Please use SNMP v3 for accessing the router. First create a user (SYSTEM→Authentication→User accounts)“snmp” with the password “snmp01password”. Attention must be paid to the fact that SNMP passwords have to be more than 8 characters long. Shorter passwords have to be doubled for SNMP (e.g. admin01 becomes admin01admin01). To see the values run on linux:
snmpwalk -v 3 -u <user> -n “” -l authNoPriv -a MD5 -x DES -A <password>[<password>] <IPaddress> 1.3.6.1.4.1.31496.10.90

For example:

snmpwalk -v 3 -u snmp -n "" -l authNoPriv -a MD5 -x DES -A snmp01password 192.168.1.140  1.3.6.1.4.1.31496.10.90 
 
iso.3.6.1.4.1.31496.10.90.1.0 = STRING: "47.3"
iso.3.6.1.4.1.31496.10.90.2.0 = STRING: "-11.5"

Or use a windows tool:

Useful

These values can be used for nb_status(argument):

Argument Description
“summary” Short status summary
“system” System information
“license” License information
“wwan” WWAN module status
“wlan” WLAN module status
“gnss” GNSS (GPS) module status
“lan” LAN interface status
“wan” WAN interface status
“openvpn” OpenVPN connection status
“ipsec” IPsec connection status
“dio” Digital IO status

To see the fields run dump() in the test windows. E.g:

nb_status.are
status = nb_status("wwan"); 
dump(status);
 
struct(21): {
  .MOBILE1_MODULE_TEMPERATURE = string[4]: "47.4"
  .MOBILE1_SIGNAL = string[3]: "-83"
  .MOBILE1_LAC = string[4]: "FFFE"
  .MOBILE1_CID = string[7]: "16BB302"
  .MOBILE1_RSRQ = string[5]: "-11.5"
  .MOBILE1_ICCID = string[20]: "8949226133742004747F"
  .MOBILE1_REGISTRATION_STATE = string[23]: "registeredInHomeNetwork"
  .MOBILE1_MODULE_INFO = string[126]: "Manufacturer: Huawei Technologies Co., Ltd.  Model: ME909u-521  Revision: 11.235.07.00.00  IMEI: 860461024043005  +GCAP: +CGSM"
  .MOBILE1_MSISDN = string[3]: "n/a"
  .MOBILE1_SIM_STATE = string[8]: "unlocked"
  .MOBILE1_MEID = string[3]: "n/a"
  .MOBILE1_MODULE_TYPE = string[5]: "me909"
  .MOBILE1_MODULE_SLOT = string[1]: "0"
  .MOBILE1_RSRP = string[4]: "-113"
  .MOBILE1_IMSI = string[15]: "262073993546474"
  .MOBILE1_SERVICE_TYPE = string[3]: "LTE"
  .MOBILE1_LAI = string[5]: "26207"
  .MOBILE1_NETWORK = string[7]: "o2 - de"
  .MOBILE1_SIM = string[4]: "SIM1"
  .MOBILE1_IMEI = string[15]: "860461024043005"
  .MOBILE1_SINR = string[4]: "-1.4"
}