Skip to content

Instantly share code, notes, and snippets.

@indigo423
Last active May 7, 2018 07:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save indigo423/e327753c950e9a9a3097bc0ef0cbc4b3 to your computer and use it in GitHub Desktop.
Save indigo423/e327753c950e9a9a3097bc0ef0cbc4b3 to your computer and use it in GitHub Desktop.
OpenNMS View for nodes with IP services
CREATE VIEW node_ip_services AS (
SELECT
n.*,
ip_if.id AS ip_if_id,
ip_if.ipaddr,
ip_if.iphostname,
ip_if.ismanaged,
ip_if.ipstatus,
ip_if.iplastcapsdpoll,
ip_if.issnmpprimary,
ip_if.snmpinterfaceid,
ip_if.netmask,
svc.serviceid,
svc.servicename,
if_svc.id AS if_svc_id,
if_svc.ifindex AS if_svc_ifindex,
if_svc.status AS if_svc_status
FROM
node_categories n
LEFT JOIN
ipinterface ip_if
ON
ip_if.nodeid = n.nodeid
LEFT JOIN
ifservices if_svc
ON
ip_if.id = if_svc.ipinterfaceid
LEFT JOIN
service svc
ON
if_svc.serviceid = svc.serviceid
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment