The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

server-status - a script to show the status of the local server

SYNOPSIS

  % server-status --scoreboard server-status --counter server-status/access-counter

  Total Accesses: 123
  BusyWorkers: 2
  IdleWorkers: 3
  --
  pid status remote_addr host method uri protocol ss
  20060 A 127.0.0.1 localhost:10001 GET / HTTP/1.1 1
  20061 .
  20062 A 127.0.0.1 localhost:10001 GET /server-status HTTP/1.1 0
  20063 .
  20064 .

  # JSON format
  % server-status --json --counter ~/server-status/access-counter
  {"BusyWorkers":"2",
   "stats":[
     {"protocol":null,"remote_addr":null,"pid":"78639",
      "status":".","method":null,"uri":null,"host":null,"ss":null},
     {"protocol":"HTTP/1.1","remote_addr":"127.0.0.1","pid":"78640",
      "status":"A","method":"GET","uri":"/","host":"localhost:10226","ss":0},
     ...
  ],"IdleWorkers":"3"}

DESCRIPTION

This is a simple command-line script that examines the local server status files to report on the status of a locally-running server, without incurring any network overhead nor using a worker.

OPTIONS

scoreboard

Required - same as the scoreboard option in the middleware.

counter_file

Optional - same as the counter_file option in the middleware.

json

Optional - when provided, returns the data in JSON format. Defaults to false.

skip_ps_command

Optional - when provided, skip executes `ps command`. Please read perldoc Plack::Middleware::ServerStatus::Lite for details

help|h

Display help

CAVEATS

This script mirrors the middleware's behaviour when the skip_ps_command option is set, because currently we do not know the server's parent pid (the process where the middleware was originally loaded, before worker processes are forked off). Therefore, data will be incomplete if not every worker has yet serviced a request before this script is run.

AUTHOR

Karen Etheridge <ether {at} cpan.org> Masahiro Nagano <kazeburo {at} cpan.org>

SEE ALSO

Plack::Middleware::ServerStatus::Lite

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.