Shh... It's okay - everything is going to be alright. status is here to make all of your nightmares go away.
status provides a flexible JSON interface on top of any commands/tasks/sensors/signals/hardware/etc you want to automate. status operations can be run locally (via the CLI) or remotely (via the REST server).
Usage
Command Line
// Specify a plugin and the output you want back// In this example I specify the 'uptime' plugin with the 'total' operation$ status os uptime{"total":{"hours":7,"minutes":40,"seconds":6}}// You can pass arguments to operations too!// Arguments can be any javascript objects separated by commas$ status processes grep["skype"]{"grep":[{"id":1234, "name":"skype"}]}// Chaining operations will run them asynchronously$ status cpu temp:usage:speed{"temp":107.6, "usage":10, "speed":2100}
REST API
// Specify a plugin and the output you want back// In this example I specify the 'uptime' plugin with the 'total' operationPOST /status/os "uptime"{"total":{"hours":7,"minutes":40,"seconds":6}}// You can pass arguments to operations too!// Arguments can be any javascript objects separated by commasPOST /status/processes "grep['skype']"{"grep":[{"id":1234, "name":"skype"}]}// Chaining operations will run them asynchronouslyPOST /status/cpu "temp:usage:speed"{"temp":107.6,
Included Plugins
cpu@0.0.1 - CPU information * temp * usage * speedspotify@0.0.1 - Spotify controls/information * next * previous * toggle * pause * play * stop * open * playingprocesses@0.0.1 - Process information * all * mine * grep * topnetwork@0.0.1 - Network information * upstream * downstreamwireless@0.0.1 - Wireless network information * ssid * bssid * signal * frequency * rate * security * modehd@0.0.1 - Hard Disk information * temp * usage * total * free * useddaemons@0.0.1 - Daemon management through rc.d * list * started * stopped * auto
Writing Plugins
Let's write a plugin called "coolkern" that returns the kernel version
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.