Remstats Home


  About remstats
  Release Notes
  FAQ
  Conventions
  Prerequisites
  Installation
  Configuration
  Configuration Tools
  Servers
      log-server
      nt-status-server
      remoteping-server
      unix-status-server
  Collectors
  Updater
  Monitors
  run-remstats
  CGIs
  do-traceroutes
  Miscellany
  Thank-you
  Index


  Live Data

  Remstats was written by
  Thomas Erskine at the
  CRC in Canada and now
  at SourceWorks.

[Top] [Prev] [Next]

unix-status-server - allow remote gathering of unix data

Usage:

unix-status-server version 1.26
usage: ../unix-status-server [options]
where options are:
	-d nnn	enable debugging output at level 'nnn'
	-h	show this help
	-r	include remotely-mounted file-systems
	-t tst	do tests 'tst, a comma-separated list of:
		vmstat, df, uptime, netstat, uname, ps, proc, 
		ftpcount, netstat-tcpstates, fileage and qmailq

Description:

The unix-status-server allows the unix-status-collector to get data from a remote machine running some flavour of unix. It runs several different programs on request (uname, vmstat, df, uptime, netstat, ps, ftpcount, qmail-qstat, and qmail-qread).

Protocol:

The unix-status-collector connects to the unix-status-server and sends a series of commands, ending with 'GO'. Then the server sends back the data it obtained by running the requested programs and closes the connection. The commands are usually the names of programs to run (in UPPERCASE) and the ones known currently are:

  • UNAME runs uname and returns: machine, os_name, os_release, os_version
  • VMSTAT runs vmstat and returns variables relating to memory usage depending on the operating system
  • DF runs df and for each file-system returns: dfsize:FSNAME, dfused:FSNAME, dfpercent:FSNAME inodessize:FSNAME, inodesused:FSNAME, inodespercent:FSNAME
  • UPTIME runs uptime and returns: uptime (a timestamp in seconds), users, load1, load5, load15
  • NETSTAT runs netstat and, for each interface, returns: interface_packets_in:IFNAME, interface_errors_in:IFNAME, interface_packets_out:IFNAME, interface_errors_out:IFNAME, interface_collisions:IFNAME
  • PS runs ps and returns various numbers pulled out of the output (see below)
  • FTPCOUNT runs ftpcount (from wuftpd) to find out which groups the ftp-server's users fall into
  • QMAILQ runs qmail-qstat and qmail-qread and returns: qmail_qsize, qmail_qbacklog, qmail_qlocal, qmail_qsite, qmail_qremote
  • FILEAGE returns timestamps for the ages of specified files (see below)
  • TIME return the difference in time-stamps between the host running the unix-status-server and the querying host. It must be given the querying host's timestamp following the TIME directive. The two variables returned are time and timediff.

If you want to see what it returns, you can simply invoke the unix-status-server as a local script and type commands at it.

Programs:

PS Usage:

With extended commands, of which PS is the first, you also specify what you want to look for with extra commands, in addition to the PS command. A command looks like:

	varname PS func pattern

The varname is used to create a variable-name for the returned data. The name will be ps:varname. Func is one of count, sum, last, average, min, max. Pattern is a perl-style regular-expression, the simplest form of which is just a string.

For an example, if we wanted to know how many web-servers were running over time, we might use (very sloppily):

	webservers PS count httpd

[You probably want a better regular expression.]

FILEAGE Usage:

For the FILEAGE command, you have to specify an extended command that looks like:

	varname FILEAGE /path/to/file

This will produce a timestamp for the last-modification time of /path/to/file.

Notes:

With older versions of vmstat (ones that mash fields together), it will give up on vmstat and not return memory and CPU info. It also requires a version of df that will accept the -P and -i flags. The -P flag forces the output for a file-system to stay on one line (easier for me to parse) and the -i returns info about inodes. If the -i flag is missing, you won't get any inode data. You also won't get any inode data if the file-system doesn't have inodes. (Duh :-).

For details on installation, look at the server installation docs.


Last updated Thu Mar 17 17:00:13 UTC 2005 by <thomas.erskine@sourceworks.com>.
[SourceWorks] [Top] [RRDtool]