status_sampler - bruno-beloff/scs_dev GitHub Wiki

docs > software repositories > scs_dev > commands > device status


DESCRIPTION

The status_sampler utility is used to report on the configuration and condition of the host system and its peripherals. Items included in the report vary depending on the hardware configuration of the equipment. Fields which are always reported include:

  • Sensing schedule
  • Timezone
  • Unix uptime report

Fields which may be reported include:

  • AirNowSiteConf
  • GPS location
  • PSU status
  • Temperature of the host processor
  • Temperature of the digital front-end board

The status_sampler attempts to obtain a PSU status report from a file generated by psu_monitor utility.

The status_sampler writes its output to stdout, unless suppressed. As for all sensing utilities, the output format is a JSON document with fields for:

  • the unique tag of the device (if the system ID is set)
  • the recording datetime in ISO 8601 format
  • a value field containing the sensed values

Command-line options allow for single-shot reading, multiple readings with specified time intervals, or readings controlled by an independent scheduling process via a Unix semaphore.

SYNOPSIS

status_sampler.py [{ -s SEMAPHORE | -i INTERVAL [-c SAMPLES] }] [{ -x | -o }] [-v]

Options
--version show program's version number and exit
-h, --help show this help message and exit
-s SEMAPHORE, --semaphore=SEMAPHORE sampling controlled by SEMAPHORE
-i INTERVAL, --interval=INTERVAL sampling interval in seconds
-c SAMPLES, --samples=SAMPLES sample count (1 if interval not specified)
-x, --no-shutdown suppress auto-shutdown
-o, --no-output suppress reporting on stdout
-v, --verbose report narrative to stderr

EXAMPLES

./status_sampler.py -i 60

FILES

~/SCS/conf/schedule.json
~/SCS/conf/system_id.json

DOCUMENT EXAMPLE - v0

{"rec": "2021-10-06T11:13:07Z", "tag": "scs-be2-3", "val": {"tz": {"name": "Europe/London", "utc-offset": "+01:00"}, "gps": {"pos": [null, null], "elv": null, "qual": 0}, "sch": {"scs-climate": {"interval": 60.0, "tally": 1}, "scs-gases": {"interval": 10.0, "tally": 1}, "scs-status": {"interval": 60.0, "tally": 1}}, "tmp": {"brd": 29.4}, "up": {"period": "00-00:22:00", "users": 3, "load": {"av1": 0.02, "av5": 0.34, "av15": 0.67}}, "sig": {"quality": null, "recent": null}}}

DOCUMENT EXAMPLE - v1

{"rec": "2021-10-06T11:13:07Z", "tag": "scs-be2-3", "ver": 1.0, "val": {"tz": {"name": "Europe/London", "utc-offset": "+01:00"}, "gps": {"pos": [null, null], "elv": null, "qual": 0}, "sch": {"scs-climate": {"interval": 60.0, "tally": 1}, "scs-gases": {"interval": 10.0, "tally": 1}, "scs-status": {"interval": 60.0, "tally": 1}}, "tmp": {"brd": 29.4}, "up": {"period": "00-00:22:00", "users": 3, "load": {"av1": 0.02, "av5": 0.34, "av15": 0.67}}, "sig": {"quality": null, "recent": null}}}

SEE ALSO

scs_analysis/sample_distance
scs_analysis/sample_timezone

scs_dev/interface_power
scs_dev/psu_monitor
scs_dev/scheduler
scs_dev/uptime

scs_mfr/airnow_site_conf
scs_mfr/gps_conf
scs_mfr/modem
scs_mfr/psu_conf
scs_mfr/schedule
scs_mfr/system_id
scs_mfr/timezone

RESOURCES

Data formats/Topic: status
ISO 8601

BUGS

If status_sampler is run in single-shot mode, the GPS monitor may time out before being able to supply data.