Go to the source code of this file.
Data Structures | |
struct | mychecksum |
Defines a checksum object. More... | |
struct | mycommand |
Defines a command with ARGMAX optional arguments. More... | |
struct | mydependant |
struct | mymail |
Defines a mailinglist object. More... | |
struct | myport |
Defines a port object. More... | |
struct | myprotocol |
struct | myprocess |
Defines process data. More... | |
struct | myprocinfo |
Defines procfs (or other mechanism) data. More... | |
struct | myresource |
Defines resource data. More... | |
struct | myformat |
User selected standard mail format. More... | |
struct | myautentication |
An object holding Basic Authentication information. More... | |
struct | myenvironment |
An object holding program relevant "environment" data, see; env.c. More... | |
struct | myrun |
Defines data for application runtime. More... | |
struct | mytimestamp |
Defines timestamp object. More... | |
Defines | |
#define | VERSION PACKAGE_VERSION |
#define | MONITRC "monitrc" |
#define | TIMEFORMAT "%Z %b %e %T" |
#define | STRERROR strerror(errno) |
#define | STRLEN 256 |
#define | ARGMAX 64 |
#define | LOGMASK 0112 |
#define | PIDMASK 0122 |
#define | MYPIDDIR PIDDIR |
#define | MYPIDFILE "monit.pid" |
#define | LOCALHOST "localhost" |
#define | SMTP_PORT 25 |
#define | SMTP_TIMEOUT 30 |
#define | CHECK_TIMEOUT 30 |
#define | SSL_TIMEOUT 5 |
#define | START_HTTP 1 |
#define | STOP_HTTP 2 |
#define | TRUE 1 |
#define | FALSE 0 |
#define | FORCE_CONTROL 0 |
#define | HTTP_CONTROL 1 |
#define | MODE_ACTIVE 0 |
#define | MODE_PASSIVE 1 |
#define | MODE_MANUAL 2 |
#define | OPERATOR_GREATER 0 |
#define | OPERATOR_LESS 1 |
#define | OPERATOR_EQUAL 2 |
#define | OPERATOR_NOTEQUAL 3 |
#define | TIME_SECOND 1 |
#define | TIME_MINUTE 60 |
#define | TIME_HOUR 3600 |
#define | TIME_DAY 86400 |
#define | ACTION_ALERT 1 |
#define | ACTION_RESTART 2 |
#define | ACTION_STOP 3 |
#define | MAXIMUM(x, y) ((x) > (y) ? (x) : (y)) |
#define | is(a, b) ((a&&b)?!strcasecmp(a, b):0) |
#define | LOCK(mutex) |
------------------------------------------------- Synchronization macros | |
#define | END_LOCK pthread_mutex_unlock(_yymutex); } while (0) |
#define | NEW(p) (xcalloc(1, (long)sizeof *(p))) |
----------------------------------------------- Object Constructor macro | |
#define | ASSERT(e) |
------------------------------------------ Simple Assert Exception macro | |
Typedefs | |
typedef void | Sigfunc (int) |
Replace the standard signal function with a more reliable using sigaction. | |
typedef myport * | Port_T |
Defines a port object. | |
typedef myprotocol * | Protocol_T |
Defines a protocol object with protocol functions. | |
typedef mydependant * | Dependant_T |
typedef mychecksum * | Checksum_T |
Defines a checksum object. | |
typedef mymail * | Mail_T |
Defines a mailinglist object. | |
typedef myresource * | Resource_T |
Defines resource data. | |
typedef mytimestamp * | Timestamp_T |
Defines timestamp object. | |
typedef myprocinfo * | ProcInfo_T |
Defines procfs (or other mechanism) data. | |
typedef mycommand * | Command_T |
Defines a command with ARGMAX optional arguments. | |
typedef myprocess * | Process_T |
Defines process data. | |
Functions | |
Sigfunc * | signal (int signo, Sigfunc *func) |
Replace the standard signal() function, with a more reliable using sigaction. | |
void | error (const char *,...) |
Print a formated message to stderr or to the logfile if no tty exist. | |
char * | trim (char *) |
Remove leading and trailing space from the string. | |
char * | ltrim (char *) |
Remove leading white space [ \t\r ] from the string. | |
char * | rtrim (char *) |
Remove trailing white space [ \t\r ] from the string. | |
char * | trim_quotes (char *) |
Remove any enclosing quotes ["'] from the string. | |
int | starts_with (char *, char *) |
Return TRUE if the string a starts with the string b. | |
void | handle_string_escapes (char *) |
Exchanges \escape sequences in a string. | |
void | chomp (char *) |
Removes everything from the first newline (CR|LF). | |
int | exist_process (char *) |
Process_T | get_process (char *) |
void | printrunlist () |
Print the Runtime object. | |
void | printprocess (Process_T) |
Print a process object. | |
void | printprocesslist () |
Print all the processes in the processlist. | |
pid_t | get_pid (char *) |
Open and read the pid from the given pidfile. | |
int | is_process_running (Process_T) |
int | is_strdefined (char *) |
int | isreg_file (char *) |
Check if the file is a regular file. | |
char * | stripfilename (char *) |
Strip the path and return only the filename. | |
int | exist_file (char *) |
char * | get_ctime () |
Get a non terminated ctime. | |
char * | get_RFC1123date (long *) |
Returns a (RFC1123) Date string. | |
char * | get_uptime (long delta) |
char * | get_process_uptime (char *) |
Compute an uptime string for a process based on the ctime from the pidfile. | |
char * | get_md5sum (char *) |
int | check_md5 (char *, char *) |
char * | url_encode (char *uri) |
Escape an uri string converting unsafe characters to a hex (xx) representation. | |
char * | get_basic_authentication_header () |
int | set_md5sum (char **, char *) |
Compute a md5 checksum for the given file and save the result in an allocated area pointed to by dest. | |
int | parse (char *) |
void | control (char *, int) |
Start/stop all processes in process list. | |
void | control_group (char *, char *, int) |
void | d_check_process (char *, char *) |
Pass on to methods in http/cervlet.c to start/stop processes. | |
void | check_process (char *, char *, int) |
Check to see if we should try to start/stop process. | |
void | setup_dependants () |
void | reset_depend () |
void | spawn (Process_T, Command_T) |
Execute the given command. | |
void | status () |
Show all processes in the process list. | |
void | status_group (char *) |
Show all processes in the group. | |
int | log_init () |
Initialize the log system and 'log' function. | |
void | log (const char *format,...) |
Log a message to monits logfile or syslog. | |
void | log_close () |
Close the log file or syslog. | |
int | get_log_fd () |
void | validate () |
Walk the process-list and validate each process. | |
void | daemonize () |
Transform a program into a daemon. | |
void | gc () |
void | gc_process (Process_T *) |
void | gc_mail_list (Mail_T *) |
void | init_files () |
Initialize the programs file variables. | |
time_t | get_timestamp (char *, mode_t) |
Get a object's last modified timestamp. | |
void | finalize_files () |
Remove temporary files. | |
char * | find_rcfile () |
Search the system for the monit control file. | |
int | create_pidfile (char *) |
Create a program's pidfile - Such a file is created when in daemon mode. | |
int | is_rcfile_changed () |
Test the monit control file for changes. | |
int | check_rcfile (char *) |
Secure check the monitrc file. | |
int | kill_daemon () |
Kill a daemon process. | |
int | exist_daemon () |
void | sendmail (Mail_T) |
Send SMTP mail messages. | |
int | sock_msg (int sock, char *,...) |
void | init_env () |
Initialize the program environment. | |
void * | xmalloc (int) |
void * | xcalloc (long, long) |
char * | xstrdup (const char *) |
void * | xresize (void *, long) |
void | set_alarm_handler (void *) |
Set a handler for the alarm signal, SIGALRM using sigaction. | |
void | monit_http (int) |
Start and stop the monit http server. | |
int | check_httpd () |
Check if the HTTPD server is running. | |
int | can_http () |
char * | format (const char *, va_list) |
Do printf style format line parsing. | |
void | redirect_stdfd () |
Redirect the standard file descriptors to /dev/null and route any error messages to the log file. | |
pid_t | getpgid (pid_t) |
int | check_file (char *, char *, int) |
Security check for files. | |
Variables | |
Process_T | processlist |
The process list (created in p.y). | |
char * | prog |
The Name of this Program. | |
myrun | Run |
Struct holding runtime constants. |
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 103 of file monitor.h. Referenced by add_host_allow(), delete_accepted_ssl_socket(), destroy_hosts_allow(), has_hosts_allow(), and insert_accepted_ssl_socket(). |
|
|
|
|
|
|
|
Definition at line 89 of file monitor.h. Referenced by check_process(), control_group(), exist_process(), get_process(), and status_group(). |
|
|
|
Value: do { pthread_mutex_t *_yymutex = &(mutex); \
pthread_mutex_lock(_yymutex);
Definition at line 101 of file monitor.h. Referenced by add_host_allow(), delete_accepted_ssl_socket(), destroy_hosts_allow(), has_hosts_allow(), and insert_accepted_ssl_socket(). |
|
|
|
Definition at line 88 of file monitor.h. Referenced by get_timestamp(). |
|
|
|
|
|
|
|
Definition at line 42 of file monitor.h. Referenced by find_rcfile(). |
|
Definition at line 51 of file monitor.h. Referenced by init_files(). |
|
Definition at line 52 of file monitor.h. Referenced by init_files(). |
|
----------------------------------------------- Object Constructor macro
Definition at line 108 of file monitor.h. Referenced by add_host_allow(), create_default(), create_ftp(), create_http(), create_imap(), create_nntp(), create_pop(), create_smtp(), create_ssh(), insert_accepted_ssl_socket(), new_ssl_connection(), new_ssl_server_connection(), and set_header(). |
|
|
|
|
|
|
|
|
|
Definition at line 50 of file monitor.h. Referenced by create_pidfile(). |
|
|
|
Definition at line 57 of file monitor.h. Referenced by sendmail(). |
|
Definition at line 59 of file monitor.h. Referenced by embed_accepted_ssl_socket(), embed_ssl_socket(), recv_ssl_socket(), and send_ssl_socket(). |
|
Definition at line 61 of file monitor.h. Referenced by monit_http(). |
|
Definition at line 62 of file monitor.h. Referenced by monit_http(). |
|
Definition at line 44 of file monitor.h. Referenced by check_file(), check_ftp(), check_http(), check_imap(), check_nntp(), check_pop(), check_smtp(), check_ssh(), create_pidfile(), daemonize(), get_pid(), kill_daemon(), log_close(), redirect_stdfd(), start_httpd(), xcalloc(), xmalloc(), and xresize(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 41 of file monitor.h. Referenced by check_http(), and sendmail(). |
|
Defines a checksum object.
|
|
Defines a command with ARGMAX optional arguments. The arguments array must be NULL terminated and the first entry is the program itself. |
|
|
|
Defines a mailinglist object.
|
|
Defines a port object.
|
|
Defines process data.
|
|
Defines procfs (or other mechanism) data.
|
|
Defines a protocol object with protocol functions.
|
|
Defines resource data.
|
|
Replace the standard signal function with a more reliable using sigaction.
Definition at line 93 of file monitor.h. Referenced by signal(). |
|
Defines timestamp object.
|
|
Definition at line 86 of file monit_http.c. References myrun::Auth, myrun::myautentication::defined, myrun::dohttpd, has_hosts_allow(), myrun::isdaemon, log(), prog, and Run. |
|
Security check for files. The files must have the same uid as the REAL uid of this process, it must have permissions no greater than "maxpermission" and it must not be a symbolic link. We check these conditions here.
Definition at line 284 of file files.c. References ASSERT, log(), prog, and STRERROR. Referenced by check_rcfile(). |
|
Check if the HTTPD server is running.
Definition at line 73 of file monit_http.c. References myrun::bind_addr, check_connect(), myrun::httpdport, and Run. |
|
Definition at line 918 of file util.c. References ASSERT, and get_md5sum(). |
|
Check to see if we should try to start/stop process.
Definition at line 195 of file control.c. References ASSERT, myrun::controlfile, error(), get_process(), is, is_process_running(), prog, Run, myprocess::start, and myprocess::stop. Referenced by control(), and control_group(). |
|
Secure check the monitrc file. The run control file must have the same uid as the REAL uid of this process, it must have permissions no greater than 700 and it must not be a symbolic link. We check these conditions here.
Definition at line 233 of file files.c. References ASSERT, and check_file(). |
|
Removes everything from the first newline (CR|LF).
Definition at line 143 of file util.c. References ASSERT. Referenced by check_ftp(), check_http(), check_imap(), check_nntp(), check_pop(), check_smtp(), check_ssh(), and get_ctime(). |
|
Start/stop all processes in process list.
Definition at line 70 of file control.c. References ASSERT, check_process(), d_check_process(), exist_daemon(), myprocess::name, myprocess::next, processlist, reset_depend(), and myprocess::visited. |
|
Definition at line 97 of file control.c. References ASSERT, check_process(), d_check_process(), exist_daemon(), myprocess::group, is, myprocess::name, myprocess::next, processlist, reset_depend(), and myprocess::visited. |
|
Create a program's pidfile - Such a file is created when in daemon mode. The file is created with mask = PIDMASK (usually 644).
|
|
Pass on to methods in http/cervlet.c to start/stop processes.
Definition at line 126 of file control.c. References ASSERT, myrun::bind_addr, close_socket(), close_ssl_socket(), create_socket(), delete_ssl_socket(), embed_ssl_socket(), error(), get_basic_authentication_header(), myrun::httpdport, myrun::httpdssl, myrun::httpsslpem, new_ssl_connection(), prog, Run, send_ssl_socket(), sock_send(), and ssl_connection. Referenced by control(), and control_group(). |
|
Transform a program into a daemon. Inspired by code from Stephen A. Rago's book, Unix System V Network Programming. Definition at line 70 of file daemonize.c. References log(), redirect_stdfd(), signal(), and STRERROR. |
|
Print a formated message to stderr or to the logfile if no tty exist.
Definition at line 86 of file util.c. References ASSERT, format(), myrun::have_tty, log(), and Run. Referenced by check_process(), create_ssl_server_socket(), create_ssl_socket(), d_check_process(), embed_accepted_ssl_socket(), embed_ssl_socket(), init_ssl_server(), kill_daemon(), log_close(), new_ssl_connection(), recv_ssl_socket(), redirect_stdfd(), send_ssl_socket(), start_httpd(), xcalloc(), xmalloc(), and xresize(). |
|
Definition at line 177 of file daemonize.c. References is_process_running(), myrun::pidfile, myprocess::pidfile, and Run. Referenced by control(), control_group(), and kill_daemon(). |
|
Definition at line 263 of file files.c. References ASSERT. Referenced by find_rcfile(), and get_pid(). |
|
Definition at line 343 of file util.c. References ASSERT, is, myprocess::name, myprocess::next, and processlist. |
|
Remove temporary files.
Definition at line 98 of file files.c. References myrun::pidfile, and Run. |
|
Search the system for the monit control file. Try first ~/.monitrc, if that fails try ./monitrc and finally /etc/monitrc. Exit the application if the control file is not found.
Definition at line 147 of file files.c. References myrun::myenvironment::cwd, myrun::Env, exist_file(), myrun::myenvironment::home, log(), MONITRC, prog, Run, and xmalloc(). |
|
Do printf style format line parsing.
Definition at line 1009 of file util.c. References ASSERT, xmalloc(), and xresize(). Referenced by error(). |
|
Definition at line 55 of file gc.c. References gc_protocols(), myrun::mygroup, processlist, and Run. |
|
Definition at line 131 of file gc.c. References ASSERT. Referenced by gc_process(), and spawn(). |
|
Definition at line 64 of file gc.c. References ASSERT, and gc_mail_list(). |
|
Definition at line 981 of file util.c. References myrun::Auth, myrun::myautentication::defined, encode_base64(), myrun::myautentication::passwd, Run, myrun::myautentication::uname, xmalloc(), and xstrdup(). Referenced by d_check_process(). |
|
Get a non
|
|
|
|
Definition at line 869 of file util.c. References ASSERT, isreg_file(), and xstrdup(). Referenced by check_md5(), and set_md5sum(). |
|
Open and read the pid from the given pidfile.
Definition at line 649 of file util.c. References ASSERT, exist_file(), isreg_file(), log(), prog, and STRERROR. Referenced by is_process_running(). |
|
Definition at line 321 of file util.c. References ASSERT, is, myprocess::name, myprocess::next, and processlist. Referenced by check_process(). |
|
Compute an uptime string for a process based on the ctime from the pidfile. The caller must free the returned string.
Definition at line 788 of file util.c. References ASSERT, get_timestamp(), get_uptime(), and xstrdup(). Referenced by status(). |
|
Returns a (RFC1123) Date string. If the given date is NULL compute the date now.
Definition at line 726 of file util.c. References xstrdup(). Referenced by sendmail(). |
|
Get a object's last modified timestamp.
Definition at line 112 of file files.c. References ASSERT, log(), MAXIMUM, and prog. Referenced by get_process_uptime(), init_files(), and is_rcfile_changed(). |
|
|
|
Referenced by is_process_running(). |
|
Exchanges \escape sequences in a string.
Definition at line 262 of file util.c. References ASSERT. |
|
Initialize the program environment.
Definition at line 73 of file env.c. References myrun::have_tty, and Run. Referenced by main(). |
|
Initialize the programs file variables.
Definition at line 68 of file files.c. References myrun::controlfile, myrun::Env, get_timestamp(), myrun::myenvironment::home, MYPIDDIR, MYPIDFILE, myrun::pidfile, Run, myrun::timestamp, and xstrdup(). |
|
Definition at line 698 of file util.c. References ASSERT, get_pid(), getpgid(), and myprocess::pidfile. Referenced by check_process(), and exist_daemon(). |
|
Test the monit control file for changes.
Definition at line 218 of file files.c. References myrun::controlfile, get_timestamp(), Run, and myrun::timestamp. |
|
|
|
Check if the file is a regular file.
Definition at line 247 of file files.c. References ASSERT. Referenced by get_md5sum(), and get_pid(). |
|
Kill a daemon process.
Definition at line 145 of file daemonize.c. References error(), exist_daemon(), prog, and STRERROR. |
|
Log a message to monits logfile or syslog.
Definition at line 111 of file log.c. References ASSERT, myrun::dolog, myrun::have_tty, Run, and myrun::use_syslog. Referenced by can_http(), check_file(), check_ftp(), check_http(), check_imap(), check_nntp(), check_pop(), check_smtp(), check_ssh(), create_pidfile(), daemonize(), error(), find_rcfile(), get_pid(), get_timestamp(), monit_http(), out_print(), spawn(), and validate(). |
|
Close the log file or syslog.
Definition at line 149 of file log.c. References error(), prog, Run, STRERROR, and myrun::use_syslog. Referenced by log_init(). |
|
Initialize the log system and 'log' function.
Definition at line 84 of file log.c. References myrun::dolog, log_close(), and Run. |
|
Remove leading white space [ \t\r
Definition at line 176 of file util.c. References ASSERT. Referenced by trim(). |
|
Start and stop the monit http server.
Definition at line 112 of file monit_http.c. References log(), prog, START_HTTP, STOP_HTTP, and stop_httpd(). |
|
|
|
|
Print all the processes in the processlist.
Definition at line 624 of file util.c. References myprocess::next, printprocess(), and processlist. |
|
Print the Runtime object.
Definition at line 361 of file util.c. References myrun::allowselfcert, myrun::Auth, myrun::bind_addr, myrun::controlfile, myrun::debug, myrun::myautentication::defined, myrun::dohttpd, myrun::dolog, myrun::doprocess, myrun::myformat::from, myrun::httpdport, myrun::httpdssl, myrun::httpsslclientpem, myrun::httpsslpem, myrun::isdaemon, myrun::logfile, myrun::MailFormat, myrun::mailserver, myrun::myformat::message, myrun::pidfile, myrun::polltime, Run, myrun::myformat::subject, and myrun::use_syslog. |
|
Redirect the standard file descriptors to /dev/null and route any error messages to the log file.
Definition at line 1042 of file util.c. References error(), myrun::have_tty, Run, and STRERROR. Referenced by daemonize(), and spawn(). |
|
Definition at line 243 of file control.c. References myprocess::depend_visited, myprocess::next, processlist, and myprocess::visited. Referenced by control(), control_group(), and validate(). |
|
Remove trailing white space [ \t\r
Definition at line 194 of file util.c. References ASSERT. Referenced by trim(). |
|
Send SMTP mail messages.
Definition at line 78 of file sendmail.c. References mymail::from, get_localhostname(), get_RFC1123date(), mymail::message, mymail::next, mymail::opt_message, prog, SMTP_TIMEOUT, mymail::subject, mymail::to, and VERSION. Referenced by spawn(). |
|
Set a handler for the alarm signal, SIGALRM using sigaction.
|
|
Compute a md5 checksum for the given file and save the result in an allocated area pointed to by dest. The caller is responsible for freeing dest.
Definition at line 853 of file util.c. References ASSERT, and get_md5sum(). |
|
|
|
Replace the standard signal() function, with a more reliable using sigaction. From W. Richard Stevens' "Advanced Programming in the UNIX Environment" Definition at line 47 of file signal.c. References Sigfunc. Referenced by daemonize(), and spawn(). |
|
|
|
Execute the given command. If the execution fails, an alert message is sent to the email addresses found in the process object that has registred interest for restart alerts.
Definition at line 84 of file spawn.c. References mycommand::arg, ASSERT, gc_mail_list(), log(), redirect_stdfd(), Run, sendmail(), signal(), and myrun::umask. |
|
Return TRUE if the string a starts with the string b.
|
|
Show all processes in the process list.
Definition at line 69 of file status.c. References delete_ssl_socket(), get_process_uptime(), myrun::httpdssl, myrun::httpsslpem, new_ssl_connection(), myprocess::next, myrun::pidfile, processlist, Run, and ssl_connection. |
|
Show all processes in the group.
Definition at line 111 of file status.c. References ASSERT, delete_ssl_socket(), myprocess::group, myrun::httpdssl, myrun::httpsslclientpem, is, new_ssl_connection(), myprocess::next, processlist, Run, and ssl_connection. |
|
Strip the path and return only the filename.
Definition at line 126 of file util.c. References ASSERT. Referenced by main(). |
|
Remove leading and trailing space from the string.
|
|
Remove any enclosing quotes ["'] from the string.
Definition at line 214 of file util.c. References ASSERT. |
|
Escape an uri string converting unsafe characters to a hex (xx) representation. The caller must free the returned string.
|
|
Walk the process-list and validate each process.
Definition at line 90 of file validate.c. References log(), myprocess::next, processlist, reset_depend(), update_loadavg(), and myprocess::visited. |
|
|
|
Definition at line 52 of file xmalloc.c. References error(), prog, and STRERROR. Referenced by decode_base64(), encode_base64(), find_rcfile(), format(), get_basic_authentication_header(), get_ctime(), makeword(), out_print(), url_encode(), xresize(), and xstrdup(). |
|
Definition at line 112 of file xmalloc.c. References error(), prog, STRERROR, and xmalloc(). Referenced by format(), and out_print(). |
|
Definition at line 98 of file xmalloc.c. References ASSERT, and xmalloc(). Referenced by add_host_allow(), get_basic_authentication_header(), get_header(), get_headers(), get_md5sum(), get_parameter(), get_process_uptime(), get_RFC1123date(), get_status_string(), get_uptime(), init_files(), insert_accepted_ssl_socket(), new_ssl_connection(), new_ssl_server_connection(), set_header(), set_status(), and update_ssl_cert_data(). |
|
The process list (created in p.y).
Definition at line 314 of file monitor.h. Referenced by control(), control_group(), exist_process(), gc(), get_process(), printprocesslist(), reset_depend(), status(), status_group(), and validate(). |
|
The Name of this Program.
Definition at line 315 of file monitor.h. Referenced by can_http(), check_file(), check_http(), check_process(), create_pidfile(), create_ssl_server_socket(), create_ssl_socket(), d_check_process(), embed_accepted_ssl_socket(), embed_ssl_socket(), find_rcfile(), get_pid(), get_timestamp(), init_ssl_server(), kill_daemon(), log_close(), main(), monit_http(), new_ssl_connection(), recv_ssl_socket(), send_ssl_socket(), sendmail(), xcalloc(), xmalloc(), and xresize(). |
|
Struct holding runtime constants.
Definition at line 316 of file monitor.h. Referenced by can_http(), check_httpd(), check_process(), d_check_process(), destroy_wrapper(), error(), exist_daemon(), finalize_files(), find_rcfile(), gc(), get_basic_authentication_header(), init_env(), init_files(), is_rcfile_changed(), log(), log_close(), log_init(), printrunlist(), redirect_stdfd(), spawn(), start_httpd(), status(), status_group(), and update_loadavg(). |