Talks PSRP over WinRM via pypsrp, one runspace pool per connection. Each getter sends one PowerShell script that projects cmdlet results onto flat fields and ends in ConvertTo-Json, so the Python side parses JSON, not text. Covers facts, interfaces, IP addresses, ARP, routes and services, plus service start/stop/restart/enable/disable. Service names are validated and quoted as PowerShell verbatim strings, typographic quotes included. Fixtures are synthetic: they pin down the JSON the scripts are designed to emit. tools/harvest.py records the real output from a host. Refs christianmanivong/netork#300
9 lines
563 B
JSON
9 lines
563 B
JSON
[
|
|
{"interface": "Ethernet", "address": "10.0.0.5", "prefix": 24, "family": "IPv4"},
|
|
{"interface": "Ethernet", "address": "10.0.0.6", "prefix": 24, "family": "IPv4"},
|
|
{"interface": "Ethernet", "address": "fe80::1c2d:3e4f:5a6b:7c8d%6", "prefix": 64, "family": "IPv6"},
|
|
{"interface": "Ethernet", "address": "2001:db8::5", "prefix": 64, "family": "IPv6"},
|
|
{"interface": "Loopback Pseudo-Interface 1", "address": "127.0.0.1", "prefix": 8, "family": "IPv4"},
|
|
{"interface": "Loopback Pseudo-Interface 1", "address": "::1", "prefix": 128, "family": "IPv6"}
|
|
]
|