Last active
May 7, 2018 07:45
-
-
Save indigo423/e327753c950e9a9a3097bc0ef0cbc4b3 to your computer and use it in GitHub Desktop.
OpenNMS View for nodes with IP services
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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