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
  pagemakers
  run-remstats2
  CGIs
  troubleshooting
  do-traceroutes
  Miscellany
  Thank-you
  Index


Live Data

Remstats was written by Thomas Erskine at the CRC in Canada and now looking for work.

[Top] [Prev] [Next]

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

Usage:

unix-status-server version 1.43 from remstats 1.0.13a
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, MASQCONN,
          FTPCOUNT, NETSTAT-TCPSTATES, FILEAGE, QMAILQSTAT,
          QMAILQREAD, PROCNAME, PROCDISKIO, PROCMEMINFO, SAR

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
  • QMAILQSTAT runs qmail-qstat and returns: qmail_qsize, qmail_qbacklog
  • QMAILQREAD runs qmail-qread and returns FIXME
  • 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.
  • NETSTAT-TCPSTATES runs netstat and produces counts of the number of tcp sessions in the various TCP states.
  • SAR runs "sar -A" and produces a lot of operating-system specific info.

If you want to see what it will return, 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.

PROCNAME Usage:

PROCNAME examines /proc (only under linux) and produces counts of specified named processes

PROCDISKIO Usage:

PROCDISKIO examines /proc/stat (only under linux) and returns disk I/O operation and bytes counts.

PROCMEMINFO Usage:

PROCMEMINFO examines /proc/meminfo (only under linux) and returns returns the memory stats. Some-one please tell me terskine@users.sourceforge.net if you can interpret these to tell when a host is really running out of memory.

PROCNETDEV Usage:

PROCNETDEV examines /proc/net/dev (only under linux) and returns usefull network counters

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.


[Top] [Remstats] [SourceWorks] [RRDtool] [SourceForge]
Last updated Fri May 30 13:51:13 PDT 2003 by <terskine@users.sourceforge.net>.