'snmp' capability for WebSocket Token API

Overview

Provides an interface for sending SNMP traps.

Requests

Sending an SNMP trap (snmptrap)

Sends an SNMP trap to the registered server.

For successful execution, the snmp_options parameter must be configured in the master domain settings. The server must be specified and trap sending must be enabled. According to the settings, filtering is performed by logging levels (level) and event type filters (alertCode).

Parameters:

  • notificationType :: ("systemAlert") | "serverAlert" | "nodeAlert" | "roleAlert" | "rateInfo" | "healthInfo" | "auditAlert", or synonyms: ("system") | "server" | "node" | "role" | "rate" | "health" | "audit".

  • alertCode :: ("custom") | arbitrary name of the corresponding event code. The platform uses, for example: node_up, role_restart, certificate_expired, mg_killed, mg_cold_boot, admin_logon, sip_cps_rate, users_registered, system_state, …​

  • level :: ("info") | "emergency" | "alert" | "critical" | "error" | "warning" | "notice" | "debug", or synonyms: (6) | 0 | 1 | 2 | 3 | 4 | 5 | 7.

  • alertKey :: ("") | arbitrary string, assumed to be the name of the reported metric.

  • alertValue :: ("") | arbitrary string, assumed to be the metric value itself.

  • alertMessage :: ("") | arbitrary string, assumed to be some readable event description text. Potentially a string with JSON where quotes are escaped by backslash.

  • node :: (current ws node) | arbitrary string reflecting the initiating node.

  • role :: ("webserver") | arbitrary string reflecting the initiating role/microservice.

Example
[
  "snmptrap",
  {
    "qid":123,
    "notificationType": "systemAlert",
    "alertCode": "My code",
    "alertKey": "My key",
    "alertValue": "My value",
    "alertMessage": "Some message with \"quotation\"",
    "role": "My role",
    "level": "warning"
  }
]

[ "snmptrap_result", { "qid": 123, "result": "ok" } ] ---


[ "snmptrap_result", { "qid": 123, "result": "error", "errormsg": "", } ] ---