Vtstats iconVtstats 0.0.2

Vtstats is a supplemental module for use with other modules collectively forming a ServerKit personality.
Vtstats is a supplemental module for use with other modules collectively forming a ServerKit personality.

Vtstats's purpose is to report ServerKit runtime statistics on a virtual terminal periodically, optionally with screen blanking disabled in the interests of keeping recent statistics available in the face of system failures, overloads, or access rest

The information displayed is the same information you see on the server processes output upon delivery of SIGUSR1, but the vtstats report loop is unrelated to the builtin ServerKit signal-driven statistics report beyond sharing the same reporting function.

When used along with disabled screen blanking and vt activation enabled, this module takes advantage of the characteristic of frame buffers to independently continue displaying the contents of memory regardless of the overall system health/state. Even when the machine is frozen the RAMDAC continues "displaying" the contents of video memory.

If you do not disable screen blanking, you lose the ability to simply attach a display adapter and view the current video memory contents in situations where the machine is unable to respond to keypresses or other events that would normally unblank the screen. (lockups)

Usage

It is advised that you read the ServerKit documentation before trying to use this module, as most of the basic usage is simply using ServerKit, nothing specific to this module.

To integrate vtstats into existing ServerKit personalities, simply add the vtstats.so module to the existing personalities modules subdirectory. Configuration of the vtstats module is achieved through adding a vtstats section to your existing c11n file.

Vtstats will generally require a server process that starts as root so it can manipulate /dev/console. It is recommended that you configure the personality to switch users using the uid and gid directives when executing as root. Note that in order for ServerKit to allow root execution, the executes_as_root configuration option must be set to true.

Note:

ServerKit versions 1.2.0 and earlier contain a bug in the reporting function which ignores the supplied FILE * and prints directly to stderr. If when vtstats reports statistics you get some of the statistics printed to stderr instead of the virtual terminal, your ServerKit has the bug.

Configuration options for the vtstats section:

period, integer, default=5:
How long to wait in seconds between reports

vt_number, integer, default=0:
Which virtual terminal to use, these are the "virtual consoles" you
access with alt-fN generally in linux. Setting to 0 instructs vtstats
to find the next available vt.

activate_vt, boolean, default=false:
Set to true if you want vtstats to "activate" the vt being used, this
will result in the "focusing" of the vt being used for statistics so
they will be on-screen without intervention, which incidentally also
adds scrollback history until the focus is changed.

disable_blanking, boolean, default=false:
Set to true if you want vtstats to disable the blanking & powersave
features of the console driver. Generally in datacenters there are no
permanent displays connected to the servers so this doesnt produce a
huge waste of energy in that case. It is useful because if a server is
frozen, and the screen has been blanked, it will not be able to respond
to a keypress (or other user generated event) to unblank the screen.
Thus rendering the likely present statistics in video memory
inaccessible because they are not being actively displayed :(.

Generally, this module will require that your personality start as root. All
of the vtstats open and ioctl operations occur during the "prestart" phase of
server initialization. The "prestart" phase occurs before any user switching is done so starting as root is effective in allowing vtstats to manipulate
/dev/console. To keep things sane, you should use the uid & gid core server configuration options to drop root privileges after performing all prestart duties.

It's common to start personalities as root anywyas, because things like binding to port 110 (for a pop server) or port 80 (for http server) require root. In these cases adding vtstats is simplest.



Here is a sample configuration of a r2d2 pop3 server personality c11n file which configures both the r2d2 and vtstats modules:



identity = pop3
executes_as_root=true
uid = 11000
gid = 11000

database testdb {
name = testdatabase
user = foo
password = bar
host = localhost
pool_max = 100
pool_min = 1
}

vtstats {
activate_vt = true
disable_blanking = true
period = 1
}

r2d2 {
max_threads = 10
min_threads = 1
database = testdb
port = 1100

#TLS-related options below
tls_port = 9950
tls_address = 0.0.0.0
x509_key_file = "x509-server-key.pem"
x509_cert_file = "x509-server.pem"
}



The above disables blanking, enables the vt switch, sets a period of 1 second (1HZ) and uses the default behavior of finding the next available VT.

It's as simple as adding a vtstats section to your c11n file to change the
defaults, and adding the vtstats.so to your modules directory either by placing the module there or symlinking it from there.

Requirements:

ServerKit

What's New in This Release:

Updated report method to be ServerKit 2.x compatible
Added c11n and run files
Cleaned up some blanking-disable related things

last updated on:
December 19th, 2007, 11:18 GMT
price:
FREE!
developed by:
Vito Caputo
license type:
GPL (GNU General Public License) 
category:
ROOT \ System \ Monitoring

FREE!

In a hurry? Add it to your Download Basket!

user rating 16

UNRATED
3.1/5
 

0/5

Add your review!

SUBMIT