FreeBSDDriver (`freebsd`) and OpenBSDDriver (`openbsd`) on a shared BsdDriver, for the BSD VMs netOrk provisions and BSD hosts added by hand (NetOrk/netork#798). - SSH over exec channels (napalm-device-types' run_on_transport): no PTY, stdout and stderr apart, real exit codes; run_command()/open_stream() are public. Root through `sudo -S` with the password on stdin, or `sudo -n` without one. - Facts: hostname, release and running kernel (freebsd-version / uname), hardware from SMBIOS (kenv) or hw.* sysctls, uptime from kern.boottime. - Interfaces and addresses (ifconfig -a: ether/lladdr, hex netmasks, scoped IPv6), routes (netstat -rn, OpenBSD's abbreviated networks written out, host/broadcast/loopback entries left out), ARP (FreeBSD's sentences, OpenBSD's table), users and groups, processes (lstart read as one five-word field), cron jobs (system crontab and the login user's). - Parsers are pure functions, tested on output recorded from FreeBSD 15.1 (hand-installed and cloud image) and OpenBSD 7.9 (NetOrk/netork#793), with internal addresses replaced by documentation ranges.
61 lines
4.3 KiB
Plaintext
61 lines
4.3 KiB
Plaintext
USER CMD PID FD DEV INUM MODE R/W SZ|DV
|
|
root fstat 32180 text 4,3 77827 100555 r 22504
|
|
root fstat 32180 wd 4,10 259200 40755 r 512
|
|
root fstat 32180 0 pipe 0xfffffd8058c4e300 state: E
|
|
root fstat 32180 1 pipe 0xfffffd8058c4e0a0 state:
|
|
root fstat 32180 2 pipe 0xfffffd8058c4eee0 state:
|
|
netork-u head 91365 text 4,3 77838 100555 r 7832
|
|
netork-u head 91365 wd 4,10 259200 40755 r 512
|
|
netork-u head 91365 0 pipe 0xfffffd8058c4e0a0 state: R
|
|
netork-u head 91365 1 pipe 0xfffffd8058c4edb0 state:
|
|
netork-u head 91365 2 pipe 0xfffffd8058c4eee0 state:
|
|
root sudo 36413 text 4,7 77835 104555 r 280424
|
|
root sudo 36413 wd 4,10 259200 40755 r 512
|
|
root sudo 36413 0 pipe 0xfffffd8058c4e300 state: E
|
|
root sudo 36413 1 pipe 0xfffffd8058c4e0a0 state:
|
|
root sudo 36413 2 pipe 0xfffffd8058c4eee0 state:
|
|
root sudo 36413 4 4,0 14624 100644 re 40960
|
|
root sudo 36413 5 pipe 0xfffffd8058c4e1d0 state:
|
|
root sudo 36413 6 pipe 0xfffffd8058c4e1d0 state:
|
|
root sudo 36413 7 4,0 15887 100440 re 1600
|
|
netork-u ksh 71133 text 4,0 9621 100555 r 810120
|
|
netork-u ksh 71133 wd 4,10 259200 40755 r 512
|
|
netork-u ksh 71133 1 pipe 0xfffffd8058c4edb0 state:
|
|
netork-u ksh 71133 2 pipe 0xfffffd8058c4eee0 state:
|
|
netork-u ksh 71133 10 pipe 0xfffffd8058c4eb50 state: E
|
|
netork-u sshd-session 37638 text 4,3 181662 100511 r 1037608
|
|
netork-u sshd-session 37638 wd 4,0 2 40755 r 512
|
|
netork-u sshd-session 37638 0 4,0 15794 20666 rw 2,2
|
|
netork-u sshd-session 37638 1 4,0 15794 20666 rw 2,2
|
|
netork-u sshd-session 37638 2 4,0 15794 20666 rw 2,2
|
|
netork-u sshd-session 37638 3 4,0 15794 20666 rw 2,2
|
|
netork-u sshd-session 37638 4 4,0 15794 20666 rw 2,2
|
|
netork-u sshd-session 37638 5 4,0 15794 20666 rw 2,2
|
|
netork-u sshd-session 37638 6* unix stream 0xfffffd806fb97250 <-> 0xfffffd806fb97400
|
|
netork-u sshd-session 37638 7* internet stream tcp 0xffff800000ae1b80 10.0.2.15:22 <-- 10.0.2.2:53336
|
|
netork-u sshd-session 37638 9* unix stream 0xfffffd806fb97130
|
|
netork-u sshd-session 37638 11 pipe 0xfffffd8058c4edb0 state:
|
|
netork-u sshd-session 37638 13 pipe 0xfffffd8058c4eee0 state:
|
|
root sshd-session 25279 text 4,3 181662 100511 r 1037608
|
|
root sshd-session 25279 wd 4,0 2 40755 r 512
|
|
root sshd-session 25279 0 4,0 15794 20666 rw 2,2
|
|
root sshd-session 25279 1 4,0 15794 20666 rw 2,2
|
|
root sshd-session 25279 2 4,0 15794 20666 rw 2,2
|
|
root sshd-session 25279 3 4,0 15794 20666 rw 2,2
|
|
root sshd-session 25279 4 4,0 15794 20666 rw 2,2
|
|
root sshd-session 25279 5 4,0 15794 20666 rw 2,2
|
|
root sshd-session 25279 7* internet stream tcp 0xffff800000ae1b80 10.0.2.15:22 <-- 10.0.2.2:53336
|
|
root sshd-session 25279 8* unix stream 0xfffffd806fb97400 <-> 0xfffffd806fb97250
|
|
root sshd-session 25279 9* unix stream 0xfffffd806fb97130
|
|
root getty 88809 text 4,3 181471 100555 r 27864
|
|
root getty 88809 wd 4,0 2 40755 r 512
|
|
root getty 88809 0 4,0 15618 20600 rw 8,0
|
|
root getty 88809 1 4,0 15618 20600 rw 8,0
|
|
root getty 88809 2 4,0 15618 20600 rw 8,0
|
|
root cron 18831 text 4,3 129625 100555 r 42888
|
|
root cron 18831 wd 4,0 2 40755 r 512
|
|
root cron 18831 0 4,0 15794 20666 rwp 2,2
|
|
root cron 18831 1 4,0 15794 20666 rwp 2,2
|
|
root cron 18831 2 4,0 15794 20666 rwp 2,2
|
|
root cron 18831 3* unix stream 0xfffffd806fb970a0 /var/run/cron.sock
|