[reSIProcate] SNMP strategy, proof-of-concept committed
Hi everybody,
I added[1] an SNMP proof-of-concept in the apps/registration-agent. It
could be moved to rutil or resip/stack in future.
It uses NetSNMP[2] and it may be useful to include a copy of that for
Windows users under contrib/, along with the necessary Visual Studio
artifacts. Until then, this is only an optional feature supported on
Linux(-like) platforms.
As a proof-of-concept, it doesn't have a lot of metrics. It would not
be very hard to add a method for copying the StatisticsMessage[3] into
the SNMPThread[4] and that would give us more metrics very quickly.
It is using the netSnmpExperimental OID prefix .1.3.6.1.4.1.8072.9999.
We need to decide if we want to have our own OID prefix or if we want to
share an existing prefix. Does anybody want to suggest the better OID
to use? It is not hard to get our own but it will need somebody to be
the contact for it.
The MIB[5] is very basic, only including the metrics
registrationsConfigured and registrationsFailed. There are other MIBs
we could refer to or use, including the SIP MIB[6] (RFC 4780) and the
Kamailio MIB[7]. Making it equivalent and interchangeable with Kamailio
might make it easier for people who use both reSIProcate and Kamailio in
the same network.
The standard mib2c tool has been used to generate C code and then the
generated code is copied into C++ classes. A README[8] explains how I
maintain those files. However, there are alternative approaches, I
found various attempts to write more general C++ wrappers for NetSNMP,
for example, StatX[9]. Does anybody want to propose any other C++ wrappers?
This will probably remain the proof-of-concept state for the 1.12
release and if anybody wants to take it further, it could become
standard in 1.13 or later.
Regards,
Daniel
1.
https://github.com/resiprocate/resiprocate/commit/24b276342d19ee7ab13f8a4db4b1439536c3521e
2. http://www.net-snmp.org/
3.
https://github.com/resiprocate/resiprocate/blob/master/resip/stack/StatisticsMessage.hxx
4.
https://github.com/resiprocate/resiprocate/blob/master/apps/registration-agent/SNMPThread.cxx
5.
https://github.com/resiprocate/resiprocate/blob/master/apps/registration-agent/REG-AGENT-MIB.txt
6. https://tools.ietf.org/html/rfc4780
7. https://www.kamailio.org/docs/modules/5.4.x/modules/snmpstats.html
8.
https://github.com/resiprocate/resiprocate/blob/master/apps/registration-agent/README_SNMP.txt
9. https://github.com/urykhy/StatX