mod_status.c revision 98fb535f829e2a95aabd82420931f476661fa8e3
ccaa75089b23c0f043cdbd4001cba4e076ca4fd3Kristina Sojakova/* ====================================================================
e9458b1a7a19a63aa4c179f9ab20f4d50681c168Jens Elkner * The Apache Software License, Version 1.1
ccaa75089b23c0f043cdbd4001cba4e076ca4fd3Kristina Sojakova *
ccaa75089b23c0f043cdbd4001cba4e076ca4fd3Kristina Sojakova * Copyright (c) 2000-2003 The Apache Software Foundation. All rights
98890889ffb2e8f6f722b00e265a211f13b5a861Corneliu-Claudiu Prodescu * reserved.
ccaa75089b23c0f043cdbd4001cba4e076ca4fd3Kristina Sojakova *
ccaa75089b23c0f043cdbd4001cba4e076ca4fd3Kristina Sojakova * Redistribution and use in source and binary forms, with or without
ccaa75089b23c0f043cdbd4001cba4e076ca4fd3Kristina Sojakova * modification, are permitted provided that the following conditions
ccaa75089b23c0f043cdbd4001cba4e076ca4fd3Kristina Sojakova * are met:
ccaa75089b23c0f043cdbd4001cba4e076ca4fd3Kristina Sojakova *
e8dd447a2aa5fbac10668749dfe4142c05ec3d7dKristina Sojakova * 1. Redistributions of source code must retain the above copyright
ccaa75089b23c0f043cdbd4001cba4e076ca4fd3Kristina Sojakova * notice, this list of conditions and the following disclaimer.
ccaa75089b23c0f043cdbd4001cba4e076ca4fd3Kristina Sojakova *
ccaa75089b23c0f043cdbd4001cba4e076ca4fd3Kristina Sojakova * 2. Redistributions in binary form must reproduce the above copyright
e8dd447a2aa5fbac10668749dfe4142c05ec3d7dKristina Sojakova * notice, this list of conditions and the following disclaimer in
ccaa75089b23c0f043cdbd4001cba4e076ca4fd3Kristina Sojakova * the documentation and/or other materials provided with the
ccaa75089b23c0f043cdbd4001cba4e076ca4fd3Kristina Sojakova * distribution.
ccaa75089b23c0f043cdbd4001cba4e076ca4fd3Kristina Sojakova *
ccaa75089b23c0f043cdbd4001cba4e076ca4fd3Kristina Sojakova * 3. The end-user documentation included with the redistribution,
ccaa75089b23c0f043cdbd4001cba4e076ca4fd3Kristina Sojakova * if any, must include the following acknowledgment:
5e35940c3516ccea02caa0450d2b075de0106fa5Kristina Sojakova * "This product includes software developed by the
ccaa75089b23c0f043cdbd4001cba4e076ca4fd3Kristina Sojakova * Apache Software Foundation (http://www.apache.org/)."
abd5fc85dc7e19b1614890182436940e922963a4Kristina Sojakova * Alternately, this acknowledgment may appear in the software itself,
ccaa75089b23c0f043cdbd4001cba4e076ca4fd3Kristina Sojakova * if and wherever such third-party acknowledgments normally appear.
abd5fc85dc7e19b1614890182436940e922963a4Kristina Sojakova *
ccaa75089b23c0f043cdbd4001cba4e076ca4fd3Kristina Sojakova * 4. The names "Apache" and "Apache Software Foundation" must
e8dd447a2aa5fbac10668749dfe4142c05ec3d7dKristina Sojakova * not be used to endorse or promote products derived from this
ccaa75089b23c0f043cdbd4001cba4e076ca4fd3Kristina Sojakova * software without prior written permission. For written
5e35940c3516ccea02caa0450d2b075de0106fa5Kristina Sojakova * permission, please contact apache@apache.org.
5e35940c3516ccea02caa0450d2b075de0106fa5Kristina Sojakova *
5e35940c3516ccea02caa0450d2b075de0106fa5Kristina Sojakova * 5. Products derived from this software may not be called "Apache",
ccaa75089b23c0f043cdbd4001cba4e076ca4fd3Kristina Sojakova * nor may "Apache" appear in their name, without prior written
118add2c5ac398465f6f66adb165852dffe1264dKristina Sojakova * permission of the Apache Software Foundation.
5e35940c3516ccea02caa0450d2b075de0106fa5Kristina Sojakova *
5e35940c3516ccea02caa0450d2b075de0106fa5Kristina Sojakova * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
118add2c5ac398465f6f66adb165852dffe1264dKristina Sojakova * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
ccaa75089b23c0f043cdbd4001cba4e076ca4fd3Kristina Sojakova * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
5e35940c3516ccea02caa0450d2b075de0106fa5Kristina Sojakova * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
abd5fc85dc7e19b1614890182436940e922963a4Kristina Sojakova * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
abd5fc85dc7e19b1614890182436940e922963a4Kristina Sojakova * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
abd5fc85dc7e19b1614890182436940e922963a4Kristina Sojakova * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
abd5fc85dc7e19b1614890182436940e922963a4Kristina Sojakova * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
abd5fc85dc7e19b1614890182436940e922963a4Kristina Sojakova * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
abd5fc85dc7e19b1614890182436940e922963a4Kristina Sojakova * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
abd5fc85dc7e19b1614890182436940e922963a4Kristina Sojakova * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
ccaa75089b23c0f043cdbd4001cba4e076ca4fd3Kristina Sojakova * SUCH DAMAGE.
ccaa75089b23c0f043cdbd4001cba4e076ca4fd3Kristina Sojakova * ====================================================================
abd5fc85dc7e19b1614890182436940e922963a4Kristina Sojakova *
ccaa75089b23c0f043cdbd4001cba4e076ca4fd3Kristina Sojakova * This software consists of voluntary contributions made by many
ccaa75089b23c0f043cdbd4001cba4e076ca4fd3Kristina Sojakova * individuals on behalf of the Apache Software Foundation. For more
ccaa75089b23c0f043cdbd4001cba4e076ca4fd3Kristina Sojakova * information on the Apache Software Foundation, please see
ccaa75089b23c0f043cdbd4001cba4e076ca4fd3Kristina Sojakova * <http://www.apache.org/>.
5e35940c3516ccea02caa0450d2b075de0106fa5Kristina Sojakova *
5e35940c3516ccea02caa0450d2b075de0106fa5Kristina Sojakova * Portions of this software are based upon public domain software
5e35940c3516ccea02caa0450d2b075de0106fa5Kristina Sojakova * originally written at the National Center for Supercomputing Applications,
5e35940c3516ccea02caa0450d2b075de0106fa5Kristina Sojakova * University of Illinois, Urbana-Champaign.
5e35940c3516ccea02caa0450d2b075de0106fa5Kristina Sojakova */
ccaa75089b23c0f043cdbd4001cba4e076ca4fd3Kristina Sojakova
5e35940c3516ccea02caa0450d2b075de0106fa5Kristina Sojakova/* Status Module. Display lots of internal data about how Apache is
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder * performing and the state of all children processes.
ccaa75089b23c0f043cdbd4001cba4e076ca4fd3Kristina Sojakova *
e8dd447a2aa5fbac10668749dfe4142c05ec3d7dKristina Sojakova * To enable this, add the following lines into any config file:
e8dd447a2aa5fbac10668749dfe4142c05ec3d7dKristina Sojakova *
e8dd447a2aa5fbac10668749dfe4142c05ec3d7dKristina Sojakova * <Location /server-status>
e8dd447a2aa5fbac10668749dfe4142c05ec3d7dKristina Sojakova * SetHandler server-status
e8dd447a2aa5fbac10668749dfe4142c05ec3d7dKristina Sojakova * </Location>
e8dd447a2aa5fbac10668749dfe4142c05ec3d7dKristina Sojakova *
e8dd447a2aa5fbac10668749dfe4142c05ec3d7dKristina Sojakova * You may want to protect this location by password or domain so no one
e8dd447a2aa5fbac10668749dfe4142c05ec3d7dKristina Sojakova * else can look at it. Then you can access the statistics with a URL like:
e8dd447a2aa5fbac10668749dfe4142c05ec3d7dKristina Sojakova *
e8dd447a2aa5fbac10668749dfe4142c05ec3d7dKristina Sojakova * http://your_server_name/server-status
e8dd447a2aa5fbac10668749dfe4142c05ec3d7dKristina Sojakova *
e8dd447a2aa5fbac10668749dfe4142c05ec3d7dKristina Sojakova * /server-status - Returns page using tables
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakova * /server-status?notable - Returns page for browsers without table support
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder * /server-status?refresh - Returns page with 1 second refresh
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder * /server-status?refresh=6 - Returns page with refresh every 6 seconds
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakova * /server-status?auto - Returns page with data for automatic parsing
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakova *
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakova * Mark Cox, mark@ukweb.com, November 1995
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder *
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakova * 12.11.95 Initial version for www.telescope.org
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakova * 13.3.96 Updated to remove rprintf's [Mark]
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder * 18.3.96 Added CPU usage, process information, and tidied [Ben Laurie]
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakova * 18.3.96 Make extra Scoreboard variables #definable
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakova * 25.3.96 Make short report have full precision [Ben Laurie suggested]
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakova * 25.3.96 Show uptime better [Mark/Ben Laurie]
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder * 29.3.96 Better HTML and explanation [Mark/Rob Hartill suggested]
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakova * 09.4.96 Added message for non-STATUS compiled version
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakova * 18.4.96 Added per child and per slot counters [Jim Jagielski]
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder * 01.5.96 Table format, cleanup, even more spiffy data [Chuck Murcko/Jim J.]
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakova * 18.5.96 Adapted to use new rprintf() routine, incidentally fixing a missing
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakova * piece in short reports [Ben Laurie]
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakova * 21.5.96 Additional Status codes (DNS and LOGGING only enabled if
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakova * extended STATUS is enabled) [George Burgyan/Jim J.]
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakova * 10.8.98 Allow for extended status info at runtime (no more STATUS)
e8dd447a2aa5fbac10668749dfe4142c05ec3d7dKristina Sojakova * [Jim J.]
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder */
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder
e8dd447a2aa5fbac10668749dfe4142c05ec3d7dKristina Sojakova#define CORE_PRIVATE
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder#include "httpd.h"
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder#include "http_config.h"
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder#include "http_core.h"
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder#include "http_protocol.h"
e8dd447a2aa5fbac10668749dfe4142c05ec3d7dKristina Sojakova#include "http_main.h"
e8dd447a2aa5fbac10668749dfe4142c05ec3d7dKristina Sojakova#include "ap_mpm.h"
ccaa75089b23c0f043cdbd4001cba4e076ca4fd3Kristina Sojakova#include "util_script.h"
3c0bf20712a0f21aaedc0a9a9c8376bc1e90e799Kristina Sojakova#include <time.h>
3c0bf20712a0f21aaedc0a9a9c8376bc1e90e799Kristina Sojakova#include "scoreboard.h"
3c0bf20712a0f21aaedc0a9a9c8376bc1e90e799Kristina Sojakova#include "http_log.h"
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder#include "mod_status.h"
3c0bf20712a0f21aaedc0a9a9c8376bc1e90e799Kristina Sojakova#if APR_HAVE_UNISTD_H
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakova#include <unistd.h>
168d206b4e5fd436c98239a1b6629c651f54c8eeKristina Sojakova#endif
168d206b4e5fd436c98239a1b6629c651f54c8eeKristina Sojakova#define APR_WANT_STRFUNC
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder#include "apr_want.h"
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakova
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder#ifdef NEXT
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder#if (NX_CURRENT_COMPILER_RELEASE == 410)
ccaa75089b23c0f043cdbd4001cba4e076ca4fd3Kristina Sojakova#ifdef m68k
ccaa75089b23c0f043cdbd4001cba4e076ca4fd3Kristina Sojakova#define HZ 64
ccaa75089b23c0f043cdbd4001cba4e076ca4fd3Kristina Sojakova#else
e8dd447a2aa5fbac10668749dfe4142c05ec3d7dKristina Sojakova#define HZ 100
5e35940c3516ccea02caa0450d2b075de0106fa5Kristina Sojakova#endif
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder#else
5e35940c3516ccea02caa0450d2b075de0106fa5Kristina Sojakova#include <machine/param.h>
5e35940c3516ccea02caa0450d2b075de0106fa5Kristina Sojakova#endif
5e35940c3516ccea02caa0450d2b075de0106fa5Kristina Sojakova#endif /* NEXT */
e8dd447a2aa5fbac10668749dfe4142c05ec3d7dKristina Sojakova
e8dd447a2aa5fbac10668749dfe4142c05ec3d7dKristina Sojakova#define STATUS_MAXLINE 64
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder
5e35940c3516ccea02caa0450d2b075de0106fa5Kristina Sojakova#define KBYTE 1024
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakova#define MBYTE 1048576L
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakova#define GBYTE 1073741824L
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakova#ifndef DEFAULT_TIME_FORMAT
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakova#define DEFAULT_TIME_FORMAT "%A, %d-%b-%Y %H:%M:%S %Z"
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakova#endif
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakova
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakova#define STATUS_MAGIC_TYPE "application/x-httpd-status"
5e35940c3516ccea02caa0450d2b075de0106fa5Kristina Sojakova
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroedermodule AP_MODULE_DECLARE_DATA status_module;
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakova
3c0bf20712a0f21aaedc0a9a9c8376bc1e90e799Kristina Sojakovaint server_limit, thread_limit;
5e35940c3516ccea02caa0450d2b075de0106fa5Kristina Sojakova
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakova/* Implement 'ap_run_status_hook'. */
3c0bf20712a0f21aaedc0a9a9c8376bc1e90e799Kristina SojakovaAP_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL(int,status_hook,
3c0bf20712a0f21aaedc0a9a9c8376bc1e90e799Kristina Sojakova (request_rec *r, int flags),
abd5fc85dc7e19b1614890182436940e922963a4Kristina Sojakova (r, flags),
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder OK, DECLINED)
abd5fc85dc7e19b1614890182436940e922963a4Kristina Sojakova
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder/*
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder * command-related code. This is here to prevent use of ExtendedStatus
abd5fc85dc7e19b1614890182436940e922963a4Kristina Sojakova * without status_module included.
abd5fc85dc7e19b1614890182436940e922963a4Kristina Sojakova */
abd5fc85dc7e19b1614890182436940e922963a4Kristina Sojakovastatic const char *set_extended_status(cmd_parms *cmd, void *dummy, int arg)
abd5fc85dc7e19b1614890182436940e922963a4Kristina Sojakova{
abd5fc85dc7e19b1614890182436940e922963a4Kristina Sojakova const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
ccaa75089b23c0f043cdbd4001cba4e076ca4fd3Kristina Sojakova if (err != NULL) {
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder return err;
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder }
ccaa75089b23c0f043cdbd4001cba4e076ca4fd3Kristina Sojakova ap_extended_status = arg;
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder return NULL;
abd5fc85dc7e19b1614890182436940e922963a4Kristina Sojakova}
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder
ccaa75089b23c0f043cdbd4001cba4e076ca4fd3Kristina Sojakovastatic const command_rec status_module_cmds[] =
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder{
abd5fc85dc7e19b1614890182436940e922963a4Kristina Sojakova AP_INIT_FLAG("ExtendedStatus", set_extended_status, NULL, RSRC_CONF,
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakova "\"On\" to enable extended status information, \"Off\" to disable"),
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakova {NULL}
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakova};
abd5fc85dc7e19b1614890182436940e922963a4Kristina Sojakova
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakova/* Format the number of bytes nicely */
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakovastatic void format_byte_out(request_rec *r, apr_off_t bytes)
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakova{
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakova if (bytes < (5 * KBYTE))
abd5fc85dc7e19b1614890182436940e922963a4Kristina Sojakova ap_rprintf(r, "%d B", (int) bytes);
e8dd447a2aa5fbac10668749dfe4142c05ec3d7dKristina Sojakova else if (bytes < (MBYTE / 2))
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder ap_rprintf(r, "%.1f kB", (float) bytes / KBYTE);
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder else if (bytes < (GBYTE / 2))
168d206b4e5fd436c98239a1b6629c651f54c8eeKristina Sojakova ap_rprintf(r, "%.1f MB", (float) bytes / MBYTE);
168d206b4e5fd436c98239a1b6629c651f54c8eeKristina Sojakova else
168d206b4e5fd436c98239a1b6629c651f54c8eeKristina Sojakova ap_rprintf(r, "%.1f GB", (float) bytes / GBYTE);
168d206b4e5fd436c98239a1b6629c651f54c8eeKristina Sojakova}
168d206b4e5fd436c98239a1b6629c651f54c8eeKristina Sojakova
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroederstatic void format_kbyte_out(request_rec *r, apr_off_t kbytes)
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder{
168d206b4e5fd436c98239a1b6629c651f54c8eeKristina Sojakova if (kbytes < KBYTE)
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder ap_rprintf(r, "%d kB", (int) kbytes);
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakova else if (kbytes < MBYTE)
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakova ap_rprintf(r, "%.1f MB", (float) kbytes / KBYTE);
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakova else
abd5fc85dc7e19b1614890182436940e922963a4Kristina Sojakova ap_rprintf(r, "%.1f GB", (float) kbytes / MBYTE);
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder}
abd5fc85dc7e19b1614890182436940e922963a4Kristina Sojakova
168d206b4e5fd436c98239a1b6629c651f54c8eeKristina Sojakovastatic void show_time(request_rec *r, apr_interval_time_t tsecs)
168d206b4e5fd436c98239a1b6629c651f54c8eeKristina Sojakova{
abd5fc85dc7e19b1614890182436940e922963a4Kristina Sojakova int days, hrs, mins, secs;
abd5fc85dc7e19b1614890182436940e922963a4Kristina Sojakova
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder secs = (int)(tsecs % 60);
abd5fc85dc7e19b1614890182436940e922963a4Kristina Sojakova tsecs /= 60;
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakova mins = (int)(tsecs % 60);
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder tsecs /= 60;
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder hrs = (int)(tsecs % 24);
abd5fc85dc7e19b1614890182436940e922963a4Kristina Sojakova days = (int)(tsecs / 24);
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakova
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakova if (days)
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakova ap_rprintf(r, " %d day%s", days, days == 1 ? "" : "s");
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakova
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakova if (hrs)
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakova ap_rprintf(r, " %d hour%s", hrs, hrs == 1 ? "" : "s");
3c0bf20712a0f21aaedc0a9a9c8376bc1e90e799Kristina Sojakova
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder if (mins)
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakova ap_rprintf(r, " %d minute%s", mins, mins == 1 ? "" : "s");
3c0bf20712a0f21aaedc0a9a9c8376bc1e90e799Kristina Sojakova
abd5fc85dc7e19b1614890182436940e922963a4Kristina Sojakova if (secs)
abd5fc85dc7e19b1614890182436940e922963a4Kristina Sojakova ap_rprintf(r, " %d second%s", secs, secs == 1 ? "" : "s");
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder}
abd5fc85dc7e19b1614890182436940e922963a4Kristina Sojakova
abd5fc85dc7e19b1614890182436940e922963a4Kristina Sojakova/* Main handler for x-httpd-status requests */
abd5fc85dc7e19b1614890182436940e922963a4Kristina Sojakova
abd5fc85dc7e19b1614890182436940e922963a4Kristina Sojakova/* ID values for command table */
abd5fc85dc7e19b1614890182436940e922963a4Kristina Sojakova
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder#define STAT_OPT_END -1
abd5fc85dc7e19b1614890182436940e922963a4Kristina Sojakova#define STAT_OPT_REFRESH 0
abd5fc85dc7e19b1614890182436940e922963a4Kristina Sojakova#define STAT_OPT_NOTABLE 1
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder#define STAT_OPT_AUTO 2
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder
abd5fc85dc7e19b1614890182436940e922963a4Kristina Sojakovastruct stat_opt {
abd5fc85dc7e19b1614890182436940e922963a4Kristina Sojakova int id;
abd5fc85dc7e19b1614890182436940e922963a4Kristina Sojakova const char *form_data_str;
3c0bf20712a0f21aaedc0a9a9c8376bc1e90e799Kristina Sojakova const char *hdr_out_str;
abd5fc85dc7e19b1614890182436940e922963a4Kristina Sojakova};
abd5fc85dc7e19b1614890182436940e922963a4Kristina Sojakova
abd5fc85dc7e19b1614890182436940e922963a4Kristina Sojakovastatic const struct stat_opt status_options[] = /* see #defines above */
abd5fc85dc7e19b1614890182436940e922963a4Kristina Sojakova{
168d206b4e5fd436c98239a1b6629c651f54c8eeKristina Sojakova {STAT_OPT_REFRESH, "refresh", "Refresh"},
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder {STAT_OPT_NOTABLE, "notable", NULL},
168d206b4e5fd436c98239a1b6629c651f54c8eeKristina Sojakova {STAT_OPT_AUTO, "auto", NULL},
abd5fc85dc7e19b1614890182436940e922963a4Kristina Sojakova {STAT_OPT_END, NULL, NULL}
abd5fc85dc7e19b1614890182436940e922963a4Kristina Sojakova};
abd5fc85dc7e19b1614890182436940e922963a4Kristina Sojakova
static char status_flags[SERVER_NUM_STATUS];
static int status_handler(request_rec *r)
{
const char *loc;
apr_time_t nowtime;
apr_interval_time_t up_time;
int j, i, res;
int ready;
int busy;
unsigned long count;
unsigned long lres, my_lres, conn_lres;
apr_off_t bytes, my_bytes, conn_bytes;
apr_off_t bcount, kbcount;
long req_time;
#ifdef HAVE_TIMES
float tick;
#endif
int short_report;
int no_table_report;
worker_score *ws_record;
process_score *ps_record;
char *stat_buffer;
pid_t *pid_buffer;
clock_t tu, ts, tcu, tcs;
if (strcmp(r->handler, STATUS_MAGIC_TYPE) &&
strcmp(r->handler, "server-status")) {
return DECLINED;
}
#ifdef HAVE_TIMES
#ifdef _SC_CLK_TCK
tick = sysconf(_SC_CLK_TCK);
#else
tick = HZ;
#endif
#endif
ready = 0;
busy = 0;
count = 0;
bcount = 0;
kbcount = 0;
short_report = 0;
no_table_report = 0;
pid_buffer = apr_palloc(r->pool, server_limit * sizeof(pid_t));
stat_buffer = apr_palloc(r->pool, server_limit * thread_limit * sizeof(char));
nowtime = apr_time_now();
tu = ts = tcu = tcs = 0;
if (!ap_exists_scoreboard_image()) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
"Server status unavailable in inetd mode");
return HTTP_INTERNAL_SERVER_ERROR;
}
r->allowed = (AP_METHOD_BIT << M_GET);
if (r->method_number != M_GET)
return DECLINED;
ap_set_content_type(r, "text/html");
/*
* Simple table-driven form data set parser that lets you alter the header
*/
if (r->args) {
i = 0;
while (status_options[i].id != STAT_OPT_END) {
if ((loc = ap_strstr_c(r->args,
status_options[i].form_data_str)) != NULL) {
switch (status_options[i].id) {
case STAT_OPT_REFRESH:
if (*(loc + strlen(status_options[i].form_data_str)) == '='
&& atol(loc + strlen(status_options[i].form_data_str)
+ 1) > 0)
apr_table_set(r->headers_out,
status_options[i].hdr_out_str,
loc +
strlen(status_options[i].hdr_out_str) +
1);
else
apr_table_set(r->headers_out,
status_options[i].hdr_out_str, "1");
break;
case STAT_OPT_NOTABLE:
no_table_report = 1;
break;
case STAT_OPT_AUTO:
ap_set_content_type(r, "text/plain");
short_report = 1;
break;
}
}
i++;
}
}
for (i = 0; i < server_limit; ++i) {
ps_record = ap_get_scoreboard_process(i);
for (j = 0; j < thread_limit; ++j) {
int indx = (i * thread_limit) + j;
ws_record = ap_get_scoreboard_worker(i, j);
res = ws_record->status;
stat_buffer[indx] = status_flags[res];
if (!ps_record->quiescing
&& ps_record->pid) {
if (res == SERVER_READY
&& ps_record->generation == ap_my_generation)
ready++;
else if (res != SERVER_DEAD &&
res != SERVER_STARTING &&
res != SERVER_IDLE_KILL)
busy++;
}
/* XXX what about the counters for quiescing/seg faulted
* processes? should they be counted or not? GLA
*/
if (ap_extended_status) {
lres = ws_record->access_count;
bytes = ws_record->bytes_served;
if (lres != 0 || (res != SERVER_READY && res != SERVER_DEAD)) {
#ifdef HAVE_TIMES
tu += ws_record->times.tms_utime;
ts += ws_record->times.tms_stime;
tcu += ws_record->times.tms_cutime;
tcs += ws_record->times.tms_cstime;
#endif /* HAVE_TIMES */
count += lres;
bcount += bytes;
if (bcount >= KBYTE) {
kbcount += (bcount >> 10);
bcount = bcount & 0x3ff;
}
}
}
}
pid_buffer[i] = ps_record->pid;
}
/* up_time in seconds */
up_time = (apr_uint32_t) apr_time_sec(nowtime -
ap_scoreboard_image->global->restart_time);
if (!short_report) {
ap_rputs(DOCTYPE_HTML_3_2
"<html><head>\n<title>Apache Status</title>\n</head><body>\n",
r);
ap_rputs("<h1>Apache Server Status for ", r);
ap_rvputs(r, ap_get_server_name(r), "</h1>\n\n", NULL);
ap_rvputs(r, "<dl><dt>Server Version: ",
ap_get_server_version(), "</dt>\n", NULL);
ap_rvputs(r, "<dt>Server Built: ",
ap_get_server_built(), "\n</dt></dl><hr /><dl>\n", NULL);
ap_rvputs(r, "<dt>Current Time: ",
ap_ht_time(r->pool, nowtime, DEFAULT_TIME_FORMAT, 0),
"</dt>\n", NULL);
ap_rvputs(r, "<dt>Restart Time: ",
ap_ht_time(r->pool,
ap_scoreboard_image->global->restart_time,
DEFAULT_TIME_FORMAT, 0),
"</dt>\n", NULL);
ap_rprintf(r, "<dt>Parent Server Generation: %d</dt>\n",
(int)ap_my_generation);
ap_rputs("<dt>Server uptime: ", r);
show_time(r, up_time);
ap_rputs("</dt>\n", r);
}
if (ap_extended_status) {
if (short_report) {
ap_rprintf(r, "Total Accesses: %lu\nTotal kBytes: %"
APR_OFF_T_FMT "\n",
count, kbcount);
#ifdef HAVE_TIMES
/* Allow for OS/2 not having CPU stats */
if (ts || tu || tcu || tcs)
ap_rprintf(r, "CPULoad: %g\n",
(tu + ts + tcu + tcs) / tick / up_time * 100.);
#endif
ap_rprintf(r, "Uptime: %ld\n", (long) (up_time));
if (up_time > 0)
ap_rprintf(r, "ReqPerSec: %g\n",
(float) count / (float) up_time);
if (up_time > 0)
ap_rprintf(r, "BytesPerSec: %g\n",
KBYTE * (float) kbcount / (float) up_time);
if (count > 0)
ap_rprintf(r, "BytesPerReq: %g\n",
KBYTE * (float) kbcount / (float) count);
}
else { /* !short_report */
ap_rprintf(r, "<dt>Total accesses: %lu - Total Traffic: ", count);
format_kbyte_out(r, kbcount);
ap_rputs("</dt>\n", r);
#ifdef HAVE_TIMES
/* Allow for OS/2 not having CPU stats */
ap_rprintf(r, "<dt>CPU Usage: u%g s%g cu%g cs%g",
tu / tick, ts / tick, tcu / tick, tcs / tick);
if (ts || tu || tcu || tcs)
ap_rprintf(r, " - %.3g%% CPU load</dt>\n",
(tu + ts + tcu + tcs) / tick / up_time * 100.);
#endif
if (up_time > 0)
ap_rprintf(r, "<dt>%.3g requests/sec - ",
(float) count / (float) up_time);
if (up_time > 0) {
format_byte_out(r, (unsigned long)(KBYTE * (float) kbcount
/ (float) up_time));
ap_rputs("/second - ", r);
}
if (count > 0) {
format_byte_out(r, (unsigned long)(KBYTE * (float) kbcount
/ (float) count));
ap_rputs("/request", r);
}
ap_rputs("</dt>\n", r);
} /* short_report */
} /* ap_extended_status */
if (!short_report)
ap_rprintf(r, "<dt>%d requests currently being processed, "
"%d idle workers</dt>\n", busy, ready);
else
ap_rprintf(r, "BusyWorkers: %d\nIdleWorkers: %d\n", busy, ready);
/* send the scoreboard 'table' out */
if (!short_report)
ap_rputs("</dl><pre>", r);
else
ap_rputs("Scoreboard: ", r);
for (i = 0; i < server_limit; ++i) {
for (j = 0; j < thread_limit; ++j) {
int indx = (i * thread_limit) + j;
ap_rputc(stat_buffer[indx], r);
if ((indx % STATUS_MAXLINE == (STATUS_MAXLINE - 1))
&& !short_report)
ap_rputs("\n", r);
}
}
if (short_report)
ap_rputs("\n", r);
else {
ap_rputs("</pre>\n", r);
ap_rputs("<p>Scoreboard Key:<br />\n", r);
ap_rputs("\"<b><code>_</code></b>\" Waiting for Connection, \n", r);
ap_rputs("\"<b><code>S</code></b>\" Starting up, \n", r);
ap_rputs("\"<b><code>R</code></b>\" Reading Request,<br />\n", r);
ap_rputs("\"<b><code>W</code></b>\" Sending Reply, \n", r);
ap_rputs("\"<b><code>K</code></b>\" Keepalive (read), \n", r);
ap_rputs("\"<b><code>D</code></b>\" DNS Lookup,<br />\n", r);
ap_rputs("\"<b><code>C</code></b>\" Closing connection, \n", r);
ap_rputs("\"<b><code>L</code></b>\" Logging, \n", r);
ap_rputs("\"<b><code>G</code></b>\" Gracefully finishing,<br /> \n", r);
ap_rputs("\"<b><code>I</code></b>\" Idle cleanup of worker, \n", r);
ap_rputs("\"<b><code>.</code></b>\" Open slot with no current process</p>\n", r);
ap_rputs("<p />\n", r);
if (!ap_extended_status) {
int j;
int k = 0;
ap_rputs("PID Key: <br />\n", r);
ap_rputs("<pre>\n", r);
for (i = 0; i < server_limit; ++i) {
for (j = 0; j < thread_limit; ++j) {
int indx = (i * thread_limit) + j;
if (stat_buffer[indx] != '.') {
ap_rprintf(r, " %" APR_PID_T_FMT
" in state: %c ", pid_buffer[i],
stat_buffer[indx]);
if (++k >= 3) {
ap_rputs("\n", r);
k = 0;
} else
ap_rputs(",", r);
}
}
}
ap_rputs("\n", r);
ap_rputs("</pre>\n", r);
}
}
if (ap_extended_status && !short_report) {
if (no_table_report)
ap_rputs("<hr /><h2>Server Details</h2>\n\n", r);
else
ap_rputs("\n\n<table border=\"0\"><tr>"
"<th>Srv</th><th>PID</th><th>Acc</th>"
"<th>M</th>"
#ifdef HAVE_TIMES
"<th>CPU\n</th>"
#endif
"<th>SS</th><th>Req</th>"
"<th>Conn</th><th>Child</th><th>Slot</th>"
"<th>Client</th><th>VHost</th>"
"<th>Request</th></tr>\n\n", r);
for (i = 0; i < server_limit; ++i) {
for (j = 0; j < thread_limit; ++j) {
ws_record = ap_get_scoreboard_worker(i, j);
if (ws_record->access_count == 0 &&
(ws_record->status == SERVER_READY ||
ws_record->status == SERVER_DEAD)) {
continue;
}
ps_record = ap_get_scoreboard_process(i);
if (ws_record->start_time == 0L)
req_time = 0L;
else
req_time = (long)
((ws_record->stop_time -
ws_record->start_time) / 1000);
if (req_time < 0L)
req_time = 0L;
lres = ws_record->access_count;
my_lres = ws_record->my_access_count;
conn_lres = ws_record->conn_count;
bytes = ws_record->bytes_served;
my_bytes = ws_record->my_bytes_served;
conn_bytes = ws_record->conn_bytes;
if (no_table_report) {
if (ws_record->status == SERVER_DEAD)
ap_rprintf(r,
"<b>Server %d-%d</b> (-): %d|%lu|%lu [",
i, (int)ps_record->generation,
(int)conn_lres, my_lres, lres);
else
ap_rprintf(r,
"<b>Server %d-%d</b> (%"
APR_PID_T_FMT "): %d|%lu|%lu [",
i, (int) ps_record->generation,
ps_record->pid,
(int)conn_lres, my_lres, lres);
switch (ws_record->status) {
case SERVER_READY:
ap_rputs("Ready", r);
break;
case SERVER_STARTING:
ap_rputs("Starting", r);
break;
case SERVER_BUSY_READ:
ap_rputs("<b>Read</b>", r);
break;
case SERVER_BUSY_WRITE:
ap_rputs("<b>Write</b>", r);
break;
case SERVER_BUSY_KEEPALIVE:
ap_rputs("<b>Keepalive</b>", r);
break;
case SERVER_BUSY_LOG:
ap_rputs("<b>Logging</b>", r);
break;
case SERVER_BUSY_DNS:
ap_rputs("<b>DNS lookup</b>", r);
break;
case SERVER_CLOSING:
ap_rputs("<b>Closing</b>", r);
break;
case SERVER_DEAD:
ap_rputs("Dead", r);
break;
case SERVER_GRACEFUL:
ap_rputs("Graceful", r);
break;
case SERVER_IDLE_KILL:
ap_rputs("Dying", r);
break;
default:
ap_rputs("?STATE?", r);
break;
}
ap_rprintf(r, "] "
#ifdef HAVE_TIMES
"u%g s%g cu%g cs%g"
#endif
"\n %ld %ld (",
#ifdef HAVE_TIMES
ws_record->times.tms_utime / tick,
ws_record->times.tms_stime / tick,
ws_record->times.tms_cutime / tick,
ws_record->times.tms_cstime / tick,
#endif
(long)apr_time_sec(nowtime -
ws_record->last_used),
(long) req_time);
format_byte_out(r, conn_bytes);
ap_rputs("|", r);
format_byte_out(r, my_bytes);
ap_rputs("|", r);
format_byte_out(r, bytes);
ap_rputs(")\n", r);
ap_rprintf(r,
" <i>%s {%s}</i> <b>[%s]</b><br />\n\n",
ap_escape_html(r->pool,
ws_record->client),
ap_escape_html(r->pool,
ws_record->request),
ap_escape_html(r->pool,
ws_record->vhost));
}
else { /* !no_table_report */
if (ws_record->status == SERVER_DEAD)
ap_rprintf(r,
"<tr><td><b>%d-%d</b></td><td>-</td><td>%d/%lu/%lu",
i, (int)ps_record->generation,
(int)conn_lres, my_lres, lres);
else
ap_rprintf(r,
"<tr><td><b>%d-%d</b></td><td>%"
APR_PID_T_FMT
"</td><td>%d/%lu/%lu",
i, (int)ps_record->generation,
ps_record->pid, (int)conn_lres,
my_lres, lres);
switch (ws_record->status) {
case SERVER_READY:
ap_rputs("</td><td>_", r);
break;
case SERVER_STARTING:
ap_rputs("</td><td><b>S</b>", r);
break;
case SERVER_BUSY_READ:
ap_rputs("</td><td><b>R</b>", r);
break;
case SERVER_BUSY_WRITE:
ap_rputs("</td><td><b>W</b>", r);
break;
case SERVER_BUSY_KEEPALIVE:
ap_rputs("</td><td><b>K</b>", r);
break;
case SERVER_BUSY_LOG:
ap_rputs("</td><td><b>L</b>", r);
break;
case SERVER_BUSY_DNS:
ap_rputs("</td><td><b>D</b>", r);
break;
case SERVER_CLOSING:
ap_rputs("</td><td><b>C</b>", r);
break;
case SERVER_DEAD:
ap_rputs("</td><td>.", r);
break;
case SERVER_GRACEFUL:
ap_rputs("</td><td>G", r);
break;
case SERVER_IDLE_KILL:
ap_rputs("</td><td>I", r);
break;
default:
ap_rputs("</td><td>?", r);
break;
}
ap_rprintf(r,
"\n</td>"
#ifdef HAVE_TIMES
"<td>%.2f</td>"
#endif
"<td>%ld</td><td>%ld",
#ifdef HAVE_TIMES
(ws_record->times.tms_utime +
ws_record->times.tms_stime +
ws_record->times.tms_cutime +
ws_record->times.tms_cstime) / tick,
#endif
(long)apr_time_sec(nowtime -
ws_record->last_used),
(long)req_time);
ap_rprintf(r, "</td><td>%-1.1f</td><td>%-2.2f</td><td>%-2.2f\n",
(float)conn_bytes / KBYTE, (float) my_bytes / MBYTE,
(float)bytes / MBYTE);
if (ws_record->status == SERVER_BUSY_READ)
ap_rprintf(r,
"</td><td>?</td><td nowrap>?</td><td nowrap>..reading.. </td></tr>\n\n");
else
ap_rprintf(r,
"</td><td>%s</td><td nowrap>%s</td><td nowrap>%s</td></tr>\n\n",
ap_escape_html(r->pool,
ws_record->client),
ap_escape_html(r->pool,
ws_record->vhost),
ap_escape_html(r->pool,
ws_record->request));
} /* no_table_report */
} /* for (j...) */
} /* for (i...) */
if (!no_table_report) {
ap_rputs("</table>\n \
<hr /> \
<table>\n \
<tr><th>Srv</th><td>Child Server number - generation</td></tr>\n \
<tr><th>PID</th><td>OS process ID</td></tr>\n \
<tr><th>Acc</th><td>Number of accesses this connection / this child / this slot</td></tr>\n \
<tr><th>M</th><td>Mode of operation</td></tr>\n"
#ifdef HAVE_TIMES
"<tr><th>CPU</th><td>CPU usage, number of seconds</td></tr>\n"
#endif
"<tr><th>SS</th><td>Seconds since beginning of most recent request</td></tr>\n \
<tr><th>Req</th><td>Milliseconds required to process most recent request</td></tr>\n \
<tr><th>Conn</th><td>Kilobytes transferred this connection</td></tr>\n \
<tr><th>Child</th><td>Megabytes transferred this child</td></tr>\n \
<tr><th>Slot</th><td>Total megabytes transferred this slot</td></tr>\n \
</table>\n", r);
}
} /* if (ap_extended_status && !short_report) */
else {
if (!short_report) {
ap_rputs("<hr />To obtain a full report with current status "
"information you need to use the "
"<code>ExtendedStatus On</code> directive.\n", r);
}
}
{
/* Run extension hooks to insert extra content. */
int flags =
(short_report ? AP_STATUS_SHORT : 0) |
(no_table_report ? AP_STATUS_NOTABLE : 0) |
(ap_extended_status ? AP_STATUS_EXTENDED : 0);
ap_run_status_hook(r, flags);
}
if (!short_report) {
ap_rputs(ap_psignature("<hr />\n",r), r);
ap_rputs("</body></html>\n", r);
}
return 0;
}
static int status_init(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp,
server_rec *s)
{
status_flags[SERVER_DEAD] = '.'; /* We don't want to assume these are in */
status_flags[SERVER_READY] = '_'; /* any particular order in scoreboard.h */
status_flags[SERVER_STARTING] = 'S';
status_flags[SERVER_BUSY_READ] = 'R';
status_flags[SERVER_BUSY_WRITE] = 'W';
status_flags[SERVER_BUSY_KEEPALIVE] = 'K';
status_flags[SERVER_BUSY_LOG] = 'L';
status_flags[SERVER_BUSY_DNS] = 'D';
status_flags[SERVER_CLOSING] = 'C';
status_flags[SERVER_GRACEFUL] = 'G';
status_flags[SERVER_IDLE_KILL] = 'I';
ap_mpm_query(AP_MPMQ_HARD_LIMIT_THREADS, &thread_limit);
ap_mpm_query(AP_MPMQ_HARD_LIMIT_DAEMONS, &server_limit);
return OK;
}
static void register_hooks(apr_pool_t *p)
{
ap_hook_handler(status_handler, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_post_config(status_init, NULL, NULL, APR_HOOK_MIDDLE);
}
module AP_MODULE_DECLARE_DATA status_module =
{
STANDARD20_MODULE_STUFF,
NULL, /* dir config creater */
NULL, /* dir merger --- default is to override */
NULL, /* server config */
NULL, /* merge server config */
status_module_cmds, /* command table */
register_hooks /* register_hooks */
};