Skip to content

Instantly share code, notes, and snippets.

@ollyg
Last active August 20, 2019 15:51
Show Gist options
  • Save ollyg/5f0732624f7032472c51930e06747d37 to your computer and use it in GitHub Desktop.
Save ollyg/5f0732624f7032472c51930e06747d37 to your computer and use it in GitHub Desktop.
reports:
- tag: hosts_network_today
label: 'Hosts On Network Today'
columns:
- {mac: 'MAC Address'}
- {dns: 'Router'}
- {port: 'Port'}
- {vlan: 'VLAN'}
- {ip: 'IP'}
- {nbname: 'NetBIOS'}
- {domain: 'Domain'}
- {time_last: 'Last Seen'}
query: |
SELECT node.mac, device.dns, node.port, node.vlan, node.active, node_nbt.ip, node_nbt.nbname, node_nbt.domain, node.time_last
FROM (node inner join node_nbt on (node.mac = node_nbt.mac)) inner join device on (node.switch = device.ip)
WHERE node.time_last > TIMESTAMP 'yesterday' AND CAST(node.active as integer)= 1
ORDER BY node_nbt.ip
- tag: bms_hosts
label: 'BMS Hosts'
columns:
- {location: 'Location'}
- {vlan: 'VLAN'}
- {name: 'Port Description'}
query: |
SELECT device.location, device_port.vlan, device_port.name
FROM (device INNER JOIN device_port on (device.ip = device_port.ip))
WHERE device_port.port NOT LIKE '%trolled%'
AND device_port.name NOT LIKE 'BP-L%'
AND device_port.port LIKE 'Gigabit%'
AND device_port.up = 'up'
AND CAST (device_port.vlan AS integer) < 700
ORDER BY device.location
Copy link

ghost commented Sep 21, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment