Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sled-diagnostics] Output for support bundles should be structured #7228

Open
wants to merge 4 commits into
base: spr/papertigers/main.sled-diagnostics-output-for-support-bundles-should-be-structured
Choose a base branch
from

Conversation

papertigers
Copy link
Contributor

@papertigers papertigers commented Dec 10, 2024

This introduces the SledDiagnosticsQueryOutput type so support bundles can now have structured output in collected files. This makes it potentially easier for an operator to write scripts that search for particular commands based on various fields.

This is on top of:

Created using spr 1.3.6-beta.1
@papertigers
Copy link
Contributor Author

Deployed this on my bench gimlet to ensure things looked sane:

BRM42220027 # curl -s http://[fd00:1122:3344:101::1]:12345/support/pargs-info | jq -r '.[].success | "\(.command)\n \(.stdio)"'
/usr/bin/pfexec /usr/bin/pargs -ae 2570
 2570:  ctrun -l child -o noorphan,regent /opt/oxide/sled-agent/sled-agent run /opt/oxi
argv[0]: ctrun
argv[1]: -l
argv[2]: child
argv[3]: -o
argv[4]: noorphan,regent
argv[5]: /opt/oxide/sled-agent/sled-agent
argv[6]: run
argv[7]: /opt/oxide/sled-agent/pkg/config.toml

envp[0]: _=*2567*/usr/bin/ctrun
envp[1]: PATH=/usr/sbin:/usr/bin
envp[2]: PWD=/
envp[3]: SHLVL=1
envp[4]: SMF_FMRI=svc:/oxide/sled-agent:default
envp[5]: SMF_METHOD=start
envp[6]: SMF_RESTARTER=svc:/system/svc/restarter:default
envp[7]: SMF_ZONENAME=global
envp[8]: TZ=UTC
envp[9]: A__z="*SHLVL

/usr/bin/pfexec /usr/bin/pargs -ae 2572
 2572:  /opt/oxide/sled-agent/sled-agent run /opt/oxide/sled-agent/pkg/config.toml
argv[0]: /opt/oxide/sled-agent/sled-agent
argv[1]: run
argv[2]: /opt/oxide/sled-agent/pkg/config.toml

envp[0]: SSL_CERT_DIR=/usr/ssl/certs
envp[1]: SSL_CERT_FILE=/etc/ssl/cacert.pem
envp[2]: _=*2567*/usr/bin/ctrun
envp[3]: PATH=/usr/sbin:/usr/bin
envp[4]: PWD=/
envp[5]: SHLVL=1
envp[6]: SMF_FMRI=svc:/oxide/sled-agent:default
envp[7]: SMF_METHOD=start
envp[8]: SMF_RESTARTER=svc:/system/svc/restarter:default
envp[9]: SMF_ZONENAME=global
envp[10]: TZ=UTC
envp[11]: A__z="*SHLVL

/usr/bin/pfexec /usr/bin/pargs -ae 2616
 2616:  ctrun -l child -o noorphan,regent /opt/oxide/mg-ddm/pkg/ddm_method_script.sh
argv[0]: ctrun
argv[1]: -l
argv[2]: child
argv[3]: -o
argv[4]: noorphan,regent
argv[5]: /opt/oxide/mg-ddm/pkg/ddm_method_script.sh

envp[0]: _=*2611*/usr/bin/ctrun
envp[1]: PATH=/usr/sbin:/usr/bin
envp[2]: PWD=/
envp[3]: SHLVL=1
envp[4]: SMF_FMRI=svc:/oxide/mg-ddm:default
envp[5]: SMF_METHOD=start
envp[6]: SMF_RESTARTER=svc:/system/svc/restarter:default
envp[7]: SMF_ZONENAME=global
envp[8]: TZ=UTC
envp[9]: A__z="*SHLVL

/usr/bin/pfexec /usr/bin/pargs -ae 2620
 2620:  /opt/oxide/mg-ddm/ddmd --with-stats --admin-port 8000 --admin-addr ::1 --kind s
argv[0]: /opt/oxide/mg-ddm/ddmd
argv[1]: --with-stats
argv[2]: --admin-port
argv[3]: 8000
argv[4]: --admin-addr
argv[5]: ::1
argv[6]: --kind
argv[7]: server
argv[8]: -a
argv[9]: net0/ll
argv[10]: -a
argv[11]: net1/ll
argv[12]: --dns-servers
argv[13]: unknown

envp[0]: SSL_CERT_DIR=/usr/ssl/certs
envp[1]: SSL_CERT_FILE=/etc/ssl/cacert.pem
envp[2]: SMF_ZONENAME=global
envp[3]: PWD=/
envp[4]: SMF_FMRI=svc:/oxide/mg-ddm:default
envp[5]: TZ=UTC
envp[6]: SMF_METHOD=start
envp[7]: SHLVL=1
envp[8]: PATH=/usr/sbin:/usr/bin
envp[9]: RUST_LOG=info
envp[10]: SMF_RESTARTER=svc:/system/svc/restarter:default
envp[11]: A__z="*SHLVL

/usr/bin/pfexec /usr/bin/pargs -ae 2843
 2843:  zoneadmd -z oxz_switch
argv[0]: zoneadmd
argv[1]: -z
argv[2]: oxz_switch

envp[0]: _ZONEADM_LOCK_HELD=1
envp[1]: PATH=/usr/sbin:/usr/bin
envp[2]: TZ=UTC

/usr/bin/pfexec /usr/bin/pargs -ae 3324
 3324:  /opt/oxide/dendrite/bin/uplinkd
argv[0]: /opt/oxide/dendrite/bin/uplinkd

envp[0]: _=*3322*/opt/oxide/dendrite/bin/uplinkd
envp[1]: PATH=/usr/sbin:/usr/bin
envp[2]: PWD=/
envp[3]: SHLVL=2
envp[4]: SMF_FMRI=svc:/oxide/uplink:default
envp[5]: SMF_METHOD=start
envp[6]: SMF_RESTARTER=svc:/system/svc/restarter:default
envp[7]: SMF_ZONENAME=oxz_switch
envp[8]: TZ=UTC
envp[9]: A__z="*SHLVL

/usr/bin/pfexec /usr/bin/pargs -ae 3352
 3352:  /opt/oxide/bin/lldpd run
argv[0]: /opt/oxide/bin/lldpd
argv[1]: run

envp[0]: SSL_CERT_DIR=/usr/ssl/certs
envp[1]: SSL_CERT_FILE=/etc/ssl/cacert.pem
envp[2]: _=*3350*/opt/oxide/bin/lldpd
envp[3]: PATH=/usr/sbin:/usr/bin
envp[4]: PWD=/
envp[5]: SHLVL=2
envp[6]: SMF_FMRI=svc:/oxide/lldpd:default
envp[7]: SMF_METHOD=start
envp[8]: SMF_RESTARTER=svc:/system/svc/restarter:default
envp[9]: SMF_ZONENAME=oxz_switch
envp[10]: TZ=UTC
envp[11]: A__z="*SHLVL

/usr/bin/pfexec /usr/bin/pargs -ae 3354
 3354:  ctrun -l child -o noorphan,regent /opt/oxide/mgd/pkg/mgd_method_script.sh
argv[0]: ctrun
argv[1]: -l
argv[2]: child
argv[3]: -o
argv[4]: noorphan,regent
argv[5]: /opt/oxide/mgd/pkg/mgd_method_script.sh

envp[0]: _=*3353*/usr/bin/ctrun
envp[1]: PATH=/usr/sbin:/usr/bin
envp[2]: PWD=/
envp[3]: SHLVL=1
envp[4]: SMF_FMRI=svc:/oxide/mgd:default
envp[5]: SMF_METHOD=start
envp[6]: SMF_RESTARTER=svc:/system/svc/restarter:default
envp[7]: SMF_ZONENAME=oxz_switch
envp[8]: TZ=UTC
envp[9]: A__z="*SHLVL

/usr/bin/pfexec /usr/bin/pargs -ae 3356
 3356:  /opt/oxide/mgd/bin/mgd run --with-stats --admin-port 4676 --admin-addr :: --rac
argv[0]: /opt/oxide/mgd/bin/mgd
argv[1]: run
argv[2]: --with-stats
argv[3]: --admin-port
argv[4]: 4676
argv[5]: --admin-addr
argv[6]: ::
argv[7]: --rack-uuid
argv[8]: f2d951e6-3508-4137-bd23-9bdad03b6bde
argv[9]: --sled-uuid
argv[10]: 601f0495-be02-4366-8c4d-5411aa279482
argv[11]: --dns-servers
argv[12]: unknown

envp[0]: SSL_CERT_DIR=/usr/ssl/certs
envp[1]: SSL_CERT_FILE=/etc/ssl/cacert.pem
envp[2]: SMF_ZONENAME=oxz_switch
envp[3]: PWD=/
envp[4]: SMF_FMRI=svc:/oxide/mgd:default
envp[5]: TZ=UTC
envp[6]: SMF_METHOD=start
envp[7]: SHLVL=1
envp[8]: PATH=/usr/sbin:/usr/bin
envp[9]: RUST_LOG=info
envp[10]: SMF_RESTARTER=svc:/system/svc/restarter:default
envp[11]: A__z="*SHLVL

/usr/bin/pfexec /usr/bin/pargs -ae 3358
 3358:  ctrun -l child -o noorphan,regent /opt/oxide/mg-ddm/pkg/ddm_method_script.sh
argv[0]: ctrun
argv[1]: -l
argv[2]: child
argv[3]: -o
argv[4]: noorphan,regent
argv[5]: /opt/oxide/mg-ddm/pkg/ddm_method_script.sh

envp[0]: _=*3355*/usr/bin/ctrun
envp[1]: PATH=/usr/sbin:/usr/bin
envp[2]: PWD=/
envp[3]: SHLVL=1
envp[4]: SMF_FMRI=svc:/oxide/mg-ddm:default
envp[5]: SMF_METHOD=start
envp[6]: SMF_RESTARTER=svc:/system/svc/restarter:default
envp[7]: SMF_ZONENAME=oxz_switch
envp[8]: TZ=UTC
envp[9]: A__z="*SHLVL

/usr/bin/pfexec /usr/bin/pargs -ae 3359
 3359:  /opt/oxide/mg-ddm/bin/ddmd --with-stats --admin-port 8000 --admin-addr ::1 --ki
argv[0]: /opt/oxide/mg-ddm/bin/ddmd
argv[1]: --with-stats
argv[2]: --admin-port
argv[3]: 8000
argv[4]: --admin-addr
argv[5]: ::1
argv[6]: --kind
argv[7]: transit
argv[8]: --dendrite
argv[9]: --rack-uuid
argv[10]: f2d951e6-3508-4137-bd23-9bdad03b6bde
argv[11]: --sled-uuid
argv[12]: 601f0495-be02-4366-8c4d-5411aa279482
argv[13]: -a
argv[14]: tfportrear0_0/ll
argv[15]: --dns-servers
argv[16]: unknown

envp[0]: SSL_CERT_DIR=/usr/ssl/certs
envp[1]: SSL_CERT_FILE=/etc/ssl/cacert.pem
envp[2]: SMF_ZONENAME=oxz_switch
envp[3]: PWD=/
envp[4]: SMF_FMRI=svc:/oxide/mg-ddm:default
envp[5]: TZ=UTC
envp[6]: SMF_METHOD=start
envp[7]: SHLVL=1
envp[8]: PATH=/usr/sbin:/usr/bin
envp[9]: RUST_LOG=info
envp[10]: SMF_RESTARTER=svc:/system/svc/restarter:default
envp[11]: A__z="*SHLVL

/usr/bin/pfexec /usr/bin/pargs -ae 3458
 3458:  ctrun -l child -o noorphan,regent /opt/oxide/sp-sim/bin/sp-sim /var/svc/manifes
argv[0]: ctrun
argv[1]: -l
argv[2]: child
argv[3]: -o
argv[4]: noorphan,regent
argv[5]: /opt/oxide/sp-sim/bin/sp-sim
argv[6]: /var/svc/manifest/site/sp-sim/config.toml

envp[0]: _=*3455*/usr/bin/ctrun
envp[1]: PATH=/usr/sbin:/usr/bin
envp[2]: PWD=/
envp[3]: SHLVL=1
envp[4]: SMF_FMRI=svc:/oxide/sp-sim:default
envp[5]: SMF_METHOD=start
envp[6]: SMF_RESTARTER=svc:/system/svc/restarter:default
envp[7]: SMF_ZONENAME=oxz_switch
envp[8]: TZ=UTC
envp[9]: A__z="*SHLVL

/usr/bin/pfexec /usr/bin/pargs -ae 3461
 3461:  /opt/oxide/sp-sim/bin/sp-sim /var/svc/manifest/site/sp-sim/config.toml
argv[0]: /opt/oxide/sp-sim/bin/sp-sim
argv[1]: /var/svc/manifest/site/sp-sim/config.toml

envp[0]: _=*3455*/usr/bin/ctrun
envp[1]: PATH=/usr/sbin:/usr/bin
envp[2]: PWD=/
envp[3]: SHLVL=1
envp[4]: SMF_FMRI=svc:/oxide/sp-sim:default
envp[5]: SMF_METHOD=start
envp[6]: SMF_RESTARTER=svc:/system/svc/restarter:default
envp[7]: SMF_ZONENAME=oxz_switch
envp[8]: TZ=UTC
envp[9]: A__z="*SHLVL

/usr/bin/pfexec /usr/bin/pargs -ae 3682
 3682:  ctrun -l child -o noorphan,regent /opt/oxide/wicketd/bin/wicketd run /var/svc/m
argv[0]: ctrun
argv[1]: -l
argv[2]: child
argv[3]: -o
argv[4]: noorphan,regent
argv[5]: /opt/oxide/wicketd/bin/wicketd
argv[6]: run
argv[7]: /var/svc/manifest/site/wicketd/config.toml
argv[8]: --address
argv[9]: [::1]:12226
argv[10]: --artifact-address
argv[11]: [fdb0:e8ea:6a09:8939::2]:12227
argv[12]: --mgs-address
argv[13]: [::1]:12225
argv[14]: --nexus-proxy-address
argv[15]: [::]:12229
argv[16]: --baseboard-file
argv[17]: /opt/oxide/baseboard.json
argv[18]: --read-smf-config

envp[0]: _=*3681*/usr/bin/ctrun
envp[1]: PATH=/usr/sbin:/usr/bin
envp[2]: PWD=/
envp[3]: SHLVL=1
envp[4]: SMF_FMRI=svc:/oxide/wicketd:default
envp[5]: SMF_METHOD=start
envp[6]: SMF_RESTARTER=svc:/system/svc/restarter:default
envp[7]: SMF_ZONENAME=oxz_switch
envp[8]: TZ=UTC
envp[9]: A__z="*SHLVL

/usr/bin/pfexec /usr/bin/pargs -ae 3696
 3696:  ctrun -l child -o noorphan,regent /opt/oxide/dendrite/bin/tfportd --sync-only -
argv[0]: ctrun
argv[1]: -l
argv[2]: child
argv[3]: -o
argv[4]: noorphan,regent
argv[5]: /opt/oxide/dendrite/bin/tfportd
argv[6]: --sync-only
argv[7]: --pkt-source
argv[8]: none

envp[0]: _=*3695*/usr/bin/ctrun
envp[1]: PATH=/usr/sbin:/usr/bin
envp[2]: PWD=/
envp[3]: SHLVL=1
envp[4]: SMF_FMRI=svc:/oxide/tfport:default
envp[5]: SMF_METHOD=start
envp[6]: SMF_RESTARTER=svc:/system/svc/restarter:default
envp[7]: SMF_ZONENAME=oxz_switch
envp[8]: TZ=UTC
envp[9]: A__z="*SHLVL

/usr/bin/pfexec /usr/bin/pargs -ae 3699
 3699:  /opt/oxide/dendrite/bin/tfportd --sync-only --pkt-source none
argv[0]: /opt/oxide/dendrite/bin/tfportd
argv[1]: --sync-only
argv[2]: --pkt-source
argv[3]: none

envp[0]: SSL_CERT_DIR=/usr/ssl/certs
envp[1]: SSL_CERT_FILE=/etc/ssl/cacert.pem
envp[2]: _=*3695*/usr/bin/ctrun
envp[3]: PATH=/usr/sbin:/usr/bin
envp[4]: PWD=/
envp[5]: SHLVL=1
envp[6]: SMF_FMRI=svc:/oxide/tfport:default
envp[7]: SMF_METHOD=start
envp[8]: SMF_RESTARTER=svc:/system/svc/restarter:default
envp[9]: SMF_ZONENAME=oxz_switch
envp[10]: TZ=UTC
envp[11]: A__z="*SHLVL

/usr/bin/pfexec /usr/bin/pargs -ae 4985
 4985:  zoneadmd -z oxz_internal_dns_154e3d97-5da2-45ce-963d-328e43169c51
argv[0]: zoneadmd
argv[1]: -z
argv[2]: oxz_internal_dns_154e3d97-5da2-45ce-963d-328e43169c51

envp[0]: _ZONEADM_LOCK_HELD=1
envp[1]: PATH=/usr/sbin:/usr/bin
envp[2]: TZ=UTC

/usr/bin/pfexec /usr/bin/pargs -ae 6980
 6980:  ctrun -l child -o noorphan,regent /opt/oxide/dns-server/bin/dns-server --config
argv[0]: ctrun
argv[1]: -l
argv[2]: child
argv[3]: -o
argv[4]: noorphan,regent
argv[5]: /opt/oxide/dns-server/bin/dns-server
argv[6]: --config-file
argv[7]: /var/svc/manifest/site/internal_dns/config.toml
argv[8]: --http-address
argv[9]: [fd00:1122:3344:1::1]:5353
argv[10]: --dns-address
argv[11]: [fd00:1122:3344:1::1]:53

envp[0]: _=*6977*/usr/bin/ctrun
envp[1]: PATH=/usr/sbin:/usr/bin
envp[2]: PWD=/
envp[3]: SHLVL=1
envp[4]: SMF_FMRI=svc:/oxide/internal_dns:default
envp[5]: SMF_METHOD=start
envp[6]: SMF_RESTARTER=svc:/system/svc/restarter:default
envp[7]: SMF_ZONENAME=oxz_internal_dns_154e3d97-5da2-45ce-963d-328e43169c51
envp[8]: TZ=UTC
envp[9]: A__z="*SHLVL

/usr/bin/pfexec /usr/bin/pargs -ae 7036
 7036:  ctrun -l child -o noorphan,regent /opt/oxide/dns-server/bin/dns-server --config
argv[0]: ctrun
argv[1]: -l
argv[2]: child
argv[3]: -o
argv[4]: noorphan,regent
argv[5]: /opt/oxide/dns-server/bin/dns-server
argv[6]: --config-file
argv[7]: /var/svc/manifest/site/internal_dns/config.toml
argv[8]: --http-address
argv[9]: [fd00:1122:3344:3::1]:5353
argv[10]: --dns-address
argv[11]: [fd00:1122:3344:3::1]:53

envp[0]: _=*5107*/usr/bin/ctrun
envp[1]: PATH=/usr/sbin:/usr/bin
envp[2]: PWD=/
envp[3]: SHLVL=1
envp[4]: SMF_FMRI=svc:/oxide/internal_dns:default
envp[5]: SMF_METHOD=start
envp[6]: SMF_RESTARTER=svc:/system/svc/restarter:default
envp[7]: SMF_ZONENAME=oxz_internal_dns_6abb87a8-8ece-45a0-a142-374d423de775
envp[8]: TZ=UTC
envp[9]: A__z="*SHLVL

/usr/bin/pfexec /usr/bin/pargs -ae 7039
 7039:  ctrun -l child -o noorphan,regent /opt/oxide/dns-server/bin/dns-server --config
argv[0]: ctrun
argv[1]: -l
argv[2]: child
argv[3]: -o
argv[4]: noorphan,regent
argv[5]: /opt/oxide/dns-server/bin/dns-server
argv[6]: --config-file
argv[7]: /var/svc/manifest/site/internal_dns/config.toml
argv[8]: --http-address
argv[9]: [fd00:1122:3344:2::1]:5353
argv[10]: --dns-address
argv[11]: [fd00:1122:3344:2::1]:53

envp[0]: _=*5076*/usr/bin/ctrun
envp[1]: PATH=/usr/sbin:/usr/bin
envp[2]: PWD=/
envp[3]: SHLVL=1
envp[4]: SMF_FMRI=svc:/oxide/internal_dns:default
envp[5]: SMF_METHOD=start
envp[6]: SMF_RESTARTER=svc:/system/svc/restarter:default
envp[7]: SMF_ZONENAME=oxz_internal_dns_7809101a-eadd-420f-8b9c-13123989187b
envp[8]: TZ=UTC
envp[9]: A__z="*SHLVL

/usr/bin/pfexec /usr/bin/pargs -ae 7077
 7077:  zoneadmd -z oxz_ntp_4c9fdc63-2a44-49de-ae46-7cb265a3bc8d
argv[0]: zoneadmd
argv[1]: -z
argv[2]: oxz_ntp_4c9fdc63-2a44-49de-ae46-7cb265a3bc8d

envp[0]: _ZONEADM_LOCK_HELD=1
envp[1]: PATH=/usr/sbin:/usr/bin
envp[2]: TZ=UTC

/usr/bin/pfexec /usr/bin/pargs -ae 7805
 7805:  /sbin/dhcpagent
argv[0]: /sbin/dhcpagent

envp[0]: _=*7106*/opt/oxide/zone-setup-cli/bin/zone-setup
envp[1]: PATH=/usr/sbin:/usr/bin
envp[2]: PWD=/
envp[3]: SHLVL=1
envp[4]: SMF_FMRI=svc:/oxide/opte-interface-setup:default
envp[5]: SMF_METHOD=start
envp[6]: SMF_RESTARTER=svc:/system/svc/restarter:default
envp[7]: SMF_ZONENAME=oxz_ntp_4c9fdc63-2a44-49de-ae46-7cb265a3bc8d
envp[8]: TZ=UTC
envp[9]: A__z="*SHLVL

/usr/bin/pfexec /usr/bin/pargs -ae 7899
 7899:  /usr/sbin/chronyd -d
argv[0]: /usr/sbin/chronyd
argv[1]: -d

envp[0]: _=*7898*/usr/sbin/chronyd
envp[1]: PATH=/usr/sbin:/usr/bin
envp[2]: PWD=/root
envp[3]: SHLVL=1
envp[4]: SMF_FMRI=svc:/oxide/ntp:default
envp[5]: SMF_METHOD=start
envp[6]: SMF_RESTARTER=svc:/system/svc/restarter:default
envp[7]: SMF_ZONENAME=oxz_ntp_4c9fdc63-2a44-49de-ae46-7cb265a3bc8d
envp[8]: TZ=UTC
envp[9]: A__z="*SHLVL

/usr/bin/pfexec /usr/bin/pargs -ae 5068
 5068:  zoneadmd -z oxz_internal_dns_7809101a-eadd-420f-8b9c-13123989187b
argv[0]: zoneadmd
argv[1]: -z
argv[2]: oxz_internal_dns_7809101a-eadd-420f-8b9c-13123989187b

envp[0]: _ZONEADM_LOCK_HELD=1
envp[1]: PATH=/usr/sbin:/usr/bin
envp[2]: TZ=UTC

/usr/bin/pfexec /usr/bin/pargs -ae 5071
 5071:  zoneadmd -z oxz_internal_dns_6abb87a8-8ece-45a0-a142-374d423de775
argv[0]: zoneadmd
argv[1]: -z
argv[2]: oxz_internal_dns_6abb87a8-8ece-45a0-a142-374d423de775

envp[0]: _ZONEADM_LOCK_HELD=1
envp[1]: PATH=/usr/sbin:/usr/bin
envp[2]: TZ=UTC

/usr/bin/pfexec /usr/bin/pargs -ae 7900
 7900:  /usr/sbin/chronyd -d
argv[0]: /usr/sbin/chronyd
argv[1]: -d

envp[0]: _=*7898*/usr/sbin/chronyd
envp[1]: PATH=/usr/sbin:/usr/bin
envp[2]: PWD=/root
envp[3]: SHLVL=1
envp[4]: SMF_FMRI=svc:/oxide/ntp:default
envp[5]: SMF_METHOD=start
envp[6]: SMF_RESTARTER=svc:/system/svc/restarter:default
envp[7]: SMF_ZONENAME=oxz_ntp_4c9fdc63-2a44-49de-ae46-7cb265a3bc8d
envp[8]: TZ=UTC
envp[9]: A__z="*SHLVL

/usr/bin/pfexec /usr/bin/pargs -ae 6982
 6982:  /opt/oxide/dns-server/bin/dns-server --config-file /var/svc/manifest/site/inter
argv[0]: /opt/oxide/dns-server/bin/dns-server
argv[1]: --config-file
argv[2]: /var/svc/manifest/site/internal_dns/config.toml
argv[3]: --http-address
argv[4]: [fd00:1122:3344:1::1]:5353
argv[5]: --dns-address
argv[6]: [fd00:1122:3344:1::1]:53

envp[0]: _=*6977*/usr/bin/ctrun
envp[1]: PATH=/usr/sbin:/usr/bin
envp[2]: PWD=/
envp[3]: SHLVL=1
envp[4]: SMF_FMRI=svc:/oxide/internal_dns:default
envp[5]: SMF_METHOD=start
envp[6]: SMF_RESTARTER=svc:/system/svc/restarter:default
envp[7]: SMF_ZONENAME=oxz_internal_dns_154e3d97-5da2-45ce-963d-328e43169c51
envp[8]: TZ=UTC
envp[9]: A__z="*SHLVL

/usr/bin/pfexec /usr/bin/pargs -ae 3693
 3693:  /opt/oxide/mgs/bin/mgs run --id-and-address-from-smf /var/svc/manifest/site/mgs
argv[0]: /opt/oxide/mgs/bin/mgs
argv[1]: run
argv[2]: --id-and-address-from-smf
argv[3]: /var/svc/manifest/site/mgs/config.toml

envp[0]: SSL_CERT_DIR=/usr/ssl/certs
envp[1]: SSL_CERT_FILE=/etc/ssl/cacert.pem
envp[2]: _=*3692*/opt/oxide/mgs/bin/mgs
envp[3]: PATH=/usr/sbin:/usr/bin
envp[4]: PWD=/
envp[5]: SHLVL=1
envp[6]: SMF_FMRI=svc:/oxide/mgs:default
envp[7]: SMF_METHOD=start
envp[8]: SMF_RESTARTER=svc:/system/svc/restarter:default
envp[9]: SMF_ZONENAME=oxz_switch
envp[10]: TZ=UTC
envp[11]: A__z="*SHLVL

/usr/bin/pfexec /usr/bin/pargs -ae 7037
 7037:  /opt/oxide/dns-server/bin/dns-server --config-file /var/svc/manifest/site/inter
argv[0]: /opt/oxide/dns-server/bin/dns-server
argv[1]: --config-file
argv[2]: /var/svc/manifest/site/internal_dns/config.toml
argv[3]: --http-address
argv[4]: [fd00:1122:3344:3::1]:5353
argv[5]: --dns-address
argv[6]: [fd00:1122:3344:3::1]:53

envp[0]: _=*5107*/usr/bin/ctrun
envp[1]: PATH=/usr/sbin:/usr/bin
envp[2]: PWD=/
envp[3]: SHLVL=1
envp[4]: SMF_FMRI=svc:/oxide/internal_dns:default
envp[5]: SMF_METHOD=start
envp[6]: SMF_RESTARTER=svc:/system/svc/restarter:default
envp[7]: SMF_ZONENAME=oxz_internal_dns_6abb87a8-8ece-45a0-a142-374d423de775
envp[8]: TZ=UTC
envp[9]: A__z="*SHLVL

/usr/bin/pfexec /usr/bin/pargs -ae 3683
 3683:  /opt/oxide/wicketd/bin/wicketd run /var/svc/manifest/site/wicketd/config.toml -
argv[0]: /opt/oxide/wicketd/bin/wicketd
argv[1]: run
argv[2]: /var/svc/manifest/site/wicketd/config.toml
argv[3]: --address
argv[4]: [::1]:12226
argv[5]: --artifact-address
argv[6]: [fdb0:e8ea:6a09:8939::2]:12227
argv[7]: --mgs-address
argv[8]: [::1]:12225
argv[9]: --nexus-proxy-address
argv[10]: [::]:12229
argv[11]: --baseboard-file
argv[12]: /opt/oxide/baseboard.json
argv[13]: --read-smf-config

envp[0]: SSL_CERT_DIR=/usr/ssl/certs
envp[1]: SSL_CERT_FILE=/etc/ssl/cacert.pem
envp[2]: _=*3681*/usr/bin/ctrun
envp[3]: PATH=/usr/sbin:/usr/bin
envp[4]: PWD=/
envp[5]: SHLVL=1
envp[6]: SMF_FMRI=svc:/oxide/wicketd:default
envp[7]: SMF_METHOD=start
envp[8]: SMF_RESTARTER=svc:/system/svc/restarter:default
envp[9]: SMF_ZONENAME=oxz_switch
envp[10]: TZ=UTC
envp[11]: A__z="*SHLVL

/usr/bin/pfexec /usr/bin/pargs -ae 7040
 7040:  /opt/oxide/dns-server/bin/dns-server --config-file /var/svc/manifest/site/inter
argv[0]: /opt/oxide/dns-server/bin/dns-server
argv[1]: --config-file
argv[2]: /var/svc/manifest/site/internal_dns/config.toml
argv[3]: --http-address
argv[4]: [fd00:1122:3344:2::1]:5353
argv[5]: --dns-address
argv[6]: [fd00:1122:3344:2::1]:53

envp[0]: _=*5076*/usr/bin/ctrun
envp[1]: PATH=/usr/sbin:/usr/bin
envp[2]: PWD=/
envp[3]: SHLVL=1
envp[4]: SMF_FMRI=svc:/oxide/internal_dns:default
envp[5]: SMF_METHOD=start
envp[6]: SMF_RESTARTER=svc:/system/svc/restarter:default
envp[7]: SMF_ZONENAME=oxz_internal_dns_7809101a-eadd-420f-8b9c-13123989187b
envp[8]: TZ=UTC
envp[9]: A__z="*SHLVL

/usr/bin/pfexec /usr/bin/pargs -ae 3700
 3700:  /opt/oxide/dendrite/bin/dpd run
argv[0]: /opt/oxide/dendrite/bin/dpd
argv[1]: run

envp[0]: SSL_CERT_DIR=/usr/ssl/certs
envp[1]: SSL_CERT_FILE=/etc/ssl/cacert.pem
envp[2]: LD_LIBRARY_PATH=/opt/oxide/bf_sde/lib
envp[3]: _=*3694*/usr/bin/env
envp[4]: PATH=/usr/sbin:/usr/bin
envp[5]: PWD=/var/dendrite
envp[6]: SHLVL=2
envp[7]: SMF_FMRI=svc:/oxide/dendrite:default
envp[8]: SMF_METHOD=start
envp[9]: SMF_RESTARTER=svc:/system/svc/restarter:default
envp[10]: SMF_ZONENAME=oxz_switch
envp[11]: TZ=UTC
envp[12]: _AST_FEATURES=UNIVERSE - att
envp[13]: A__z="*SHLVL

Copy link
Collaborator

@smklein smklein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The additional layer of structure here makes sense to me!

#[serde(rename_all = "snake_case")]
pub enum SledDiagnosticsQueryOutput {
Success {
/// The command and it's arguments.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// The command and it's arguments.
/// The command and its arguments.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 7b67092

/// The exit status of the command. This will be the exit code (if any)
/// and exit reason such as from a signal.
exit_status: String,
/// The exit code if one was present when the comman exited.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// The exit code if one was present when the comman exited.
/// The exit code if one was present when the command exited.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 7b67092

Comment on lines +42 to +43
/// Any stdout/stderr produced by the command.
stdio: String,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we're now returning structured output, would it make sense to start separating stderr and stdout? or is it more useful to keep interleaving them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally think it's more useful to have them interleaved but I am open to changing it if others think it's better.
My reasoning is being able to see where an error occurred in a command's output vs just that an error occurred at some point.

Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants