phpDocumentator headers. retire static-config. IF YOU ARE READING THIS, REMOVE IT FROM THE BOTTOM YOUR CONFIG.PHP. YES. YOU.

git-svn-id: http://www.observium.org/svn/observer/trunk@3150 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2012-05-09 10:01:42 +00:00
parent c0b8070ff0
commit dbf212f652
36 changed files with 1586 additions and 1284 deletions

View File

@@ -1,21 +1,23 @@
#!/usr/bin/env php
<?php
/* Observium Network Management and Monitoring System
* Copyright (C) 2006-2011, Observium Developers - http://www.observium.org
/**
* Observium
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This file is part of Observium.
*
* @package observium
* @subpackage cli
* @author Adam Armstrong <adama@memetic.org>
* @copyright (C) 2006 - 2012 Adam Armstrong
*
* See COPYING for more details.
*/
chdir(dirname($argv[0]));
include("includes/defaults.inc.php");
include("config.php");
include("includes/definitions.inc.php");
include("includes/functions.php");
if (isset($argv[1]) && $argv[1])

View File

@@ -1,10 +1,23 @@
#!/usr/bin/env php
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage cli
* @author Adam Armstrong <adama@memetic.org>
* @copyright (C) 2006 - 2012 Adam Armstrong
*
*/
chdir(dirname($argv[0]));
include("includes/defaults.inc.php");
include("config.php");
include("includes/definitions.inc.php");
include("includes/functions.php");
if (file_exists('html/includes/authentication/' . $config['auth_mechanism'] . '.inc.php'))
@@ -43,4 +56,4 @@ else
echo("Auth module does not allow adding users!\n");
}
?>
?>

View File

@@ -1,8 +1,21 @@
#!/usr/bin/env php
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage alerts
* @author Adam Armstrong <adama@memetic.org>
* @copyright (C) 2006 - 2012 Adam Armstrong
*
*/
include("includes/defaults.inc.php");
include("config.php");
include("includes/definitions.inc.php");
include("includes/functions.php");
foreach (dbFetchRows("SELECT *, A.id AS id FROM `alerts` AS A, `devices` AS D WHERE A.device_id = D.device_id AND alerted = '0'") as $alert)

View File

@@ -1,12 +1,23 @@
#!/usr/bin/env php
<?php
#$debug=1;
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage billing
* @author Adam Armstrong <adama@memetic.org>
* @copyright (C) 2006 - 2012 Adam Armstrong
*
*/
chdir(dirname($argv[0]));
include("includes/defaults.inc.php");
include("config.php");
include("includes/definitions.inc.php");
include("includes/functions.php");
$options = getopt("r");

View File

@@ -1,10 +1,23 @@
#!/usr/bin/env php
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage alerts
* @author Adam Armstrong <adama@memetic.org>
* @copyright (C) 2006 - 2012 Adam Armstrong
*
*/
chdir(dirname($argv[0]));
include("includes/defaults.inc.php");
include("config.php");
include("includes/definitions.inc.php");
include("includes/functions.php");
include("html/includes/functions.inc.php");

View File

@@ -1,10 +1,23 @@
#!/usr/bin/env php
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage services
* @author Adam Armstrong <adama@memetic.org>
* @copyright (C) 2006 - 2012 Adam Armstrong
*
*/
chdir(dirname($argv[0]));
include("includes/defaults.inc.php");
include("config.php");
include("includes/definitions.inc.php");
include("includes/functions.php");
foreach (dbFetchRows("SELECT * FROM `devices` AS D, `services` AS S WHERE S.device_id = D.device_id ORDER by D.device_id DESC") as $service)

View File

@@ -38,6 +38,4 @@ $config['auth_mechanism'] = "mysql"; # default, other options: ldap, http-auth
$config['nets'][] = "172.22.0.0/16";
$config['nets'][] = "192.168.0.0/24";
include("includes/static-config.php");
?>

View File

@@ -1,10 +1,23 @@
#!/usr/bin/env php
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage cli
* @author Adam Armstrong <adama@memetic.org>
* @copyright (C) 2006 - 2012 Adam Armstrong
*
*/
chdir(dirname($argv[0]));
include("includes/defaults.inc.php");
include("config.php");
include("includes/definitions.inc.php");
include("includes/functions.php");
# Remove a host and all related data from the system
@@ -24,4 +37,4 @@ if ($argv[1])
echo("Host Removal Tool\nUsage: ./delhost.php <hostname>\n");
}
?>
?>

View File

@@ -1,21 +1,23 @@
#!/usr/bin/env php
<?php
/* Observium Network Management and Monitoring System
* Copyright (C) 2006-2011, Observium Developers - http://www.observium.org
/**
* Observium
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This file is part of Observium.
*
* @package observium
* @subpackage discovery
* @author Adam Armstrong <adama@memetic.org>
* @copyright (C) 2006 - 2012 Adam Armstrong
*
* See COPYING for more details.
*/
chdir(dirname($argv[0]));
include("includes/defaults.inc.php");
include("config.php");
include("includes/definitions.inc.php");
include("includes/functions.php");
include("includes/discovery/functions.inc.php");

View File

@@ -1,8 +1,21 @@
#!/usr/bin/env php
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage discovery
* @author Adam Armstrong <adama@memetic.org>
* @copyright (C) 2006 - 2012 Adam Armstrong
*
*/
include("includes/defaults.inc.php");
include("config.php");
include("includes/definitions.inc.php");
include("includes/functions.php");
$handle = fopen("ips.txt", "w");

View File

@@ -1,5 +1,17 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage ajax
* @author Adam Armstrong <adama@memetic.org>
* @copyright (C) 2006 - 2012 Adam Armstrong
*
*/
if ($_GET['debug'])
{
ini_set('display_errors', 1);
@@ -11,6 +23,7 @@ if ($_GET['debug'])
include_once("../includes/defaults.inc.php");
include_once("../config.php");
include_once("../includes/definitions.inc.php");
include_once("includes/functions.inc.php");
include_once("../includes/dbFacile.php");
include_once("../includes/common.php");

View File

@@ -1,5 +1,17 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage webinterface
* @author Adam Armstrong <adama@memetic.org>
* @copyright (C) 2006 - 2012 Adam Armstrong
*
*/
ini_set('allow_url_fopen', 0);
ini_set('display_errors', 0);
@@ -20,6 +32,7 @@ if (strpos($_SERVER['REQUEST_URI'], "debug"))
include("../includes/defaults.inc.php");
include("../config.php");
include("../includes/definitions.inc.php");
include("../includes/functions.php");
include("includes/functions.inc.php");
include("includes/authenticate.inc.php");

View File

@@ -1,5 +1,17 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage billing
* @author Adam Armstrong <adama@memetic.org>
* @copyright (C) 2006 - 2012 Adam Armstrong
*
*/
ini_set('allow_url_fopen', 0);
ini_set('display_errors', 0);
@@ -20,6 +32,7 @@ if (strpos($_SERVER['REQUEST_URI'], "debug"))
include("../includes/defaults.inc.php");
include("../config.php");
include("../includes/definitions.inc.php");
include("../includes/functions.php");
include("includes/functions.inc.php");
include("includes/authenticate.inc.php");

View File

@@ -1,9 +1,22 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage webinterface
* @author Adam Armstrong <adama@memetic.org>
* @copyright (C) 2006 - 2012 Adam Armstrong
*
*/
## FIXME - fewer includes!
include_once("../includes/defaults.inc.php");
include_once("../config.php");
include_once("../includes/definitions.inc.php");
include_once("../includes/common.php");
include_once("../includes/dbFacile.php");
include_once("../includes/rewrites.php");

View File

@@ -1,15 +1,22 @@
<?php
/*
Originally part of m0n0wall (http://m0n0.ch/wall)
Copyright (C) 2004-2006 T. Lechat <dev@lechat.org>, Manuel Kasper <mk@neon1.net>
and Jonathan Watt <jwatt@jwatt.org>.
All rights reserved.
*/
/**
* Observium
*
* This file is included with Observium. It was originally part of m0n0wall <http://www.m0n0.ch/wall/>
*
* @package observium
* @subpackage graphing
* @author T. Lechat <dev@lechat.org>, Manuel Kasper <mk@neon1.net>, Jonathan Watt <jwatt@jwatt.org>
* @copyright 2004-2006 T. Lechat <dev@lechat.org>, Manuel Kasper <mk@neon1.net>, Jonathan Watt <jwatt@jwatt.org>
* @license BSD
*
*/
include_once("../includes/defaults.inc.php");
include_once("../config.php");
include_once("../includes/definitions.inc.php");
include_once("../includes/common.php");
include_once("../includes/dbFacile.php");
include_once("../includes/rewrites.php");

View File

@@ -1,5 +1,17 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage graphing
* @author Adam Armstrong <adama@memetic.org>
* @copyright (C) 2006 - 2012 Adam Armstrong
*
*/
function utime()
{
$time = explode(" ", microtime());
@@ -31,6 +43,7 @@ else
include_once("../includes/defaults.inc.php");
include_once("../config.php");
include_once("../includes/definitions.inc.php");
include_once("../includes/common.php");
include_once("../includes/dbFacile.php");
include_once("../includes/rewrites.php");

View File

@@ -15,11 +15,4 @@ $graph_max = 1;
$unit_text = "Prefixes";
if($config['old_graphs'])
{
include("includes/graphs/old_generic_simplex.inc.php");
} else {
include("includes/graphs/generic_simplex.inc.php");
}
?>

View File

@@ -1,20 +1,25 @@
<?php
$device = device_by_id_cache($id);
$scale_min = "0";
include("includes/graphs/common.inc.php");
$database = $config['rrd_dir'] . "/" . $device['hostname'] . "/hr_processes.rrd";
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/hr_processes.rrd";
$ds = "procs";
$colour_line = "008C00";
$colour_area = "CDEB8B";
$colour_area_max = "cc9999";
$graph_max = 1;
$graph_min = 0;
$unit_text = "Processes";
include("includes/graphs/generic_simplex.inc.php");
$rrd_options .= " DEF:procs=$database:procs:AVERAGE";
$rrd_options .= " COMMENT:'Processes Cur Ave Min Max\\n'";
$rrd_options .= " AREA:procs#CDEB8B:";
$rrd_options .= " LINE1.25:procs#008C00:' '";
$rrd_options .= " GPRINT:procs:LAST:' %6.2lf'";
$rrd_options .= " GPRINT:procs:AVERAGE:%6.2lf";
$rrd_options .= " GPRINT:procs:MIN:%6.2lf";
$rrd_options .= " GPRINT:procs:MAX:'%6.2lf\\n'";
?>

View File

@@ -1,22 +1,25 @@
<?php
$device = device_by_id_cache($id);
$scale_min = "0";
include("includes/graphs/common.inc.php");
$database = $config['rrd_dir'] . "/" . $device['hostname'] . "/hr_users.rrd";
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/hr_users.rrd";
$ds = "users";
$colour_line = "008C00";
$colour_area = "CDEB8B";
$colour_area_max = "cc9999";
$graph_max = 1;
$graph_min = 0;
$unit_text = "Processes";
include("includes/graphs/generic_simplex.inc.php");
$rrd_options .= " DEF:users=$database:users:AVERAGE";
$rrd_options .= " DEF:users_max=$database:users:MAX";
$rrd_options .= " COMMENT:'Users Cur Ave Min Max\\n'";
$rrd_options .= " AREA:users_max#defc9c:";
$rrd_options .= " AREA:users#CDEB8B:";
$rrd_options .= " LINE1.25:users#008C00: ";
$rrd_options .= " GPRINT:users:LAST:' %6.2lf'";
$rrd_options .= " GPRINT:users:AVERAGE:%6.2lf";
$rrd_options .= " GPRINT:users:MIN:%6.2lf";
$rrd_options .= " GPRINT:users_max:MAX:'%6.2lf\\n'";
?>

View File

@@ -6,7 +6,7 @@ $rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/ucd_ssRawIn
$ds = "value";
$colour_area = "CC9999";
$colour_area = "EEBBBB";
$colour_line = "CC0000";
$colour_area_max = "cc9999";
@@ -18,4 +18,4 @@ $unit_text = "Interrupts/s";
include("includes/graphs/generic_simplex.inc.php");
?>
?>

View File

@@ -1,5 +1,13 @@
<?php
if($config['old_graphs'])
{
include("includes/graphs/old_generic_simplex.inc.php");
} else {
/// Draw generic bits graph
/// args: ds_in, ds_out, rrd_filename, bg, legend, from, to, width, height, inverse, percentile
@@ -11,8 +19,10 @@ $line_text = str_pad(truncate($line_text,12,''),12);
if ($multiplier)
{
$rrd_options .= " DEF:".$ds."_o=".$rrd_filename.":".$ds.":AVERAGE";
if($config['oldrrd']) {}
$rrd_options .= " DEF:".$ds."_max_o=".$rrd_filename.":".$ds.":MAX";
$rrd_options .= " DEF:".$ds."_min_o=".$rrd_filename.":".$ds.":MIN";
$rrd_options .= " CDEF:".$ds."=".$ds."_o,$multiplier,*";
$rrd_options .= " CDEF:".$ds."_max=".$ds."_max_o,$multiplier,*";
$rrd_options .= " CDEF:".$ds."_min=".$ds."_min_o,$multiplier,*";
@@ -107,6 +117,10 @@ if ($percentile)
if($_GET['previous'] == "yes")
{
$rrd_options .= " LINE1.25:".$ds."X#666666:'Prev \\\\n'";
$rrd_options .= " AREA:".$ds."X#99999966:";
}
}
?>

View File

@@ -86,6 +86,7 @@ if ($percentile)
if($_GET['previous'] == "yes")
{
$rrd_options .= " LINE1.25:".$ds."X#666666:'Prev \\\\n'";
$rrd_options .= " AREA:".$ds."X#99999966:";
}
?>

View File

@@ -9,6 +9,7 @@ $descr = substr(str_pad(short_hrDeviceDescr($proc['processor_descr']), 28),0,28)
$descr = str_replace(":", "\:", $descr);
$colour_line = "cc0000";
$colour_area = "FFBBBB";
$colour_minmax = "c5c5c5";
$graph_max = 1;

View File

@@ -1,7 +1,20 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage webinterface
* @author Adam Armstrong <adama@memetic.org>
* @copyright (C) 2006 - 2012 Adam Armstrong
*
*/
include("../includes/defaults.inc.php");
include("../config.php");
include_once("../includes/definitions.inc.php");
include("../includes/functions.php");
include("includes/functions.inc.php");

View File

@@ -1,5 +1,17 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage map
* @author Adam Armstrong <adama@memetic.org>
* @copyright (C) 2006 - 2012 Adam Armstrong
*
*/
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
ini_set('log_errors', 1);
@@ -9,6 +21,7 @@ $links = 1;
include_once("../includes/defaults.inc.php");
include_once("../config.php");
include_once("../includes/definitions.inc.php");
include_once("../includes/functions.php");
include_once("../includes/dbFacile.php");
include_once("includes/functions.inc.php");

View File

@@ -1,5 +1,17 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage webinterface
* @author Adam Armstrong <adama@memetic.org>
* @copyright (C) 2006 - 2012 Adam Armstrong
*
*/
ini_set('allow_url_fopen', 0);
ini_set('display_errors', 0);
@@ -13,6 +25,7 @@ if ($_GET[debug])
include("../includes/defaults.inc.php");
include("../config.php");
include_once("../includes/definitions.inc.php");
include("includes/functions.inc.php");
include("../includes/functions.php");
include("includes/authenticate.inc.php");
@@ -55,4 +68,4 @@ if ($_GET['query'] && $_GET['cmd'])
$output = trim($output);
echo("<pre>$output</pre>");
?>
?>

View File

@@ -1,5 +1,17 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage billing
* @author Adam Armstrong <adama@memetic.org>
* @copyright (C) 2006 - 2012 Adam Armstrong
*
*/
if (strpos($_SERVER['REQUEST_URI'], "debug"))
{
$debug = "1";
@@ -22,6 +34,7 @@ $report = (isset($_GET['report']) ? $_GET['report'] : "");
include("../includes/defaults.inc.php");
include("../config.php");
include_once("../includes/definitions.inc.php");
include("../includes/functions.php");
include("includes/functions.inc.php");
include("includes/authenticate.inc.php");

1218
includes/definitions.inc.php Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

14
irc.php
View File

@@ -1,7 +1,18 @@
#!/usr/bin/env php
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage ircbot
* @author Adam Armstrong <adama@memetic.org>
* @copyright (C) 2006 - 2012 Adam Armstrong
*
*/
chdir(dirname($argv[0]));
# Disable annoying messages... well... all messages actually :)
@@ -9,6 +20,7 @@ error_reporting(0);
include_once("includes/defaults.inc.php");
include_once("config.php");
include("includes/definitions.inc.php");
include_once("includes/functions.php");
include_once("includes/discovery/functions.inc.php");
include_once('Net/SmartIRC.php');

View File

@@ -1,10 +1,23 @@
#!/usr/bin/env php
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage billing
* @author Adam Armstrong <adama@memetic.org>
* @copyright (C) 2006 - 2012 Adam Armstrong
*
*/
chdir(dirname($argv[0]));
include("includes/defaults.inc.php");
include("config.php");
include("includes/definitions.inc.php");
include("includes/functions.php");
$iter = "0";

View File

@@ -1,6 +1,18 @@
#!/usr/bin/env php
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage poller
* @author Adam Armstrong <adama@memetic.org>
* @copyright (C) 2006 - 2012 Adam Armstrong
*
*/
echo("\nPLEASE USE 'poller.php' INSTEAD!\n");
include("poller.php");

View File

@@ -1,21 +1,23 @@
#!/usr/bin/env php
<?php
/* Observium Network Management and Monitoring System
* Copyright (C) 2006-2011, Observium Developers - http://www.observium.org
/**
* Observium
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This file is part of Observium.
*
* @package observium
* @subpackage poller
* @author Adam Armstrong <adama@memetic.org>
* @copyright (C) 2006 - 2012 Adam Armstrong
*
* See COPYING for more details.
*/
chdir(dirname($argv[0]));
include("includes/defaults.inc.php");
include("config.php");
include("includes/definitions.inc.php");
include("includes/functions.php");
include("includes/polling/functions.inc.php");

View File

@@ -1,10 +1,23 @@
#!/usr/bin/env php
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage cli
* @author Adam Armstrong <adama@memetic.org>
* @copyright (C) 2006 - 2012 Adam Armstrong
*
*/
chdir(dirname($argv[0]));
include("includes/defaults.inc.php");
include("config.php");
include("includes/definitions.inc.php");
include("includes/functions.php");
# Remove a host and all related data from the system

View File

@@ -1,6 +1,18 @@
#!/usr/bin/env php
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage snmptraps
* @author Adam Armstrong <adama@memetic.org>
* @copyright (C) 2006 - 2012 Adam Armstrong
*
*/
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
ini_set('log_errors', 1);
@@ -8,6 +20,7 @@ ini_set('error_reporting', E_ALL);
include("includes/defaults.inc.php");
include("config.php");
include("includes/definitions.inc.php");
include("includes/functions.php");
$entry = explode(",", $argv[1]);

View File

@@ -9,13 +9,13 @@
* @package observium
* @subpackage syslog
* @author Adam Armstrong <adama@memetic.org>
* @copyright (C) 2006 - 2011 Adam Armstrong
* @license http://gnu.org/copyleft/gpl.html GNU GPL
* @copyright (C) 2006 - 2012 Adam Armstrong
*
*/
include("includes/defaults.inc.php");
include("config.php");
include("includes/definitions.inc.php");
include("includes/syslog.php");
include("includes/dbFacile.php");
include("includes/common.php");