Demystifying iplike in OpenNMS Horizon
As described in the previous article we have built and installed an OpenNMS Horizon Core component from the source.
With setting up the database schema with ${OPENNMS_HOME}/bin/install -dis
a function IPLIKE
is created for the OpenNMS database.
It allows us to get IP address matches for IPv4 and IPv6 addresses with filters used in all IP filters in the tool, e.g. IPADDR IPLIKE 192.168.0-3.0-255
.
By default, the function is implemented in a SQL procedural language (PL/pgSQL).
As OpenNMS had to deal with larger IP address inventories, an optimized version in C was created which is available as the IPLIKE package.
The C version of this stored procedure has to be built against header files from specific PostgreSQL major versions.
This is the reason you see iplike-pgsql{12,13,14,15}
packages in the OpenNMS repositories.