1# SNMP trap 2 3## Overview 4 5phosphor-snmp currently only supports sending traps for error log entries. 6Enabling that for a system can be done by adding phosphor-dbus-monitor rules. 7 8There are a couple of ways through which the user can configure the Dbus-monitor 9to generate the SNMP trap. 10 11- Interface added signal on the D-Bus object. 12- Properties changed signal on the D-Bus object. 13 14Other OpenBMC applications can still send the SNMP trap as needed. These 15applications must use the API exposed by the libsnmp. 16 17Users need to add the notification object in the MIB and then application can 18call the library function. 19 20The OpenBMC Notification management information base (MIB) extension can be 21found at the following [location][MIB]. It defines the object descriptions 22needed for a management application to be notified of an error entry in the 23OpenBMC log. 24 25[MIB]: https://github.com/openbmc/phosphor-snmp/tree/master/mibs 26 27The phosphor-snmp repository exposes the following lib and the D-Bus service 28 29libsnmp: Exposes the API to send the SNMP trap phosphor-network-snmpconf: Used 30for configuring the SNMP manager(Client). 31 32## SNMP Manager Configuration 33 34The administrator can configure one or more SNMP managers to receive the OpenBMC 35traps. 36 37### Add the SNMP Manager 38 39#### Add via REST 40 41`curl -c cjar -b cjar -k -H "Content-Type: application/json" -X POST -d '{"data": ["<snmp manager ip>", <port>] }' https://<hostname/ip>/xyz/openbmc_project/network/snmp/manager/action/Client` 42 43#### Add with busctl 44 45`busctl call xyz.openbmc_project.Network.SNMP /xyz/openbmc_project/network/snmp/manager xyz.openbmc_project.Network.Client.Create Client sqs "<snmp manager ip>" <port>` 46 47### Delete the SNMP Manager 48 49#### Delete via REST 50 51`curl -c cjar -b cjar -k -H "Content-Type: application/json" -X DELETE https://<hostname/ip>/xyz/openbmc_project/network/snmp/manager/<id>` 52 53#### Delete with busctl 54 55`busctl call xyz.openbmc_project.Network.SNMP /xyz/openbmc_project/network/snmp/manager/<id> xyz.openbmc_project.Object.Delete Delete` 56