Last active
August 20, 2019 15:51
-
-
Save ollyg/5f0732624f7032472c51930e06747d37 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Put my version which isn't working here: https://gist.github.com/howfantastic/b2ee4ea372b631b2eee56671470fd33d