More network map updates

This commit is contained in:
laf
2015-07-14 11:47:42 +01:00
834 changed files with 140575 additions and 41945 deletions

View File

@@ -30,5 +30,15 @@ Contributors to LibreNMS:
- Freddie Cash (fjwcash@gmail.com) (fjwcash)
- Thom Seddon <thom@seddonmedia.co.uk> (thomseddon)
- Vitali Kari <vitali.kari@gmail.com> (vitalisator)
- James Campbell <neokjames@gmail.com> (neokjames)
- Steve Calvário <calvario.steve@gmail.com> (Calvario)
- Christian Marg <marg@rz.tu-clausthal.de> (einhirn)
- Louis Rossouw <lrossouw@gmail.com> (spinza)
- Clint Armstrong <clint@clintarmstrong.net> (clinta)
- Tony Ditchfield <tony.ditchfield@gmail.com> (arnoldthebat)
- Travis Hegner <travis.hegner@gmail.com> (travishegner)
- Will Jones <email@willjones.eu> (willjones)
- Job Snijders <job@instituut.net> (job)
[1]: http://observium.org/ "Observium web site"

View File

@@ -28,7 +28,7 @@ if (isset($options['g']) && $options['g'] >= 0) {
array_shift($argv);
array_unshift($argv, $cmd);
$poller_group = $options['g'];
} elseif ($config['distributed_poller_group'] > 0 && $config['distributed_poller'] === TRUE) {
} elseif ($config['distributed_poller'] === TRUE) {
$poller_group = $config['distributed_poller_group'];
}
@@ -114,6 +114,9 @@ if (!empty($argv[1]))
elseif (preg_match ('/^(sha|md5)$/i', $arg))
{
$v3['authalgo'] = $arg;
} else {
echo "Invalid argument: " . $arg . "\n" ;
return ;
}
}
@@ -147,6 +150,9 @@ if (!empty($argv[1]))
elseif (preg_match ('/^(aes|des)$/i', $arg))
{
$v3['cryptoalgo'] = $arg;
} else {
echo "Invalid argument: " . $arg . "\n" ;
return ;
}
}

View File

@@ -93,7 +93,7 @@ function IssueAlert($alert) {
}
$obj = DescribeAlert($alert);
if( is_array($obj) ) {
$tpl = dbFetchRow('SELECT template FROM alert_templates WHERE rule_id LIKE "%,'.$alert['rule_id'].',%"');
$tpl = dbFetchRow("SELECT `template` FROM `alert_templates` JOIN `alert_template_map` ON `alert_template_map`.`alert_templates_id`=`alert_templates`.`id` WHERE `alert_template_map`.`alert_rule_id`=?", array($alert['rule_id']));
if( isset($tpl['template']) ) {
$tpl = $tpl['template'];
} else {
@@ -197,20 +197,45 @@ function RunAlerts() {
if( $chk['alerted'] == $alert['state'] ) {
$noiss = true;
}
if( !empty($rextra['delay']) ) {
if( (time()-strtotime($alert['time_logged'])+$config['alert']['tolerance-window']) < $rextra['delay'] || (!empty($alert['details']['delay']) && (time()-$alert['details']['delay']+$config['alert']['tolerance-window']) < $rextra['delay']) ) {
if( !empty($rextra['count']) && empty($rextra['interval']) ) {
// This check below is for compat-reasons
if( !empty($rextra['delay']) ) {
if( (time()-strtotime($alert['time_logged'])+$config['alert']['tolerance-window']) < $rextra['delay'] || (!empty($alert['details']['delay']) && (time()-$alert['details']['delay']+$config['alert']['tolerance-window']) < $rextra['delay']) ) {
continue;
} else {
$alert['details']['delay'] = time();
} else {
$alert['details']['delay'] = time();
$updet = true;
}
}
if( $alert['state'] == 1 && !empty($rextra['count']) && ($rextra['count'] == -1 || $alert['details']['count']++ < $rextra['count']) ) {
if( $alert['details']['count'] < $rextra['count'] ) {
$noacc = true;
}
$updet = true;
$noiss = false;
}
}
if( $alert['state'] == 1 && !empty($rextra['count']) && ($rextra['count'] == -1 || $alert['details']['count']++ < $rextra['count']) ) {
if( $alert['details']['count'] < $rextra['count'] ) {
$noacc = true;
} else {
// This is the new way
if( !empty($rextra['delay']) && (time()-strtotime($alert['time_logged'])+$config['alert']['tolerance-window']) < $rextra['delay'] ) {
continue;
}
$updet = true;
$noiss = false;
if( !empty($rextra['interval']) ) {
if( !empty($alert['details']['interval']) && (time()-$alert['details']['interval']+$config['alert']['tolerance-window']) < $rextra['interval'] ) {
continue;
} else {
$alert['details']['interval'] = time();
$updet = true;
}
}
if( $alert['state'] == 1 && !empty($rextra['count']) && ($rextra['count'] == -1 || $alert['details']['count']++ < $rextra['count']) ) {
if( $alert['details']['count'] < $rextra['count'] ) {
$noacc = true;
}
$updet = true;
$noiss = false;
}
}
if( $chk['ignore'] == 1 || $chk['disabled'] == 1 ) {
$noiss = true;
@@ -247,12 +272,19 @@ function ExtTransports($obj) {
global $config;
$tmp = false; //To keep scrutinizer from naging because it doesnt understand eval
foreach( $config['alert']['transports'] as $transport=>$opts ) {
if( ($opts === true || !empty($opts)) && file_exists($config['install_dir']."/includes/alerts/transport.".$transport.".php") ) {
if( ($opts === true || !empty($opts)) && $opts != false && file_exists($config['install_dir']."/includes/alerts/transport.".$transport.".php") ) {
echo $transport." => ";
eval('$tmp = function($obj,$opts) { global $config; '.file_get_contents($config['install_dir']."/includes/alerts/transport.".$transport.".php").' };');
$tmp = $tmp($obj,$opts);
echo ($tmp ? "OK" : "ERROR")."; ";
if( $tmp ) {
echo "OK";
log_event("Issued ".$obj['severity']." alert for rule '".$obj['name']."' to transport '".$transport."'",$obj['device_id']);
} else {
echo "ERROR";
log_event("Could not issue ".$obj['severity']." alert for rule '".$obj['name']."' to transport '".$transport."'",$obj['device_id']);
}
}
echo "; ";
}
}
@@ -322,7 +354,7 @@ function DescribeAlert($alert) {
$obj['device_id'] = $alert['device_id'];
$extra = $alert['details'];
if( $alert['state'] >= 1 ) {
$obj['title'] = 'Alert for device '.$device['hostname'].' Alert-ID #'.$alert['id'];
$obj['title'] = 'Alert for device '.$device['hostname'].' - '.($alert['name'] ? $alert['name'] : $alert['rule']);
if( $alert['state'] == 2 ) {
$obj['title'] .= " got acknowledged";
} elseif( $alert['state'] == 3 ) {
@@ -345,7 +377,7 @@ function DescribeAlert($alert) {
return false;
}
$extra = json_decode(gzuncompress($id['details']),true);
$obj['title'] = 'Device '.$device['hostname'].' recovered from Alert-ID #'.$id['id'];
$obj['title'] = 'Device '.$device['hostname'].' recovered from '.($alert['name'] ? $alert['name'] : $alert['rule']);
$obj['elapsed'] = TimeFormat(strtotime($alert['time_logged'])-strtotime($id['time_logged']));
$obj['id'] = $id['id'];
$obj['faults'] = false;

View File

@@ -10,51 +10,50 @@
* @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");
require 'includes/defaults.inc.php';
require 'config.php';
require 'includes/definitions.inc.php';
require 'includes/functions.php';
require 'html/includes/functions.inc.php';
// Check all of our interface RRD files for errors
if ($argv[1]) {
$where = 'AND `port_id` = ?';
$params = array($argv[1]);
}
if ($argv[1]) { $where = "AND `port_id` = ?"; $params = array($argv[1]); }
$i = 0;
$i = 0;
$errored = 0;
foreach (dbFetchRows("SELECT * FROM `ports` AS I, `devices` AS D WHERE I.device_id = D.device_id $where", $params) as $interface)
{
$errors = $interface['ifInErrors_delta'] + $interface['ifOutErrors_delta'];
if ($errors > '1')
{
$errored[] = generate_device_link($interface, $interface['hostname'] . " - " . $interface['ifDescr'] . " - " . $interface['ifAlias'] . " - " . $interface['ifInErrors_delta'] . " - " . $interface['ifOutErrors_delta']);
$errored++;
}
$i++;
}
foreach (dbFetchRows("SELECT * FROM `ports` AS I, `devices` AS D WHERE I.device_id = D.device_id $where", $params) as $interface) {
$errors = ($interface['ifInErrors_delta'] + $interface['ifOutErrors_delta']);
if ($errors > '1') {
$errored[] = generate_device_link($interface, $interface['hostname'].' - '.$interface['ifDescr'].' - '.$interface['ifAlias'].' - '.$interface['ifInErrors_delta'].' - '.$interface['ifOutErrors_delta']);
$errored++;
}
echo("Checked $i interfaces\n");
if (is_array($errored))
{ // If there are errored ports
$i = 0;
$msg = "Interfaces with errors : \n\n";
foreach ($errored as $int)
{
$msg .= "$int\n"; // Add a line to the report email warning about them
$i++;
}
// Send the alert email
notify($device, $config['project_name'] . " detected errors on $i interface" . ($i != 1 ? 's' : ''), $msg);
}
echo("$errored interfaces with errors over the past 5 minutes.\n");
echo "Checked $i interfaces\n";
?>
if (is_array($errored)) {
// If there are errored ports
$i = 0;
$msg = "Interfaces with errors : \n\n";
foreach ($errored as $int) {
$msg .= "$int\n";
// Add a line to the report email warning about them
$i++;
}
// Send the alert email
notify($device, $config['project_name']." detected errors on $i interface".($i != 1 ? 's' : ''), $msg);
}
echo "$errored interfaces with errors over the past 5 minutes.\n";

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env php
<?php
/**
/*
* Observium
*
* This file is part of Observium.
@@ -10,76 +10,74 @@
* @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");
require 'includes/defaults.inc.php';
require 'config.php';
require 'includes/definitions.inc.php';
require '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)
{
if ($service['status'] = "1")
{
unset($check, $service_status, $time, $status);
$service_status = $service['service_status'];
$service_type = strtolower($service['service_type']);
$service_param = $service['service_param'];
$checker_script = $config['install_dir'] . "/includes/services/" . $service_type . "/check.inc";
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) {
if ($service['status'] = '1') {
unset($check, $service_status, $time, $status);
$service_status = $service['service_status'];
$service_type = strtolower($service['service_type']);
$service_param = $service['service_param'];
$checker_script = $config['install_dir'].'/includes/services/'.$service_type.'/check.inc';
if (is_file($checker_script))
{
include($checker_script);
if (is_file($checker_script)) {
include $checker_script;
}
else {
$status = '2';
$check = "Error : Script not found ($checker_script)";
}
$update = array();
if ($service_status != $status) {
$update['service_changed'] = time();
if ($service['sysContact']) {
$email = $service['sysContact'];
}
else {
$email = $config['email_default'];
}
if ($status == '1') {
$msg = 'Service Up: '.$service['service_type'].' on '.$service['hostname'];
notify($device, 'Service Up: '.$service['service_type'].' on '.$service['hostname'], $msg);
}
else if ($status == '0') {
$msg = 'Service Down: '.$service['service_type'].' on '.$service['hostname'];
notify($device, 'Service Down: '.$service['service_type'].' on '.$service['hostname'], $msg);
}
}
else {
unset($updated);
}
$update = array_merge(array('service_status' => $status, 'service_message' => $check, 'service_checked' => time()), $update);
dbUpdate($update, 'services', '`service_id` = ?', array($service['service_id']));
unset($update);
}
else
{
$status = "2";
$check = "Error : Script not found ($checker_script)";
else {
$status = '0';
}//end if
$rrd = $config['rrd_dir'].'/'.$service['hostname'].'/'.safename('service-'.$service['service_type'].'-'.$service['service_id'].'.rrd');
if (!is_file($rrd)) {
rrdtool_create($rrd, 'DS:status:GAUGE:600:0:1 '.$config['rrd_rra']);
}
$update = array();
if ($service_status != $status)
{
$update['service_changed'] = time();
if ($service['sysContact']) { $email = $service['sysContact']; } else { $email = $config['email_default']; }
if ($status == "1")
{
$msg = "Service Up: " . $service['service_type'] . " on " . $service['hostname'];
notify($device, "Service Up: " . $service['service_type'] . " on " . $service['hostname'], $msg);
}
elseif ($status == "0")
{
$msg = "Service Down: " . $service['service_type'] . " on " . $service['hostname'];
notify($device, "Service Down: " . $service['service_type'] . " on " . $service['hostname'], $msg);
}
} else { unset($updated); }
$update = array_merge(array('service_status' => $status, 'service_message' => $check, 'service_checked' => time()), $update);
dbUpdate($update, 'services', '`service_id` = ?', array($service['service_id']));
unset($update);
} else {
$status = "0";
}
$rrd = $config['rrd_dir'] . "/" . $service['hostname'] . "/" . safename("service-" . $service['service_type'] . "-" . $service['service_id'] . ".rrd");
if (!is_file($rrd))
{
rrdtool_create ($rrd, "DS:status:GAUGE:600:0:1 ".$config['rrd_rra']);
}
if ($status == "1" || $status == "0")
{
rrdtool_update($rrd,"N:".$status);
} else {
rrdtool_update($rrd,"N:U");
}
} # while
?>
if ($status == '1' || $status == '0') {
rrdtool_update($rrd, 'N:'.$status);
}
else {
rrdtool_update($rrd, 'N:U');
}
} //end foreach

View File

@@ -1,33 +1,31 @@
<?php
/*
Configuration to JSON converter
Written by Job Snijders <job.snijders@atrato.com>
*/
* Configuration to JSON converter
* Written by Job Snijders <job@instituut.net>
*
*/
$defaults_file = 'includes/defaults.inc.php';
$config_file = 'config.php';
$config_file = 'config.php';
// move to install dir
chdir(dirname($argv[0]));
function iscli() {
if(php_sapi_name() == 'cli' && empty($_SERVER['REMOTE_ADDR'])) {
return true;
} else {
return false;
}
function iscli()
{
if (php_sapi_name() == 'cli' && empty($_SERVER['REMOTE_ADDR'])) {
return true;
}
else {
return false;
}
}
// check if we are running throw the CLI, otherwise abort
if ( iscli() ) {
require_once($defaults_file);
require_once($config_file);
print(json_encode($config));
if (iscli()) {
include_once $defaults_file;
include_once $config_file;
print (json_encode($config));
}
?>

View File

@@ -5,8 +5,9 @@ find . \
-path ./html/includes/geshi -prune -o \
-path ./html/includes/jpgraph -prune -o \
-path ./html/js/jqplot -prune -o \
-path ./junk -prune -o \
-path ./logs -prune -o \
-path ./mibs -prune -o \
-path ./rrd -prune -o \
-name .git -prune -o \
-type f -print|xargs grep "$@"
-type f -print0|xargs -0 grep "$@"

48
cronic Executable file
View File

@@ -0,0 +1,48 @@
#!/bin/bash
# Cronic v2 - cron job report wrapper
# Copyright 2007 Chuck Houpt. No rights reserved, whatsoever.
# Public Domain CC0: http://creativecommons.org/publicdomain/zero/1.0/
set -eu
OUT=/tmp/cronic.out.$$
ERR=/tmp/cronic.err.$$
TRACE=/tmp/cronic.trace.$$
set +e
"$@" >$OUT 2>$TRACE
RESULT=$?
set -e
PATTERN="^${PS4:0:1}\\+${PS4:1}"
if grep -aq "$PATTERN" $TRACE
then
! grep -av "$PATTERN" $TRACE > $ERR
else
ERR=$TRACE
fi
if [ $RESULT -ne 0 -o -s "$ERR" ]
then
echo "Cronic detected failure or error output for the command:"
echo "$@"
echo
echo "RESULT CODE: $RESULT"
echo
echo "ERROR OUTPUT:"
cat "$ERR"
echo
echo "STANDARD OUTPUT:"
cat "$OUT"
if [ $TRACE != $ERR ]
then
echo
echo "TRACE-ERROR OUTPUT:"
cat "$TRACE"
fi
fi
rm -f "$OUT"
rm -f "$ERR"
rm -f "$TRACE"

View File

@@ -58,5 +58,13 @@ if ($options['f'] === 'perf_times') {
if ($options['f'] === 'callback') {
require_once "callback.php";
}
if ($options['f'] === 'device_perf') {
if (is_numeric($config['device_perf_purge'])) {
if (dbDelete('device_perf', "timestamp < UNIX_TIMESTAMP(DATE_SUB(NOW(),INTERVAL ? DAY))", array($config['device_perf_purge'])) ) {
echo 'Device performance times cleared for entries over ' . $config['device_perf_purge'] . " days\n";
}
}
}
?>

View File

@@ -12,3 +12,4 @@ php daily.php -f eventlog
php daily.php -f authlog
php daily.php -f perf_times
php daily.php -f callback
php daily.php -f device_perf

View File

@@ -99,10 +99,9 @@ include("includes/sql-schema/update.php");
$discovered_devices = 0;
if ($config['distributed_poller'] === TRUE) {
$where .= " AND poller_group=?";
$params = array($config['distributed_poller_group']);
$where .= " AND poller_group IN(".$config['distributed_poller_group'].")";
}
foreach (dbFetch("SELECT * FROM `devices` WHERE status = 1 AND disabled = 0 $where ORDER BY device_id DESC",$params) as $device)
foreach (dbFetch("SELECT * FROM `devices` WHERE status = 1 AND disabled = 0 $where ORDER BY device_id DESC") as $device)
{
discover_device($device, $options);
}

View File

@@ -37,6 +37,21 @@ if ($foo == 5) {
}
```
Start else and elsif on new lines, e.g.
```php
if ($foo == 5) {
echo 'foo is 5';
}
elsif ($foo == 4) {
echo 'foo is 4';
}
else {
echo 'foo is something else';
}
```
This makes diffs much cleaner when moving around blocks of code.
### Including files
Using parenthesis around file includes isn't required, instead just place the file in between ''
```php

View File

@@ -37,4 +37,26 @@ do this but provides so much flexibility along with stopping the need for retrie
place.
As an example pull request, see [PR 706](https://github.com/librenms/librenms/pull/706/files) to get an idea of what
it's like to convert an existing pure html table to Bootgrid.
it's like to convert an existing pure html table to Bootgrid.
### Datetime format
When displaying datetimes, please ensure you use the format YYYY-MM-DD mm:hh:ss where possible, you shouldn't change the
order of this as it will be confusing to users. Cutting it short to just display YYYY-MM-DD mm:hh is fine :).
To keep things consistent we have the following variables which should be used rather than to format dates yourself.
This has the added benefit that users can customise the format:
```php
# Date format for PHP date()s
$config['dateformat']['long'] = "r"; # RFC2822 style
$config['dateformat']['compact'] = "Y-m-d H:i:s";
$config['dateformat']['byminute'] = "Y-m-d H:i";
$config['dateformat']['time'] = "H:i:s";
# Date format for MySQL DATE_FORMAT
$config['dateformat']['mysql']['compact'] = "%Y-%m-%d %H:%i:%s";
$config['dateformat']['mysql']['date'] = "%Y-%m-%d";
$config['dateformat']['mysql']['time'] = "%H:%i:%s";
```

View File

@@ -15,6 +15,7 @@ Table of Content:
- [Slack](#transports-slack)
- [HipChat](#transports-hipchat)
- [PagerDuty](#transports-pagerduty)
- [Pushover](#transports-pushover)
- [Entities](#entities)
- [Devices](#entity-devices)
- [BGP Peers](#entity-bgppeers)
@@ -48,6 +49,7 @@ Rules must consist of at least 3 elements: An __Entity__, a __Condition__ and a
Rules can contain braces and __Glues__.
__Entities__ are provided as `%`-Noted pair of Table and Field. For Example: `%ports.ifOperStatus`.
__Conditions__ can be any of:
- Equals `=`
- Not Equals `!=`
- Matches `~`
@@ -66,6 +68,7 @@ Arithmetics are allowed as well.
## <a name="rules-examples">Examples</a>
Alert when:
- Device goes down: `%devices.status != '1'`
- Any port changes: `%ports.ifOperStatus != 'up'`
- Root-directory gets too full: `%storage.storage_descr = '/' && %storage.storage_perc >= '75'`
@@ -80,12 +83,14 @@ The template-parser understands `if` and `foreach` controls and replaces certain
## <a name="templates-syntax">Syntax</a>
Controls:
- if-else (Else can be omitted):
`{if %placeholder == 'value'}Some Text{else}Other Text{/if}`
- foreach-loop:
`{foreach %placeholder}Key: %key<br/>Value: %value{/foreach}`
Placeholders:
- Hostname of the Device: `%hostname`
- Title for the Alert: `%title`
- Time Elapsed, Only available on recovery (`%state == 0`): `%elapsed`
@@ -138,6 +143,8 @@ $config['alert']['admins'] = true; //Include Adminstrators into alert-contacts
## <a name="transports-email">E-Mail</a>
> You can configure these options within the WebUI now, please avoid setting these options within config.php
E-Mail transport is enabled with adding the following to your `config.php`:
```php
$config['alert']['transports']['mail'] = true;
@@ -164,6 +171,8 @@ $config['alert']['default_mail'] = ''; //Default ema
## <a name="transports-api">API</a>
> You can configure these options within the WebUI now, please avoid setting these options within config.php
API transports definitions are a bit more complex than the E-Mail configuration.
The basis for configuration is `$config['alert']['transports']['api'][METHOD]` where `METHOD` can be `get`,`post` or `put`.
This basis has to contain an array with URLs of each API to call.
@@ -179,6 +188,8 @@ $config['alert']['transports']['api']['get'][] = "https://api.thirdparti.es/issu
## <a name="transports-nagios">Nagios Compatible</a>
> You can configure these options within the WebUI now, please avoid setting these options within config.php
The nagios transport will feed a FIFO at the defined location with the same format that nagios would.
This allows you to use other Alerting-Systems to work with LibreNMS, for example [Flapjack](http://flapjack.io).
```php
@@ -187,6 +198,8 @@ $config['alert']['transports']['nagios'] = "/path/to/my.fifo"; //Flapjack expect
## <a name="transports-irc">IRC</a>
> You can configure these options within the WebUI now, please avoid setting these options within config.php
The IRC transports only works together with the LibreNMS IRC-Bot.
Configuration of the LibreNMS IRC-Bot is described [here](https://github.com/librenms/librenms/blob/master/doc/Extensions/IRC-Bot.md).
```php
@@ -195,6 +208,8 @@ $config['alert']['transports']['irc'] = true;
## <a name="transports-slack">Slack</a>
> You can configure these options within the WebUI now, please avoid setting these options within config.php
The Slack transport will POST the alert message to your Slack Incoming WebHook, you are able to specify multiple webhooks along with the relevant options to go with it. All options are optional, the only required value is for url, without this then no call to Slack will be made. Below is an example of how to send alerts to two channels with different customised options:
```php
@@ -206,6 +221,8 @@ $config['alert']['transports']['slack'][] = array('url' => "https://hooks.slack.
## <a name="transports-hipchat">HipChat</a>
> You can configure these options within the WebUI now, please avoid setting these options within config.php
The HipChat transport requires the following:
__room_id__ = HipChat Room ID
@@ -251,6 +268,8 @@ $config['alert']['transports']['hipchat'][] = array("url" => "https://api.hipcha
## <a name="transports-pagerduty">PagerDuty</a>
> You can configure these options within the WebUI now, please avoid setting these options within config.php
Enabling PagerDuty transports is almost as easy as enabling email-transports.
All you need is to create a Service with type Generic API on your PagerDuty dashboard.
@@ -265,6 +284,31 @@ That's it!
__Note__: Currently ACK notifications are not transported to PagerDuty, This is going to be fixed within the next major version (version by date of writing: 2015.05)
## <a name="transports-pushover">Pushover</a>
Enabling Pushover support is fairly easy, there are only two required parameters.
Firstly you need to create a new Application (called LibreNMS, for example) in your account on the Pushover website (https://pushover.net/apps)
Now copy your API Token/Key from the newly created Application and setup the transport in your config.php like:
```php
$config['alert']['transports']['pushover'][] = array(
"appkey" => 'APPLICATIONAPIKEYGOESHERE',
"userkey" => 'USERKEYGOESHERE',
);
```
To modify the Critical alert sound, add the 'sound_critical' parameter, example:
```php
$config['alert']['transports']['pushover'][] = array(
"appkey" => 'APPLICATIONAPIKEYGOESHERE',
"userkey" => 'USERKEYGOESHERE',
"sound_critical" => 'siren',
);
```
# <a name="entities">Entities
Entities as described earlier are based on the table and column names within the database, if you are ensure of what the entity is you want then have a browse around inside MySQL using `show tables` and `desc <tablename>`.
@@ -277,6 +321,8 @@ __devices.location__ = The devices location.
__devices.status__ = The status of the device, 1 = up, 0 = down.
__devices.status_reason__ = The reason the device was detected as down (icmp or snmp).
__devices.ignore__ = If the device is ignored this will be set to 1.
__devices.disabled__ = If the device is disabled this will be set to 1.
@@ -450,3 +496,27 @@ Example: `%macros.past_5m` is Last 5 Minutes.
Resolution: 5,10,15,30,60
Source: `DATE_SUB(NOW(),INTERVAL $ MINUTE)`
## <a name="macros-sensors">Sensors</a> (Boolean)
Entity: `%macros.sensor`
Description: Only select sensors that aren't ignored.
Source: `(%sensors.sensor_alert = 1)`
## <a name="macros-packetloss">Packet Loss</a> (Boolean)
Entity: `(%macros.packet_loss_5m)`
Description: Packet loss % value for the device within the last 5 minutes.
Example: `%macros.packet_loss_5m` > 50
Entity: `(%macros.packet_loss_15m)`
Description: Packet loss % value for the device within the last 15 minutes.
Example: `%macros.packet_loss_15m` > 50

View File

@@ -11,6 +11,7 @@ It is also required that all pollers can access the central memcached to communi
In order to enable distributed polling, set `$config['distributed_poller'] = true` and your memcached details into `$config['distributed_poller_memcached_host']` and `$config['distributed_poller_memcached_port']`.
By default, all hosts are shared and have the `poller_group = 0`. To pin a device to a poller, set it to a value greater than 0 and set the same value in the poller's config with `$config['distributed_poller_group']`.
Usually the poller's name is equal to the machine's hostname, if you want to change it set `$config['distributed_poller_name']`.
One can also specify a comma seperated string of poller groups in $config['distributed_poller_group']. The poller will then poll devices from any of the groups listed. If new devices get added from the poller they will be assigned to the first poller group in the list unless the group is specified when adding the device.
## Configuration
```php

View File

@@ -0,0 +1,13 @@
# Globe Frontpage Configuration
LibreNMS comes with a configurable geochart based frontpage to visualize where your gear is located geographically.
To enable it, set `$config['front_page'] = "pages/front/globe.php";` in your `config.php`.
You can use any of these config-parameters to adjust some aspects of it:
- `$config['frontpage_globe']['markers']` is used to change what is being shown on the Markers of the map. It can be either `devices` or `ports`
- `$config['frontpage_globe']['region']` defines the Region to chart. Any region supported by Google's GeoChart API is allowed (https://developers.google.com/chart/interactive/docs/gallery/geochart#continent-hierarchy-and-codes)
- `$config['frontpage_globe']['resolution']` can be 'countries', 'provinces' or 'metros' (latter two are mostly US only due to google-limits).

View File

@@ -0,0 +1,52 @@
# Setting up Services
Services within LibreNMS provides the ability to use Nagios plugins to perform additional monitoring outside of SNMP.
These services are tied into an existing device so you need at least one device that supports SNMP to be able to add it
to LibreNMS - localhot is a good one.
## Setup
Firstly, install Nagios plugins however you would like, this could be via yum, apt-get or direct from source.
Next, you need to enable the services within config.php with the following:
```php
$config['show_services'] = 1;
```
This will enable a new service menu within your navbar.
```php
$config['nagios_plugins'] = "/usr/lib/nagios/plugins";
```
This will point LibreNMS at the location of the nagios plugins - please ensure that any plugins you use are set to executable.
Finally, you now need to add check-services.php to the current cron file (/etc/cron.d/librenms typically) like:
```bash
*/5 * * * * librenms /opt/librenms/check-services.php >> /dev/null 2>&1
```
Now you can add services via the main Services link in the navbar, or via the Services link within the device page.
> **Please note that at present the service checks will only return the status and the response from the check
no graphs will be generated. **
## Supported checks
- ftp
- icmp
- spop
- ssh
- ssl_cert
- http
- domain_expire
- mysql
- imap
- dns
- telnet
- smtp
- pop
- simap
- ntp
- ircd

View File

@@ -1,3 +1,87 @@
### July 2015
#### Bug fixes
- Fixed API not functioning. (PR1367)
- Fixed API not storing alert rule names (PR1372)
- Fixed datetimepicker use (PR1376)
- Do not allow master to rejoin itself. (PR1377)
- Fixed Nginx config file (PR1389)
#### Improvements
- Added additional support for Rielo UPS (PR1381)
- Improved service check support (PR1385,PR1386,PR1387,PR1388)
### June 2015
#### Bug fixes
- Fixed services list SQL issue (PR1181)
- Fixed negative values for storage when volume is > 2TB (PR1185)
- Fixed visual display for input fields on /syslog/ (PR1193)
- Fixed fatal php issue in shoutcast.php (PR1203)
- Fixed percent bars in /bills/ (PR1208)
- Fixed item count in memory and storage pages (PR1210)
- Fixed syslog not loading (PR1219)
- Fixed fatal on reload in IRC bot (PR1218)
- Alter Windows CPU description when unknown (PR1226)
- Fixed rfc1628 current calculation (PR1256)
- Fixed alert mapping not working (PR1280)
- Fixed legend ifLabels (PR1296)
- Fixed bug causing map to not load when stale link data was present (PR1297)
- Fixed javascript issue preventing removal of alert rules (PR1312)
- Fixed removal of IPs before ports are deleted (PR1329)
- Fixed JS issue when removing ports from bills (PR1330)
- Fixed adding --daemon a second time to collectd Graphs (PR1342)
- Fixed CollectD DS names (PR1347,PR1349,PR1368)
- Fixed graphing issues when rrd contains special chars (PR1350)
- Fixed regex for device groups (PR1359)
- Added HOST-RESOURCES-MIB into Synology detection (RP1360)
- Fix health page graphs showing the first graph for all (PR1363)
#### Improvements
- Updated Syslog docs to include syslog-ng 3.5.1 updates (PR1171)
- Added Pushover Transport (PR1180, PR1191)
- Converted processors and memory table to bootgrid (PR1188, PR1192)
- Issued alerts and transport now logged to eventlog (PR1194)
- Added basic support for Enterasys devices (PR1211)
- Added dynamic config to configure alerting (PR1153)
- Added basic support for Multimatic USV (PR1215)
- Disabled and ignored ports no longer show by default on /ports/ (PR1228,PR1301)
- Added additional graphs to menu on devices page (PR1229)
- Added Docs on configuring Globe front page (PR1231)
- Added robots.txt to html folder to disallow indexing (PR1234)
- Added additional support for Synology units (PR1235,PR1244,PR1269)
- Added IP check to autodiscovery code (PR1248)
- Updated HP ProCurve detection (PR1249)
- Added basic detection for Alcatel-Lucent OmniSwitch (PR1253, PR1282)
- Added additional metrics for rfc1628 UPS (PR1258, PR1268)
- Allow multiple discovery modules to be specified on command line (PR1263)
- Updated docs on using libvirt (PR1264)
- Updated Ruckus detection (PR1267)
- Initial release of MIB based polling (PR1273)
- Added support for CISCO-BGP4-MIB (PR1184)
- Added support for Dell EqualLogic units (PR1283,PR1309)
- Added logging of success/ failure for alert transports (PR1286)
- Updated VyOS detection (PR1299)
- Added primary serial number detection for Cisco units (PR1300)
- Added support for specifying MySQL port number in config.php (PR1302)
- Updated alert subject to use rule name not ID (PR1310)
- Added macro %macros.sensor (PR1311)
- Added WebUI support for Pushover (PR1313)
- Updated path check for Oxidized config (PR1316)
- Added Multimatic UPS to rfc1628 detection (PR1317)
- Added timeout for Unix agent (PR1319)
- Added support for a poller to use more than one poller group (PR1323)
- Added ability to use Plugins on device overview page (PR1325)
- Added latency loss/avg/max/min results to DB and Graph (PR1326)
- Added recording of device down (snmp/icmp) (PR1326)
- Added debugging output for when invalid SNMPv3 options used (PR1331)
- Added load and state output to device overview page (PR1333)
- Added load sensors to RFC1628 Devices (PR1336)
- Added support for WebPower Pro II UPS Cards (PR1338)
- No longer rewrite server-status in .htaccess (PR1339)
- Added docs for setting up Service extensions (PR1354)
- Added additional info from pfsense devices (PR1356)
### May 2015
#### Bug fixes
@@ -31,6 +115,9 @@
- Fixed ARP search graph type reference (PR1131)
- Fixed showing state=X in device list (PR1144)
- Removed ability for demo user to delete users (PR1151)
- Fixed user / port perms for top X front page boxes (PR1156)
- Fixed truncating UTF-8 strings (PR1166)
- Fixed attaching templates due to JS issue (PR1167)
#### Improvements
- Added loading bar to top nav (PR893)
@@ -69,7 +156,7 @@
- Added disk temperature for Synology DSM (PR986)
- Added ICMP, TLS/SSL and Domain expiry service checks (PR987, PR1040, PR1041)
- Added IPMI detection (PR988)
- Miktrotik MIB update (PR991)
- Mikrotik MIB update (PR991)
- Set better timeperiod for caching graphs (PR992)
- Added config option to disable port relationship in ports list (PR996)
- Added support for custom customer description parse (PR998)
@@ -105,6 +192,8 @@
- Added config options for region and resolution on globe map (PR1137)
- Addded RRDCached example docs (PR1148)
- Updated support for additional NetBotz models (PR1152)
- Updated /iftype/ page to include speed/circuit/notes (PR1155)
- Added detection for PowerConnect 55XX devices (PR1165)
### Apr 2015

View File

@@ -0,0 +1,100 @@
## WARNING ##
MIB-based polling is experimental. It might overload your LibreNMS server,
destroy your data, set your routers on fire, and kick your cat. It has been
tested against a very limited set of devices (namely Ruckus ZD1000 wireless
controllers, and `net-snmp` on Linux). It may fail badly on other hardware.
The approach taken is fairly basic and I claim no special expertise in
understanding MIBs. Most of my understanding of SNMP comes from reading
net-snmp man pages, and reverse engineering the output of snmptranslate and
snmpwalk and trying to make devices work with LibreNMS. I may have made
false assumptions and probably use wrong terminology in many places. Feel
free to offer corrections/suggestions via pull requests or email.
Paul Gear <paul@librenms.org>
## Overview ##
MIB-based polling is disabled by default; you must set
`$config['poller_modules']['mib'] = 1;`
in `config.php` to enable it.
The components involved in of MIB-based support are:
### Discovery ###
- MIB-based detection is not involved; any work done here would have to be
duplicated by the poller and thus would only increase load.
### Polling ###
- The file `includes/snmp.inc.php` now contains code which can parse MIBs
using `snmptranslate` and use the data returned to populate an array
which guides the poller in what to store. At the moment, only OIDs with
Unsigned32 and Counter64 data types are parsed.
- `includes/polling/mib.inc.php` looks for a MIB matching sysObjectID in
the MIB directory; if one is found, it:
- parses it
- walks that MIB on the device
- stores any numeric results in individual RRD files
- updates/adds graph definitions in the previously-unused graph_types
database table
- Individual OSes (`includes/polling/os/*.inc.php`) can poll extra MIBs
for a given OS by calling `poll_mib()`. At the moment, this actually
happens before the general MIB polling.
- Devices may be excluded from MIB polling by changing the setting in the
device edit screen (`/device/device=ID/tab=edit/section=modules/`)
### Graphing ###
- For each graph type defined in the database, a graph will appear in:
Device -> Graphs -> MIB
- MIB graphs are generated generically by
`html/includes/graphs/device/mib.inc.php`
- At the moment, all units are placed in the same graph. This is probably
non-optimal for, e.g., wifi controllers with hundreds of APs attached.
## Adding/testing other device types ##
One of the goals of this work is to help take out the heavy lifting of
adding new device types. Even if you want fully customised graphs or
tables, you can use the automatic collection of MIBs to make it easy to
gather the data you want.
### How to add a new device MIB ###
1. Ensure the manufacturer's MIB is present in the mibs directory. If you
plan to submit your work to LibreNMS, make sure you attribute the source
of the MIB, including the exact download URL.
2. Check that `snmptranslate -Ts -M mibs -m MODULE | grep mibName` produces
a named list of OIDs. See the comments for `snmp_mib_walk()` in
`includes/snmp.inc.php` for an example.
3. Check that `snmptranslate -Td -On -M mibs -m MODULE MODULE::mibName`
produces a parsed description of the OID values. An example can be
found in the comments for `snmp_mib_parse()` in `includes/snmp.inc.php`.
4. Get the `sysObjectID` from a device, for example:
```snmpget -v2c -c public -OUsb -m SNMPv2-MIB -M /opt/librenms/mibs -t 30 hostname sysObjectID.0```
5. Ensure `snmptranslate -m all -M /opt/librenms/mibs OID 2>/dev/null`
(where OID is the value returned for sysObjectID above) results in a
valid name for the MIB. See the comments for `snmp_translate()` in
`includes/snmp.inc.php` for an example. If this step fails, it means
there is something wrong with the MIB and `net-snmp` cannot parse it.
6. Add any additional MIBs you wish to poll for specific device types to
`includes/polling/os/OSNAME.inc.php` by calling `poll_mibs()` with the
MIB module and name. See `includes/polling/os/ruckuswireless.inc.php` for
an example.
7. That should be all you need to see MIB graphs!
## TODO ##
- Save the most recent MIB data in the database (including string types
which cannot be graphed). Display it in the appropriate places.
- Parse and save integer and timetick data types.
- Filter MIBs/OIDs from being polled and/or saved.
- Move graphs from the MIB section to elsewhere. e.g. There is already
specific support for wireless APs - this should be utilised, but isn't
yet.
- Combine multiple MIB values into graphs automatically on a predefined or
user-defined basis.
- Include MIB types in stats submissions.

View File

@@ -7,8 +7,8 @@ NOTE: These instructions assume you are the root user. If you are not, prepend
yum install net-snmp mysql-server
service snmpd start
service mysqld start
chkconfig --levels 235 mysqld on
chkconfig --levels 235 snmpd on
chkconfig mysqld on
chkconfig snmpd on
mysql_secure_installation
mysql -uroot -p
@@ -46,7 +46,7 @@ Install necessary software. The packages listed below are an all-inclusive list
Note if not using HTTPd (Apache): RHEL requires `httpd` to be installed regardless of of `nginx`'s (or any other web-server's) presence.
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
yum install epel-release
yum install php php-cli php-gd php-mysql php-snmp php-pear php-curl httpd net-snmp graphviz graphviz-php mysql ImageMagick jwhois nmap mtr rrdtool MySQL-python net-snmp-utils vixie-cron php-mcrypt fping git
pear install Net_IPv4-1.3.4
pear install Net_IPv6-1.2.2b2
@@ -87,8 +87,8 @@ If the file `/etc/httpd/conf.d/welcome.conf` exists, you might want to remove th
Install necessary extra software and let it start on system boot.
yum install nginx php-fpm
chkconfig --levels 235 nginx on
chkconfig --levels 235 php-fpm on
chkconfig nginx on
chkconfig php-fpm on
Modify permissions and configuration for `php-fpm` to use nginx credentials.
@@ -96,7 +96,7 @@ Modify permissions and configuration for `php-fpm` to use nginx credentials.
vi /etc/php-fpm.d/www.conf # At line #12: Change `listen` to `/var/run/php5-fpm.sock`
# At line #39-41: Change the `user` and `group` to `nginx`
Add configuration for `nginx` at `/etc/nginx/conf.d/librenms` with the following content:
Add configuration for `nginx` at `/etc/nginx/conf.d/librenms.conf` with the following content:
```nginx
server {

View File

@@ -33,6 +33,8 @@ $config['fping'] = "/usr/bin/fping";
$config['fping6'] = "/usr/bin/fping6";
$config['fping_options']['retries'] = 3;
$config['fping_options']['timeout'] = 500;
$config['fping_options']['count'] = 3;
$config['fping_options']['millisec'] = 5;
```
fping configuration options, this includes setting the timeout and retry options.
@@ -215,6 +217,8 @@ Arrays of subnets to exclude in auto discovery mode.
#### Email configuration
> You can configure these options within the WebUI now, please avoid setting these options within config.php
```php
$config['email_backend'] = 'mail';
$config['email_from'] = NULL;
@@ -402,6 +406,7 @@ $config['syslog_purge'] = 30;
$config['eventlog_purge'] = 30;
$config['authlog_purge'] = 30;
$config['perf_times_purge'] = 30;
$config['device_perf_purge'] = 30;
```
This option will ensure data within LibreNMS over 1 month old is automatically purged. You can alter these individually,
values are in days.
@@ -416,10 +421,23 @@ This array can be used to filter out syslog messages that you don't want to be s
#### Virtualization
```php
$config['enable_libvirt'] = 0;
$config['enable_libvirt'] = 1;
$config['libvirt_protocols'] = array("qemu+ssh","xen+ssh");
```
Enable this to switch on support for libvirt along with `libvirt_protocols` to indicate how you connect to libvirt.
Enable this to switch on support for libvirt along with `libvirt_protocols`
to indicate how you connect to libvirt. You also need to:
1. Generate a non-password-protected ssh key for use by LibreNMS, as the
user which runs polling & discovery (usually `librenms`).
2. On each VM host you wish to monitor:
- Configure public key authentication from your LibreNMS server/poller by
adding the librenms public key to `~root/.ssh/authorized_keys`.
- (xen+ssh only) Enable libvirtd to gather data from xend by setting
`(xend-unix-server yes)` in `/etc/xen/xend-config.sxp` and
restarting xend and libvirtd.
To test your setup, run `virsh -c qemu+ssh://vmhost/system list` or
`virsh -c xen+ssh://vmhost list` as your librenms polling user.
#### BGP Support

View File

@@ -103,7 +103,8 @@ To go into a bit more detail, the following are usually needed:
**includes/definitions.inc.php**
Update this file to include the required definitions for the new OS.
**includes/discovery/os/ciscowlc.inc.php**
This file just sets the $os variable, done by checking the sysDescr snmp value for a particular value that matches the OS you are adding.
This file just sets the $os variable, done by checking the SNMP tree for a particular value that matches the OS you are adding. Typically, this will come from the presence of specific values in
sysObjectID or sysDescr, or the existence of a particular enterprise tree.
**includes/polling/os/ciscowlc.inc.php**
This file will usually set the variables for $version and $hardware gained from an snmp lookup.
**html/images/os/$os.png**

View File

@@ -70,6 +70,7 @@ $config['poller_modules']['aruba-controller'] = 1;
$config['poller_modules']['entity-physical'] = 1;
$config['poller_modules']['applications'] = 1;
$config['poller_modules']['cisco-asa-firewall'] = 1;
$config['poller_modules']['mib'] = 0;
```
#### Poller modules
@@ -112,7 +113,7 @@ $config['poller_modules']['cisco-asa-firewall'] = 1;
`ospf`: OSPF Support.
`cisco-ipsec-flow-monitor': IPSec statistics support.
`cisco-ipsec-flow-monitor`: IPSec statistics support.
`cisco-remote-access-monitor`: Cisco remote access support.
@@ -138,6 +139,8 @@ $config['poller_modules']['cisco-asa-firewall'] = 1;
`cisco-asa-firewall`: Cisco ASA firewall support.
`mib`: Support for generic MIB parsing.
#### Running
Here are some examples of running poller from within your install directory.
@@ -176,4 +179,4 @@ DB Updates
RRD Updates
SNMP Response
SNMP Response

View File

@@ -9,6 +9,7 @@ RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !\.(js|ico|txt|gif|jpg|png|css|php)
RewriteRule ^api/v0(.*)$ api_v0.php/$1 [L]
RewriteCond %{REQUEST_URI} !=/server-status
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !\.(js|ico|txt|gif|jpg|png|css|php)

99
html/form_new_config.php Normal file
View File

@@ -0,0 +1,99 @@
<?php
/*
* LibreNMS
*
* Copyright (c) 2014 Neil Lathwood <https://github.com/laf/ http://www.lathwood.co.uk/fa>
*
* 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. Please see LICENSE.txt at the top level of
* the source code distribution for details.
*/
enable_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/functions.php");
include_once("includes/authenticate.inc.php");
if (!$_SESSION['authenticated']) { echo("unauthenticated"); exit; }
$new_conf_type = $_POST['new_conf_type'];
$new_conf_name = $_POST['new_conf_name'];
$new_conf_desc = $_POST['new_conf_desc'];
if(empty($new_conf_name))
{
echo("You haven't specified a config name");
exit;
}
elseif(empty($new_conf_desc))
{
echo("You haven't specified a config description");
exit;
}
elseif(empty($_POST['new_conf_single_value']) && empty($_POST['new_conf_multi_value']))
{
echo("You haven't specified a config value");
exit;
}
$db_inserted = '0';
if($new_conf_type == 'Single')
{
$new_conf_type = 'single';
$new_conf_value = $_POST['new_conf_single_value'];
$db_inserted = add_config_item($new_conf_name,$new_conf_value,$new_conf_type,$new_conf_desc);
}
elseif($new_conf_type == 'Single Array')
{
$new_conf_type = 'single-array';
$new_conf_value = $_POST['new_conf_single_value'];
$db_inserted = add_config_item($new_conf_name,$new_conf_value,$new_conf_type,$new_conf_desc);
}
elseif($new_conf_type == 'Standard Array' || $new_conf_type == 'Multi Array')
{
if($new_conf_type == 'Standard Array')
{
$new_conf_type = 'array';
}
elseif($new_conf_type == 'Multi Array')
{
$new_conf_type = 'multi-array';
}
else
{
# $new_conf_type is invalid so clear values so we don't create any config
$new_conf_value = '';
}
$new_conf_value = nl2br($_POST['new_conf_multi_value']);
$values = explode('<br />',$new_conf_value);
foreach ($values as $item)
{
$new_conf_value = trim($item);
$db_inserted = add_config_item($new_conf_name,$new_conf_value,$new_conf_type,$new_conf_desc);
}
}
else
{
echo('Bad config type!');
$db_inserted = 0;
exit;
}
if($db_inserted == 1)
{
echo('Your new config item has been added');
}
else
{
echo('An error occurred adding your config item to the database');
}
?>

View File

@@ -20,12 +20,22 @@ if(!is_numeric($_POST['template_id'])) {
echo('ERROR: No template selected');
exit;
} else {
if(dbUpdate(array('rule_id' => mres($_POST['rule_id'])), 'alert_templates', '`id`=?', array($_POST['template_id'])) >= 0) {
echo('Alert rules have been attached to this template.');
exit;
} else {
echo('ERROR: Alert rules have not been attached to this template.');
exit;
$rules = preg_split("/,/",mres($_POST['rule_id']));
$success = FALSE;
foreach ($rules as $rule_id) {
$db_id = dbInsert(array('alert_rule_id' => $rule_id, 'alert_templates_id' => mres($_POST['template_id'])), 'alert_template_map');
if ($db_id > 0) {
$success = TRUE;
$ids[] = $db_id;
} else {
echo('ERROR: Alert rules have not been attached to this template.');
exit;
}
}
if ($success === TRUE) {
dbDelete('alert_template_map',"id NOT IN (".implode(',',$ids).")");
echo "Alert rules have been attached to this template. $template_map_ids";
exit;
}
}

View File

@@ -0,0 +1,48 @@
<?php
/*
* LibreNMS
*
* Copyright (c) 2014 Neil Lathwood <https://github.com/laf/ http://www.lathwood.co.uk>
*
* 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. Please see LICENSE.txt at the top level of
* the source code distribution for details.
*/
// FUA
if(!is_numeric($_POST['config_id']))
{
echo('error with data');
exit;
}
else
{
if($_POST['state'] == 'true')
{
$state = 1;
}
elseif($_POST['state'] == 'false')
{
$state = 0;
}
else
{
$state = 0;
}
$update = dbUpdate(array('config_disabled' => $state), 'config', '`config_id` = ?', array($_POST['config_id']));
if(!empty($update) || $update == '0')
{
echo('success');
exit;
}
else
{
echo('error');
exit;
}
}

View File

@@ -0,0 +1,37 @@
<?php
/*
* LibreNMS
*
* Copyright (c) 2014 Neil Lathwood <https://github.com/laf/ http://www.lathwood.co.uk>
*
* 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. Please see LICENSE.txt at the top level of
* the source code distribution for details.
*/
// FUA
if(!is_numeric($_POST['config_id']) || empty($_POST['data']))
{
echo('error with data');
exit;
}
else
{
$data = mres($_POST['data']);
$update = dbUpdate(array('config_value' => "$data"), 'config', '`config_id` = ?', array($_POST['config_id']));
if(!empty($update) || $update == '0')
{
echo('success');
exit;
}
else
{
echo('error');
exit;
}
}

View File

@@ -0,0 +1,132 @@
<?php
/*
* LibreNMS
*
* Copyright (c) 2014 Neil Lathwood <https://github.com/laf/ http://www.lathwood.co.uk/fa>
*
* 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. Please see LICENSE.txt at the top level of
* the source code distribution for details.
*/
if(is_admin() === false) {
$response = array('status'=>'error','message'=>'Need to be admin');
echo _json_encode($response);
exit;
}
$action = mres($_POST['action']);
$config_group = mres($_POST['config_group']);
$config_sub_group = mres($_POST['config_sub_group']);
$config_name = mres($_POST['config_name']);
$config_value = mres($_POST['config_value']);
$config_extra = mres($_POST['config_extra']);
$config_room_id = mres($_POST['config_room_id']);
$config_from = mres($_POST['config_from']);
$config_userkey = mres($_POST['config_userkey']);
$status = 'error';
$message = 'Error with config';
if ($action == 'remove' || $action == 'remove-slack' || $action == 'remove-hipchat' || $action == 'remove-pushover') {
$config_id = mres($_POST['config_id']);
if (empty($config_id)) {
$message = 'No config id passed';
} else {
if (dbDelete('config', '`config_id`=?', array($config_id))) {
if ($action == 'remove-slack') {
dbDelete('config', "`config_name` LIKE 'alert.transports.slack.$config_id.%'");
} elseif ($action == 'remove-hipchat') {
dbDelete('config', "`config_name` LIKE 'alert.transports.hipchat.$config_id.%'");
} elseif ($action == 'remove-pushover') {
dbDelete('config', "`config_name` LIKE 'alert.transports.pushover.$config_id.%'");
}
$status = 'ok';
$message = 'Config item removed';
} else {
$message = 'General error, could not remove config';
}
}
} elseif ($action == 'add-slack') {
if (empty($config_value)) {
$message = 'No Slack url provided';
} else {
$config_id = dbInsert(array('config_name' => 'alert.transports.slack.', 'config_value' => $config_value, 'config_group' => $config_group, 'config_sub_group' => $config_sub_group, 'config_default'=>$config_value, 'config_descr'=>'Slack Transport'), 'config');
if ($config_id > 0) {
dbUpdate(array('config_name' => 'alert.transports.slack.'.$config_id.'.url'), 'config', 'config_id=?', array($config_id));
$status = 'ok';
$message = 'Config item created';
$extras = explode('\n',$config_extra);
foreach ($extras as $option) {
list($k,$v) = explode("=", $option,2);
if (!empty($k) || !empty($v)) {
dbInsert(array('config_name' => 'alert.transports.slack.'.$config_id.'.'.$k, 'config_value' => $v, 'config_group' => $config_group, 'config_sub_group' => $config_sub_group, 'config_default'=>$v, 'config_descr'=>'Slack Transport'), 'config');
}
}
} else {
$message = 'Could not create config item';
}
}
} elseif ($action == 'add-hipchat') {
if (empty($config_value) || empty($config_room_id) || empty($config_from)) {
$message = 'No hipchat url, room id or from provided';
} else {
$config_id = dbInsert(array('config_name' => 'alert.transports.hipchat.', 'config_value' => $config_value, 'config_group' => $config_group, 'config_sub_group' => $config_sub_group, 'config_default'=>$config_value, 'config_descr'=>'Hipchat Transport'), 'config');
if ($config_id > 0) {
dbUpdate(array('config_name' => 'alert.transports.hipchat.'.$config_id.'.url'), 'config', 'config_id=?', array($config_id));
$additional_id['room_id'] = dbInsert(array('config_name' => 'alert.transports.hipchat.'.$config_id.'.room_id', 'config_value' => $config_room_id, 'config_group' => $config_group, 'config_sub_group' => $config_sub_group, 'config_default'=>$config_room_id, 'config_descr'=>'Hipchat URL'), 'config');
$additional_id['from'] = dbInsert(array('config_name' => 'alert.transports.hipchat.'.$config_id.'.from', 'config_value' => $config_from, 'config_group' => $config_group, 'config_sub_group' => $config_sub_group, 'config_default'=>$config_from, 'config_descr'=>'Hipchat From'), 'config');
$status = 'ok';
$message = 'Config item created';
$extras = explode('\n',$config_extra);
foreach ($extras as $option) {
list($k,$v) = explode("=", $option,2);
if (!empty($k) || !empty($v)) {
dbInsert(array('config_name' => 'alert.transports.hipchat.'.$config_id.'.'.$k, 'config_value' => $v, 'config_group' => $config_group, 'config_sub_group' => $config_sub_group, 'config_default'=>$v, 'config_descr'=>'Hipchat '.$v), 'config');
}
}
} else {
$message = 'Could not create config item';
}
}
} elseif ($action == 'add-pushover') {
if (empty($config_value) || empty($config_userkey)) {
$message = 'No pushover appkey or userkey provided';
} else {
$config_id = dbInsert(array('config_name' => 'alert.transports.pushover.', 'config_value' => $config_value, 'config_group' => $config_group, 'config_sub_group' => $config_sub_group, 'config_default'=>$config_value, 'config_descr'=>'Pushover Transport'), 'config');
if ($config_id > 0) {
dbUpdate(array('config_name' => 'alert.transports.pushover.'.$config_id.'.appkey'), 'config', 'config_id=?', array($config_id));
$additional_id['userkey'] = dbInsert(array('config_name' => 'alert.transports.pushover.'.$config_id.'.userkey', 'config_value' => $config_userkey, 'config_group' => $config_group, 'config_sub_group' => $config_sub_group, 'config_default'=>$config_userkey, 'config_descr'=>'Pushver Userkey'), 'config');
$status = 'ok';
$message = 'Config item created';
$extras = explode('\n',$config_extra);
foreach ($extras as $option) {
list($k,$v) = explode("=", $option,2);
if (!empty($k) || !empty($v)) {
dbInsert(array('config_name' => 'alert.transports.pushover.'.$config_id.'.'.$k, 'config_value' => $v, 'config_group' => $config_group, 'config_sub_group' => $config_sub_group, 'config_default'=>$v, 'config_descr'=>'Pushover '.$v), 'config');
}
}
} else {
$message = 'Could not create config item';
}
}
} else {
if (empty($config_group) || empty($config_sub_group) || empty($config_name) || empty($config_value)) {
$message = 'Missing config name or value';
} else {
$config_id = dbInsert(array('config_name' => $config_name, 'config_value' => $config_value, 'config_group' => $config_group, 'config_sub_group' => $config_sub_group, 'config_default'=>$config_value, 'config_descr'=>'API Transport'), 'config');
if ($config_id > 0) {
dbUpdate(array('config_name'=>$config_name.$config_id),'config','config_id=?',array($config_id));
$status = 'ok';
$message = 'Config item created';
} else {
$message = 'Could not create config item';
}
}
}
$response = array('status'=>$status,'message'=>$message, 'config_id'=>$config_id, 'additional_id'=>$additional_id);
echo _json_encode($response);

View File

@@ -22,6 +22,7 @@ $rule = rtrim($rule,'||');
$alert_id = $_POST['alert_id'];
$count = mres($_POST['count']);
$delay = mres($_POST['delay']);
$interval = mres($_POST['interval']);
$mute = mres($_POST['mute']);
$invert = mres($_POST['invert']);
$name = mres($_POST['name']);
@@ -34,6 +35,7 @@ if(empty($rule)) {
$count='-1';
}
$delay_sec = convert_delay($delay);
$interval_sec = convert_delay($interval);
if($mute == 'on') {
$mute = true;
} else {
@@ -44,7 +46,7 @@ if(empty($rule)) {
} else {
$invert = false;
}
$extra = array('mute'=>$mute,'count'=>$count,'delay'=>$delay_sec,'invert'=>$invert);
$extra = array('mute'=>$mute,'count'=>$count,'delay'=>$delay_sec,'invert'=>$invert,'interval'=>$interval_sec);
$extra_json = json_encode($extra);
if(is_numeric($alert_id) && $alert_id > 0) {
if(dbUpdate(array('rule' => $rule,'severity'=>mres($_POST['severity']),'extra'=>$extra_json,'name'=>$name), 'alert_rules', 'id=?',array($alert_id)) >= 0) {

View File

@@ -23,8 +23,6 @@ $desc = mres($_POST['desc']);
if( is_array($pattern) ) {
$pattern = implode(" ", $pattern);
$pattern = rtrim($pattern,'&&');
$pattern = rtrim($pattern,'||');
} elseif( !empty($_POST['pattern']) && !empty($_POST['condition']) && !empty($_POST['value']) ) {
$pattern = '%'.$_POST['pattern'].' '.$_POST['condition'].' ';
if( is_numeric($_POST['value']) ) {

View File

@@ -20,9 +20,13 @@ $group_id = $_POST['group_id'];
if(is_numeric($group_id) && $group_id > 0) {
$group = dbFetchRow("SELECT * FROM `device_groups` WHERE `id` = ? LIMIT 1",array($group_id));
$group_split = preg_split('/([a-zA-Z0-9_\-\.\=\%\<\>\ \"\'\!\~\(\)\*\/\@]+[&&\|\|]+)/',$group['pattern'], -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
$group_split = preg_split('/([a-zA-Z0-9_\-\.\=\%\<\>\ \"\'\!\~\(\)\*\/\@\[\]]+[&&\|\|]+)/',$group['pattern'], -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
$count = count($group_split) - 1;
$group_split[$count] = $group_split[$count].' &&';
if (preg_match("/\&\&$/",$group_split[$count]) == 1 || preg_match("/\|\|$/", $group_split[$count]) == 1) {
$group_split[$count] = $group_split[$count];
} else {
$group_split[$count] = $group_split[$count].' &&';
}
$output = array('name'=>$group['name'],'desc'=>$group['desc'],'pattern'=>$group_split);
echo _json_encode($output);
}

View File

@@ -19,8 +19,9 @@ if(is_admin() === false) {
$template_id = ($_POST['template_id']);
if(is_numeric($template_id) && $template_id > 0) {
$template = dbFetchCell("SELECT `rule_id` FROM `alert_templates` WHERE `id` = ? LIMIT 1",array($template_id));
$rule_id = split(",", $template);
$output = array('rule_id'=>$rule_id);
foreach (dbFetchRows("SELECT `alert_rule_id` FROM `alert_template_map` WHERE `alert_templates_id` = ?",array($template_id)) as $rule) {
$rules[] = $rule['alert_rule_id'];
}
$output = array('rule_id'=>$rules);
echo _json_encode($output);
}

View File

@@ -0,0 +1,69 @@
<?php
/*
* LibreNMS
*
* Copyright (c) 2014 Neil Lathwood <https://github.com/laf/ http://www.lathwood.co.uk/fa>
*
* 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. Please see LICENSE.txt at the top level of
* the source code distribution for details.
*/
if(is_admin() === false) {
die('ERROR: You need to be admin');
}
$config_id = mres($_POST['config_id']);
$action = mres($_POST['action']);
$config_type = mres($_POST['config_type']);
$status = 'error';
if (!is_numeric($config_id)) {
$message = 'ERROR: No alert selected';
} elseif ($action == 'update-textarea') {
$extras = explode(PHP_EOL,$_POST['config_value']);
foreach ($extras as $option) {
list($k,$v) = explode("=", $option,2);
if (!empty($k) || !empty($v)) {
if ($config_type == 'slack') {
$db_id[] = dbInsert(array('config_name' => 'alert.transports.slack.'.$config_id.'.'.$k, 'config_value' => $v, 'config_group' => 'alerting', 'config_sub_group' => 'transports', 'config_default'=>$v, 'config_descr'=>'Slack Transport'), 'config');
} elseif ($config_type == 'hipchat') {
$db_id[] = dbInsert(array('config_name' => 'alert.transports.hipchat.'.$config_id.'.'.$k, 'config_value' => $v, 'config_group' => 'alerting', 'config_sub_group' => 'transports', 'config_default'=>$v, 'config_descr'=>'Hipchat Transport'), 'config');
} elseif ($config_type == 'pushover') {
$db_id[] = dbInsert(array('config_name' => 'alert.transports.pushover.'.$config_id.'.'.$k, 'config_value' => $v, 'config_group' => 'alerting', 'config_sub_group' => 'transports', 'config_default'=>$v, 'config_descr'=>'Pushover Transport'), 'config');
}
}
}
$db_inserts = implode(",",$db_id);
if (!empty($db_inserts) || empty($_POST['config_value'])) {
if (empty($_POST['config_value'])) {
$db_inserts = 0;
}
if ($config_type == 'slack') {
dbDelete('config',"(`config_name` LIKE 'alert.transports.slack.$config_id.%' AND `config_name` != 'alert.transports.slack.$config_id.url' AND `config_id` NOT IN ($db_inserts))");
} elseif ($config_type == 'hipchat') {
dbDelete('config',"(`config_name` LIKE 'alert.transports.hipchat.$config_id.%' AND (`config_name` != 'alert.transports.hipchat.$config_id.url' AND `config_name` != 'alert.transports.hipchat.$config_id.room_id' AND `config_name` != 'alert.transports.hipchat.$config_id.from') AND `config_id` NOT IN ($db_inserts))");
} elseif ($config_type == 'pushover') {
dbDelete('config',"(`config_name` LIKE 'alert.transports.pushover.$config_id.%' AND (`config_name` != 'alert.transports.pushover.$config_id.appkey' AND `config_name` != 'alert.transports.pushover.$config_id.userkey') AND `config_id` NOT IN ($db_inserts))");
}
}
$message = 'Config item has been updated:';
$status = 'ok';
} else {
$state = mres($_POST['config_value']);
$update = dbUpdate(array('config_value' => $state), 'config', '`config_id`=?', array($config_id));
if(!empty($update) || $update == '0')
{
$message = 'Alert rule has been updated.';
$status = 'ok';
} else {
$message = 'ERROR: Alert rule has not been updated.';
}
}
$response = array('status'=>$status,'message'=>$message);
echo _json_encode($response);

BIN
html/images/icons/load.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 541 B

BIN
html/images/icons/state.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 537 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
html/images/os/meraki.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@@ -436,6 +436,7 @@ function get_graphs() {
$router = $app->router()->getCurrentRoute()->getParams();
$hostname = $router['hostname'];
// FIXME: this has some overlap with html/pages/device/graphs.inc.php
// use hostname as device_id if it's all digits
$device_id = ctype_digit($hostname) ? $hostname : getidbyname($hostname);
$graphs = array();
@@ -566,6 +567,10 @@ function add_edit_rule() {
if(empty($rule)) {
$message = 'Missing the alert rule';
}
$name = mres($data['name']);
if (empty($name)) {
$message = 'Missing the alert rule name';
}
$severity = mres($data['severity']);
$sevs = array("ok","warning","critical");
if(!in_array($severity, $sevs)) {
@@ -589,15 +594,19 @@ function add_edit_rule() {
$extra = array('mute'=>$mute,'count'=>$count,'delay'=>$delay_sec);
$extra_json = json_encode($extra);
if (dbFetchCell("SELECT `name` FROM `alert_rules` WHERE `name`=?",array($name)) == $name) {
$message = 'Name has already been used';
}
if(empty($message)) {
if(is_numeric($rule_id)) {
if( dbUpdate(array('rule' => $rule,'severity'=>$severity,'disabled'=>$disabled,'extra'=>$extra_json), 'alert_rules', 'id=?',array($rule_id)) >= 0) {
if( dbUpdate(array('name' => $name, 'rule' => $rule,'severity'=>$severity,'disabled'=>$disabled,'extra'=>$extra_json), 'alert_rules', 'id=?',array($rule_id)) >= 0) {
$status = 'ok';
$code = 200;
} else {
$message = 'Failed to update existing alert rule';
}
} elseif( dbInsert(array('device_id'=>$device_id,'rule'=>$rule,'severity'=>$severity,'disabled'=>$disabled,'extra'=>$extra_json),'alert_rules') ) {
} elseif( dbInsert(array('name' => $name, 'device_id'=>$device_id,'rule'=>$rule,'severity'=>$severity,'disabled'=>$disabled,'extra'=>$extra_json),'alert_rules') ) {
$status = 'ok';
$code = 200;
} else {

View File

@@ -1,53 +1,91 @@
<?php // vim:fenc=utf-8:filetype=php:ts=4
<?php
/**
* Configuration file for Collectd graph browser
*/
// Array of paths when collectd's rrdtool plugin writes RRDs
$config['datadirs'] = array($config['collectd_dir']);
$config['datadirs'] = array($config['collectd_dir']);
// Width of graph to be generated by rrdgraph
if(isset($_GET['width'])) {
$config['rrd_width'] = $_GET['width'];
} else {
$config['rrd_width'] = 270;
if (isset($_GET['width'])) {
$config['rrd_width'] = $_GET['width'];
}
else {
$config['rrd_width'] = 270;
}
// Height of graph to be generated by rrdgraph
if(isset($_GET['height'])) {
$config['rrd_height'] = $_GET['height'];
} else {
$config['rrd_height'] = 120;
if (isset($_GET['height'])) {
$config['rrd_height'] = $_GET['height'];
}
else {
$config['rrd_height'] = 120;
}
// List of supported timespans (used for period drop-down list)
$config['timespan'] = array(
array('name'=>'hour', 'label'=>'past hour', 'seconds'=>3600),
array('name'=>'day', 'label'=>'past day', 'seconds'=>86400),
array('name'=>'week', 'label'=>'past week', 'seconds'=>604800),
array('name'=>'month', 'label'=>'past month', 'seconds'=>2678400),
array('name'=>'year', 'label'=>'past year', 'seconds'=>31622400));
$config['timespan'] = array(
array(
'name' => 'hour',
'label' => 'past hour',
'seconds' => 3600,
),
array(
'name' => 'day',
'label' => 'past day',
'seconds' => 86400,
),
array(
'name' => 'week',
'label' => 'past week',
'seconds' => 604800,
),
array(
'name' => 'month',
'label' => 'past month',
'seconds' => 2678400,
),
array(
'name' => 'year',
'label' => 'past year',
'seconds' => 31622400,
),
);
// Interval at which values are collectd (currently ignored)
$config['rrd_interval'] = 10;
$config['rrd_interval'] = 10;
// Average rows/rra (currently ignored)
$config['rrd_rows'] = 2400;
$config['rrd_rows'] = 2400;
// Additional options to pass to rrdgraph
#$config['rrd_opts'] = (isset($config['rrdgraph_defaults']) ? $config['rrdgraph_defaults'] : '');
#$config['rrd_opts'] = array('-E', "-c", "SHADEA#a5a5a5", "-c", "SHADEB#a5a5a5", "-c", "FONT#000000", "-c", "CANVAS#FFFFFF", "-c", "GRID#aaaaaa",
# "-c", "MGRID#FFAAAA", "-c", "FRAME#3e3e3e", "-c", "ARROW#5e5e5e", "-R", "normal");
// $config['rrd_opts'] = (isset($config['rrdgraph_defaults']) ? $config['rrdgraph_defaults'] : '');
// $config['rrd_opts'] = array('-E', "-c", "SHADEA#a5a5a5", "-c", "SHADEB#a5a5a5", "-c", "FONT#000000", "-c", "CANVAS#FFFFFF", "-c", "GRID#aaaaaa",
// "-c", "MGRID#FFAAAA", "-c", "FRAME#3e3e3e", "-c", "ARROW#5e5e5e", "-R", "normal");
// Predefined set of colors for use by collectd_draw_rrd()
$config['rrd_colors'] = array(
'h_1'=>'F7B7B7', 'f_1'=>'FF0000', // Red
'h_2'=>'B7EFB7', 'f_2'=>'00E000', // Green
'h_3'=>'B7B7F7', 'f_3'=>'0000FF', // Blue
'h_4'=>'F3DFB7', 'f_4'=>'F0A000', // Yellow
'h_5'=>'B7DFF7', 'f_5'=>'00A0FF', // Cyan
'h_6'=>'DFB7F7', 'f_6'=>'A000FF', // Magenta
'h_7'=>'FFC782', 'f_7'=>'FF8C00', // Orange
'h_8'=>'DCFF96', 'f_8'=>'AAFF00', // Lime
'h_9'=>'83FFCD', 'f_9'=>'00FF99',
'h_10'=>'81D9FF', 'f_10'=>'00B2FF',
'h_11'=>'FF89F5', 'f_11'=>'FF00EA',
'h_12'=>'FF89AE', 'f_12'=>'FF0051',
'h_13'=>'BBBBBB', 'f_13'=>'555555',
);
$config['rrd_colors'] = array(
'h_1' => 'F7B7B7',
'f_1' => 'FF0000', // Red
'h_2' => 'B7EFB7',
'f_2' => '00E000', // Green
'h_3' => 'B7B7F7',
'f_3' => '0000FF', // Blue
'h_4' => 'F3DFB7',
'f_4' => 'F0A000', // Yellow
'h_5' => 'B7DFF7',
'f_5' => '00A0FF', // Cyan
'h_6' => 'DFB7F7',
'f_6' => 'A000FF', // Magenta
'h_7' => 'FFC782',
'f_7' => 'FF8C00', // Orange
'h_8' => 'DCFF96',
'f_8' => 'AAFF00', // Lime
'h_9' => '83FFCD',
'f_9' => '00FF99',
'h_10' => '81D9FF',
'f_10' => '00B2FF',
'h_11' => 'FF89F5',
'f_11' => 'FF00EA',
'h_12' => 'FF89AE',
'f_12' => 'FF0051',
'h_13' => 'BBBBBB',
'f_13' => '555555',
);
/*
* URL to collectd's unix socket (unixsock plugin)
* enabled: 'unix:///var/run/collectd/collectd-unixsock'
@@ -58,11 +96,9 @@ $config['collectd_sock'] = null;
* Path to TTF font file to use in error images
* (fallback when file does not exist is GD fixed font)
*/
$config['error_font'] = '/usr/share/fonts/corefonts/arial.ttf';
$config['error_font'] = '/usr/share/fonts/corefonts/arial.ttf';
/*
* Constant defining full path to rrdtool
*/
define('RRDTOOL', $config['rrdtool']);
?>

View File

@@ -47,9 +47,9 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) {
$GraphDefs = array();
$GraphDefs['apache_bytes'] = array(
'DEF:min_raw={file}:count:MIN',
'DEF:avg_raw={file}:count:AVERAGE',
'DEF:max_raw={file}:count:MAX',
'DEF:min_raw={file}:value:MIN',
'DEF:avg_raw={file}:value:AVERAGE',
'DEF:max_raw={file}:value:MAX',
'CDEF:min=min_raw,8,*',
'CDEF:avg=avg_raw,8,*',
'CDEF:max=max_raw,8,*',
@@ -67,9 +67,9 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) {
'GPRINT:min:MIN:%5.1lf%s\l',
'GPRINT:avg_sum:LAST: (ca. %5.1lf%sB Total)');
$GraphDefs['apache_requests'] = array(
'DEF:min={file}:count:MIN',
'DEF:avg={file}:count:AVERAGE',
'DEF:max={file}:count:MAX',
'DEF:min={file}:value:MIN',
'DEF:avg={file}:value:AVERAGE',
'DEF:max={file}:value:MAX',
'COMMENT: Cur Avg Min Max\l',
"AREA:max#$HalfBlue",
"AREA:min#$Canvas",
@@ -79,9 +79,9 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) {
'GPRINT:min:MIN:%5.2lf%s',
'GPRINT:max:MAX:%5.2lf%s\l');
$GraphDefs['apache_scoreboard'] = array(
'DEF:min={file}:count:MIN',
'DEF:avg={file}:count:AVERAGE',
'DEF:max={file}:count:MAX',
'DEF:min={file}:value:MIN',
'DEF:avg={file}:value:AVERAGE',
'DEF:max={file}:value:MAX',
'COMMENT: Cur Min Ave Max\l',
"AREA:max#$HalfBlue",
"AREA:min#$Canvas",
@@ -397,9 +397,9 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) {
'GPRINT:avg:LAST:%4.1lf\l');
$GraphDefs['entropy'] = array(
#'-v', 'Bits',
'DEF:avg={file}:entropy:AVERAGE',
'DEF:min={file}:entropy:MIN',
'DEF:max={file}:entropy:MAX',
'DEF:avg={file}:value:AVERAGE',
'DEF:min={file}:value:MIN',
'DEF:max={file}:value:MAX',
'COMMENT: Min Avg Max Cur\l',
"AREA:max#$HalfBlue",
"AREA:min#$Canvas",
@@ -422,9 +422,9 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) {
'GPRINT:avg:LAST:%4.1lf\l');
$GraphDefs['frequency'] = array(
#'-v', 'Hertz',
'DEF:avg={file}:frequency:AVERAGE',
'DEF:min={file}:frequency:MIN',
'DEF:max={file}:frequency:MAX',
'DEF:avg={file}:value:AVERAGE',
'DEF:min={file}:value:MIN',
'DEF:max={file}:value:MAX',
"AREA:max#b5b5b5",
"AREA:min#$Canvas",
"LINE1:avg#$FullBlue:Frequency [Hz]",
@@ -2043,7 +2043,7 @@ function meta_graph_apache_scoreboard($host, $plugin, $plugin_instance, $type, $
if ($file == '')
continue;
$sources[] = array('name'=>$inst, 'file'=>$file, 'ds'=>'count');
$sources[] = array('name'=>$inst, 'file'=>$file, 'ds'=>'value');
}
return collectd_draw_meta_stack($opts, $sources);

View File

@@ -2,6 +2,7 @@
/*
* LibreNMS front page graphs
*
* Author: Paul Gear
* Copyright (c) 2013 Gear Consulting Pty Ltd <http://libertysys.com.au/>
*
* This program is free software: you can redistribute it and/or modify it

View File

@@ -3,6 +3,7 @@
* LibreNMS front page top devices graph
* - Find most utilised devices that have been polled in the last N minutes
*
* Author: Paul Gear
* Copyright (c) 2013 Gear Consulting Pty Ltd <http://libertysys.com.au/>
*
* This program is free software: you can redistribute it and/or modify it

View File

@@ -3,6 +3,7 @@
* LibreNMS front page top ports graph
* - Find most utilised ports that have been polled in the last N minutes
*
* Author: Paul Gear
* Copyright (c) 2013 Gear Consulting Pty Ltd <http://libertysys.com.au/>
*
* This program is free software: you can redistribute it and/or modify it

View File

@@ -69,7 +69,7 @@ function generate_url($vars, $new_vars = array())
{
if ($value == "0" || $value != "" && strstr($var, "opt") === FALSE && is_numeric($var) === FALSE)
{
$url .= $var ."=".$value."/";
$url .= $var ."=".urlencode($value)."/";
}
}
@@ -339,7 +339,7 @@ function generate_graph_tag($args)
$urlargs = array();
foreach ($args as $key => $arg)
{
$urlargs[] = $key."=".$arg;
$urlargs[] = $key."=".urlencode($arg);
}
return '<img src="graph.php?' . implode('&amp;',$urlargs).'" border="0" />';
@@ -763,8 +763,8 @@ function get_client_ip() {
function shorten_interface_type($string) {
return str_ireplace(
array('FastEthernet','GigbitEthernet','TenGigabitEthernet','Port-Channel','Ethernet'),
array('Fa','Gi','Te','Po','Eth'),
array('FastEthernet','TenGigabitEthernet','GigabitEthernet','Port-Channel','Ethernet'),
array('Fa','Te','Gi','Po','Eth'),
$string
);
}
@@ -774,7 +774,65 @@ function clean_bootgrid($string) {
$output = str_replace(array("\r","\n"), "", $string);
$output = addslashes($output);
return $output;
}
//Insert new config items
function add_config_item($new_conf_name,$new_conf_value,$new_conf_type,$new_conf_desc) {
if (dbInsert(array('config_name' => $new_conf_name, 'config_value' => $new_conf_value, 'config_default' => $new_conf_value, 'config_type' => $new_conf_type, 'config_desc' => $new_conf_desc, 'config_group' => '500_Custom Settings', 'config_sub_group' => '01_Custom settings', 'config_hidden' => '0', 'config_disabled' => '0'), 'config')) {
$db_inserted = 1;
} else {
$db_inserted = 0;
}
return($db_inserted);
}
function get_config_by_group($group) {
$group = array($group);
$items = array();
foreach (dbFetchRows("SELECT * FROM `config` WHERE `config_group` = '?'", array($group)) as $config_item) {
$val = $config_item['config_value'];
if (filter_var($val,FILTER_VALIDATE_INT)) {
$val = (int) $val;
} elseif (filter_var($val,FILTER_VALIDATE_FLOAT)) {
$val = (float) $val;
} elseif (filter_var($val,FILTER_VALIDATE_BOOLEAN)) {
$val =(boolean) $val;
}
if ($val === TRUE) {
$config_item += array('config_checked'=>'checked');
}
$items[$config_item['config_name']] = $config_item;
}
return $items;
}
function get_config_like_name($name) {
$name = array($name);
$items = array();
foreach (dbFetchRows("SELECT * FROM `config` WHERE `config_name` LIKE '%?%'", array($name)) as $config_item) {
$items[$config_item['config_name']] = $config_item;
}
return $items;
}
function get_config_by_name($name) {
$config_item = dbFetchRow("SELECT * FROM `config` WHERE `config_name` = ?", array($name));
return $config_item;
}
function set_config_name($name,$config_value) {
return dbUpdate(array('config_value' => $config_value), 'config', '`config_name`=?', array($name));
}
function get_url() {
// http://stackoverflow.com/questions/2820723/how-to-get-base-url-with-php
// http://stackoverflow.com/users/184600/ma%C4%8Dek
return sprintf(
"%s://%s%s",
isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https' : 'http',
$_SERVER['SERVER_NAME'],
$_SERVER['REQUEST_URI']
);
}
function alert_details($details) {

View File

@@ -1,12 +1,12 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$device = device_by_id_cache($id);
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/mem.rrd";
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/mem.rrd';
$rrd_options .= " -b 1024";
$rrd_options .= ' -b 1024';
$rrd_options .= " DEF:atotalswap=$rrd_filename:totalswap:AVERAGE";
$rrd_options .= " DEF:aavailswap=$rrd_filename:availswap:AVERAGE";
@@ -16,51 +16,49 @@ $rrd_options .= " DEF:atotalfree=$rrd_filename:totalfree:AVERAGE";
$rrd_options .= " DEF:ashared=$rrd_filename:shared:AVERAGE";
$rrd_options .= " DEF:abuffered=$rrd_filename:buffered:AVERAGE";
$rrd_options .= " DEF:acached=$rrd_filename:cached:AVERAGE";
$rrd_options .= " CDEF:totalswap=atotalswap,1024,*";
$rrd_options .= " CDEF:availswap=aavailswap,1024,*";
$rrd_options .= " CDEF:totalreal=atotalreal,1024,*";
$rrd_options .= " CDEF:availreal=aavailreal,1024,*";
$rrd_options .= " CDEF:totalfree=atotalfree,1024,*";
$rrd_options .= " CDEF:shared=ashared,1024,*";
$rrd_options .= " CDEF:buffered=abuffered,1024,*";
$rrd_options .= " CDEF:cached=acached,1024,*";
$rrd_options .= " CDEF:usedreal=totalreal,availreal,-";
$rrd_options .= " CDEF:usedswap=totalswap,availswap,-";
$rrd_options .= " CDEF:cusedswap=usedswap,-1,*";
$rrd_options .= " CDEF:cdeftot=availreal,shared,buffered,usedreal,cached,usedswap,+,+,+,+,+";
$rrd_options .= ' CDEF:totalswap=atotalswap,1024,*';
$rrd_options .= ' CDEF:availswap=aavailswap,1024,*';
$rrd_options .= ' CDEF:totalreal=atotalreal,1024,*';
$rrd_options .= ' CDEF:availreal=aavailreal,1024,*';
$rrd_options .= ' CDEF:totalfree=atotalfree,1024,*';
$rrd_options .= ' CDEF:shared=ashared,1024,*';
$rrd_options .= ' CDEF:buffered=abuffered,1024,*';
$rrd_options .= ' CDEF:cached=acached,1024,*';
$rrd_options .= ' CDEF:usedreal=totalreal,availreal,-';
$rrd_options .= ' CDEF:usedswap=totalswap,availswap,-';
$rrd_options .= ' CDEF:cusedswap=usedswap,-1,*';
$rrd_options .= ' CDEF:cdeftot=availreal,shared,buffered,usedreal,cached,usedswap,+,+,+,+,+';
$rrd_options .= " COMMENT:'Bytes Current Average Maximum\\n'";
$rrd_options .= " LINE1:usedreal#d0b080:";
$rrd_options .= " AREA:usedreal#f0e0a0:used";
$rrd_options .= " GPRINT:usedreal:LAST:\ \ \ %7.2lf%sB";
$rrd_options .= " GPRINT:usedreal:AVERAGE:%7.2lf%sB";
$rrd_options .= ' LINE1:usedreal#d0b080:';
$rrd_options .= ' AREA:usedreal#f0e0a0:used';
$rrd_options .= ' GPRINT:usedreal:LAST:\ \ \ %7.2lf%sB';
$rrd_options .= ' GPRINT:usedreal:AVERAGE:%7.2lf%sB';
$rrd_options .= " GPRINT:usedreal:MAX:%7.2lf%sB\\\\n";
$rrd_options .= " STACK:availreal#e5e5e5:free";
$rrd_options .= " GPRINT:availreal:LAST:\ \ \ %7.2lf%sB";
$rrd_options .= " GPRINT:availreal:AVERAGE:%7.2lf%sB";
$rrd_options .= ' STACK:availreal#e5e5e5:free';
$rrd_options .= ' GPRINT:availreal:LAST:\ \ \ %7.2lf%sB';
$rrd_options .= ' GPRINT:availreal:AVERAGE:%7.2lf%sB';
$rrd_options .= " GPRINT:availreal:MAX:%7.2lf%sB\\\\n";
$rrd_options .= " LINE1:usedreal#d0b080:";
$rrd_options .= " AREA:shared#afeced::";
$rrd_options .= " AREA:buffered#cc0000::STACK";
$rrd_options .= " AREA:cached#ffaa66::STACK";
$rrd_options .= " LINE1.25:shared#008fea:shared";
$rrd_options .= " GPRINT:shared:LAST:\ %7.2lf%sB";
$rrd_options .= " GPRINT:shared:AVERAGE:%7.2lf%sB";
$rrd_options .= ' LINE1:usedreal#d0b080:';
$rrd_options .= ' AREA:shared#afeced::';
$rrd_options .= ' AREA:buffered#cc0000::STACK';
$rrd_options .= ' AREA:cached#ffaa66::STACK';
$rrd_options .= ' LINE1.25:shared#008fea:shared';
$rrd_options .= ' GPRINT:shared:LAST:\ %7.2lf%sB';
$rrd_options .= ' GPRINT:shared:AVERAGE:%7.2lf%sB';
$rrd_options .= " GPRINT:shared:MAX:%7.2lf%sB\\\\n";
$rrd_options .= " LINE1.25:buffered#ff1a00:buffers:STACK";
$rrd_options .= " GPRINT:buffered:LAST:%7.2lf%sB";
$rrd_options .= " GPRINT:buffered:AVERAGE:%7.2lf%sB";
$rrd_options .= ' LINE1.25:buffered#ff1a00:buffers:STACK';
$rrd_options .= ' GPRINT:buffered:LAST:%7.2lf%sB';
$rrd_options .= ' GPRINT:buffered:AVERAGE:%7.2lf%sB';
$rrd_options .= " GPRINT:buffered:MAX:%7.2lf%sB\\\\n";
$rrd_options .= " LINE1.25:cached#ea8f00:cached:STACK";
$rrd_options .= " GPRINT:cached:LAST:\ %7.2lf%sB";
$rrd_options .= " GPRINT:cached:AVERAGE:%7.2lf%sB";
$rrd_options .= ' LINE1.25:cached#ea8f00:cached:STACK';
$rrd_options .= ' GPRINT:cached:LAST:\ %7.2lf%sB';
$rrd_options .= ' GPRINT:cached:AVERAGE:%7.2lf%sB';
$rrd_options .= " GPRINT:cached:MAX:%7.2lf%sB\\\\n";
$rrd_options .= " LINE1:totalreal#050505:";
$rrd_options .= " AREA:cusedswap#C3D9FF:swap";
$rrd_options .= " LINE1.25:cusedswap#356AA0:";
$rrd_options .= " GPRINT:usedswap:LAST:\ \ \ %7.2lf%sB";
$rrd_options .= " GPRINT:usedswap:AVERAGE:%7.2lf%sB";
$rrd_options .= ' LINE1:totalreal#050505:';
$rrd_options .= ' AREA:cusedswap#C3D9FF:swap';
$rrd_options .= ' LINE1.25:cusedswap#356AA0:';
$rrd_options .= ' GPRINT:usedswap:LAST:\ \ \ %7.2lf%sB';
$rrd_options .= ' GPRINT:usedswap:AVERAGE:%7.2lf%sB';
$rrd_options .= " GPRINT:usedswap:MAX:%7.2lf%sB\\\\n";
$rrd_options .= " LINE1:totalreal#050505:total";
$rrd_options .= " GPRINT:totalreal:AVERAGE:\ \ %7.2lf%sB";
?>
$rrd_options .= ' LINE1:totalreal#050505:total';
$rrd_options .= ' GPRINT:totalreal:AVERAGE:\ \ %7.2lf%sB';

View File

@@ -1,17 +1,13 @@
<?php
if (is_numeric($vars['id']))
{
$ap = accesspoint_by_id($vars['id']);
if (is_numeric($vars['id'])) {
$ap = accesspoint_by_id($vars['id']);
if (is_numeric($ap['device_id']) && ($auth || device_permitted($ap['device_id'])))
{
$device = device_by_id_cache($ap['device_id']);
if (is_numeric($ap['device_id']) && ($auth || device_permitted($ap['device_id']))) {
$device = device_by_id_cache($ap['device_id']);
$title = generate_device_link($device);
$title .= " :: AP :: " . htmlentities($ap['name']);
$auth = TRUE;
}
$title = generate_device_link($device);
$title .= ' :: AP :: '.htmlentities($ap['name']);
$auth = true;
}
}
?>

View File

@@ -1,6 +1,7 @@
<?php
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] ."/". safename("arubaap-$ap[name].$ap[radio_number].rrd");
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] ."/".
safename("arubaap-$ap[name].$ap[radio_number].rrd");
$rrd_list[0]['filename'] = $rrd_filename;
$rrd_list[0]['descr'] = "Channel";

View File

@@ -1,25 +1,21 @@
<?php
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] ."/".
safename("arubaap-$ap[name].$ap[radio_number].rrd");
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/'.safename("arubaap-$ap[name].$ap[radio_number].rrd");
$rrd_list[0]['filename'] = $rrd_filename;
$rrd_list[0]['descr'] = "Interference";
$rrd_list[0]['ds'] = "interference";
$rrd_list[0]['descr'] = 'Interference';
$rrd_list[0]['ds'] = 'interference';
$unit_text = "Int";
$unit_text = 'Int';
$units='';
$total_units='';
$colours='mixed';
$units = '';
$total_units = '';
$colours = 'mixed';
$scale_min = "0";
$scale_min = '0';
$nototal = 1;
if ($rrd_list)
{
include("includes/graphs/generic_multi_line.inc.php");
if ($rrd_list) {
include 'includes/graphs/generic_multi_line.inc.php';
}
?>

View File

@@ -1,25 +1,21 @@
<?php
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] ."/".
safename("arubaap-$ap[name].$ap[radio_number].rrd");
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/'.safename("arubaap-$ap[name].$ap[radio_number].rrd");
$rrd_list[0]['filename'] = $rrd_filename;
$rrd_list[0]['descr'] = "Num Clients";
$rrd_list[0]['ds'] = "numasoclients";
$rrd_list[0]['descr'] = 'Num Clients';
$rrd_list[0]['ds'] = 'numasoclients';
$unit_text = "Clients";
$unit_text = 'Clients';
$units='';
$total_units='';
$colours='mixed';
$units = '';
$total_units = '';
$colours = 'mixed';
$scale_min = "0";
$scale_min = '0';
$nototal = 1;
if ($rrd_list)
{
include("includes/graphs/generic_multi_line.inc.php");
if ($rrd_list) {
include 'includes/graphs/generic_multi_line.inc.php';
}
?>

View File

@@ -1,26 +1,21 @@
<?php
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] ."/".
safename("arubaap-$ap[name].$ap[radio_number].rrd");
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/'.safename("arubaap-$ap[name].$ap[radio_number].rrd");
$rrd_list[0]['filename'] = $rrd_filename;
$rrd_list[0]['descr'] = "MonBSSIDs";
$rrd_list[0]['ds'] = "nummonbssid";
$rrd_list[0]['descr'] = 'MonBSSIDs';
$rrd_list[0]['ds'] = 'nummonbssid';
$unit_text = "BSSIDs";
$unit_text = 'BSSIDs';
$units='';
$total_units='';
$colours='mixed';
$units = '';
$total_units = '';
$colours = 'mixed';
$scale_min = "0";
$scale_min = '0';
$nototal = 1;
if ($rrd_list)
{
include("includes/graphs/generic_multi_line.inc.php");
if ($rrd_list) {
include 'includes/graphs/generic_multi_line.inc.php';
}
?>

View File

@@ -1,25 +1,21 @@
<?php
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] ."/".
safename("arubaap-$ap[name].$ap[radio_number].rrd");
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/'.safename("arubaap-$ap[name].$ap[radio_number].rrd");
$rrd_list[0]['filename'] = $rrd_filename;
$rrd_list[0]['descr'] = "Mon Clients";
$rrd_list[0]['ds'] = "nummonclients";
$rrd_list[0]['descr'] = 'Mon Clients';
$rrd_list[0]['ds'] = 'nummonclients';
$unit_text = "Clients";
$unit_text = 'Clients';
$units='';
$total_units='';
$colours='mixed';
$units = '';
$total_units = '';
$colours = 'mixed';
$scale_min = "0";
$scale_min = '0';
$nototal = 1;
if ($rrd_list)
{
include("includes/graphs/generic_multi_line.inc.php");
if ($rrd_list) {
include 'includes/graphs/generic_multi_line.inc.php';
}
?>

View File

@@ -1,25 +1,21 @@
<?php
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] ."/".
safename("arubaap-$ap[name].$ap[radio_number].rrd");
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/'.safename("arubaap-$ap[name].$ap[radio_number].rrd");
$rrd_list[0]['filename'] = $rrd_filename;
$rrd_list[0]['descr'] = "radioutil";
$rrd_list[0]['ds'] = "radioutil";
$rrd_list[0]['descr'] = 'radioutil';
$rrd_list[0]['ds'] = 'radioutil';
$unit_text = "Percent";
$unit_text = 'Percent';
$units='';
$total_units='';
$colours='mixed';
$units = '';
$total_units = '';
$colours = 'mixed';
$scale_min = "0";
$scale_min = '0';
$nototal = 1;
if ($rrd_list)
{
include("includes/graphs/generic_multi_line.inc.php");
if ($rrd_list) {
include 'includes/graphs/generic_multi_line.inc.php';
}
?>

View File

@@ -1,26 +1,21 @@
<?php
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] ."/".
safename("arubaap-$ap[name].$ap[radio_number].rrd");
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/'.safename("arubaap-$ap[name].$ap[radio_number].rrd");
$rrd_list[0]['filename'] = $rrd_filename;
$rrd_list[0]['descr'] = "txpow";
$rrd_list[0]['ds'] = "txpow";
$rrd_list[0]['descr'] = 'txpow';
$rrd_list[0]['ds'] = 'txpow';
$unit_text = "dBm";
$unit_text = 'dBm';
$units='';
$total_units='';
$colours='mixed';
$units = '';
$total_units = '';
$colours = 'mixed';
$scale_min = "0";
$scale_min = '0';
$nototal = 1;
if ($rrd_list)
{
include("includes/graphs/generic_multi_line.inc.php");
if ($rrd_list) {
include 'includes/graphs/generic_multi_line.inc.php';
}
?>

View File

@@ -1,33 +1,31 @@
<?php
$scale_min = "0";
$scale_min = '0';
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$device = device_by_id_cache($id);
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/altiga-ssl.rrd.rrd";
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/altiga-ssl.rrd.rrd';
$rrd_options .= " DEF:TotalSessions=$rrd_filename:TotalSessions:AVERAGE";
$rrd_options .= " DEF:ActiveSessions=$rrd_filename:ActiveSessions:AVERAGE";
$rrd_options .= " DEF:MaxSessions=$rrd_filename:MaxSessions:AVERAGE";
$rrd_options .= " CDEF:a=1min,100,/";
$rrd_options .= " CDEF:b=5min,100,/";
$rrd_options .= " CDEF:c=15min,100,/";
$rrd_options .= " CDEF:cdefd=a,b,c,+,+";
$rrd_options .= ' CDEF:a=1min,100,/';
$rrd_options .= ' CDEF:b=5min,100,/';
$rrd_options .= ' CDEF:c=15min,100,/';
$rrd_options .= ' CDEF:cdefd=a,b,c,+,+';
$rrd_options .= " COMMENT:Load\ Average\ \ Current\ \ \ \ Average\ \ \ \ Maximum\\\\n";
$rrd_options .= " AREA:a#ffeeaa:1\ Min:";
$rrd_options .= " LINE1:a#c5aa00:";
$rrd_options .= " GPRINT:a:LAST:\ \ \ \ %7.2lf";
$rrd_options .= " GPRINT:a:AVERAGE:\ \ %7.2lf";
$rrd_options .= ' AREA:a#ffeeaa:1\ Min:';
$rrd_options .= ' LINE1:a#c5aa00:';
$rrd_options .= ' GPRINT:a:LAST:\ \ \ \ %7.2lf';
$rrd_options .= ' GPRINT:a:AVERAGE:\ \ %7.2lf';
$rrd_options .= " GPRINT:a:MAX:\ \ %7.2lf\\\\n";
$rrd_options .= " LINE1.25:b#ea8f00:5\ Min:";
$rrd_options .= " GPRINT:b:LAST:\ \ \ \ %7.2lf";
$rrd_options .= " GPRINT:b:AVERAGE:\ \ %7.2lf";
$rrd_options .= ' LINE1.25:b#ea8f00:5\ Min:';
$rrd_options .= ' GPRINT:b:LAST:\ \ \ \ %7.2lf';
$rrd_options .= ' GPRINT:b:AVERAGE:\ \ %7.2lf';
$rrd_options .= " GPRINT:b:MAX:\ \ %7.2lf\\\\n";
$rrd_options .= " LINE1.25:c#cc0000:15\ Min";
$rrd_options .= " GPRINT:c:LAST:\ \ \ %7.2lf";
$rrd_options .= " GPRINT:c:AVERAGE:\ \ %7.2lf";
$rrd_options .= ' LINE1.25:c#cc0000:15\ Min';
$rrd_options .= ' GPRINT:c:LAST:\ \ \ %7.2lf';
$rrd_options .= ' GPRINT:c:AVERAGE:\ \ %7.2lf';
$rrd_options .= " GPRINT:c:MAX:\ \ %7.2lf\\\\n";
?>

View File

@@ -1,12 +1,9 @@
<?php
if (is_numeric($vars['id']) && ($auth || application_permitted($vars['id'])))
{
$app = get_application_by_id($vars['id']);
$device = device_by_id_cache($app['device_id']);
$title = generate_device_link($device);
$title .= $graph_subtype;
$auth = TRUE;
if (is_numeric($vars['id']) && ($auth || application_permitted($vars['id']))) {
$app = get_application_by_id($vars['id']);
$device = device_by_id_cache($app['device_id']);
$title = generate_device_link($device);
$title .= $graph_subtype;
$auth = true;
}
?>

View File

@@ -1,37 +1,37 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-drbd-".$app['app_instance'].".rrd";
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-drbd-'.$app['app_instance'].'.rrd';
$array = array(
'lo' => 'Local I/O',
'pe' => 'Pending',
'ua' => 'UnAcked',
'ap' => 'App Pending',
);
'lo' => 'Local I/O',
'pe' => 'Pending',
'ua' => 'UnAcked',
'ap' => 'App Pending',
);
$i = 0;
if (is_file($rrd_filename))
{
foreach ($array as $ds => $vars)
{
$rrd_list[$i]['filename'] = $rrd_filename;
if (is_array($vars))
{
$rrd_list[$i]['descr'] = $vars['descr'];
} else {
$rrd_list[$i]['descr'] = $vars;
if (is_file($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
if (is_array($vars)) {
$rrd_list[$i]['descr'] = $vars['descr'];
}
else {
$rrd_list[$i]['descr'] = $vars;
}
$rrd_list[$i]['ds'] = $ds;
$i++;
}
$rrd_list[$i]['ds'] = $ds;
$i++;
}
} else { echo("file missing: $file"); }
}
else {
echo "file missing: $file";
}
$colours = "mixed";
$colours = 'mixed';
$nototal = 0;
$unit_text = "";
$unit_text = '';
include("includes/graphs/generic_multi_simplex_seperated.inc.php");
?>
require 'includes/graphs/generic_multi_simplex_seperated.inc.php';

View File

@@ -1,36 +1,32 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$scale_min = 0;
$colours = "mixed";
$colours = 'mixed';
$nototal = (($width < 550) ? 1 : 0);
$unit_text = "Messages/sec";
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-mailscannerV2-" . $app['app_id'] . ".rrd";
$unit_text = 'Messages/sec';
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-mailscannerV2-'.$app['app_id'].'.rrd';
$array = array(
'msg_rejected' => array('descr' => 'Rejected'),
'msg_relay' => array('descr' => 'Relayed'),
'msg_waiting' => array('descr' => 'Waiting'),
);
'msg_rejected' => array('descr' => 'Rejected'),
'msg_relay' => array('descr' => 'Relayed'),
'msg_waiting' => array('descr' => 'Waiting'),
);
$i = 0;
$x = 0;
$i = 0;
$x = 0;
if (is_file($rrd_filename))
{
$max_colours = count($config['graph_colours'][$colours]);
foreach ($array as $ds => $vars)
{
$x = (($x<=$max_colours) ? $x : 0);
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
$rrd_list[$i]['ds'] = $ds;
$rrd_list[$i]['colour'] = $config['graph_colours'][$colours][$x];
$i++;
$x++;
}
if (is_file($rrd_filename)) {
$max_colours = count($config['graph_colours'][$colours]);
foreach ($array as $ds => $vars) {
$x = (($x <= $max_colours) ? $x : 0);
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
$rrd_list[$i]['ds'] = $ds;
$rrd_list[$i]['colour'] = $config['graph_colours'][$colours][$x];
$i++;
$x++;
}
}
include("includes/graphs/generic_multi_line.inc.php");
?>
require 'includes/graphs/generic_multi_line.inc.php';

View File

@@ -1,27 +1,24 @@
<?php
$nototal = 1;
$nototal = 1;
$ds_in = "msg_recv";
$ds_out = "msg_sent";
$ds_in = 'msg_recv';
$ds_out = 'msg_sent';
$graph_titel .= "::messages";
$unit_text = "Messages/sec";
$graph_titel .= '::messages';
$unit_text = 'Messages/sec';
$colour_line_in = "008800FF";
$colour_line_out = "000088FF";
$colour_area_in = "CEFFCE66";
$colour_area_out = "CECEFF66";
$colour_area_in_max = "CC88CC";
$colour_area_out_max = "FFEFAA";
$colour_line_in = '008800FF';
$colour_line_out = '000088FF';
$colour_area_in = 'CEFFCE66';
$colour_area_out = 'CECEFF66';
$colour_area_in_max = 'CC88CC';
$colour_area_out_max = 'FFEFAA';
$mailscanner_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-mailscannerV2-" . $app['app_id'] . ".rrd";
$mailscanner_rrd = $config['rrd_dir'].'/'.$device['hostname'].'/app-mailscannerV2-'.$app['app_id'].'.rrd';
if (is_file($mailscanner_rrd))
{
$rrd_filename = $mailscanner_rrd;
if (is_file($mailscanner_rrd)) {
$rrd_filename = $mailscanner_rrd;
}
include("includes/graphs/generic_duplex.inc.php");
?>
require 'includes/graphs/generic_duplex.inc.php';

View File

@@ -1,30 +1,32 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$scale_min = 0;
$nototal = (($width < 550) ? 1 : 0);
$unit_text = "Messages/sec";
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-mailscannerV2-" . $app['app_id'] . ".rrd";
$unit_text = 'Messages/sec';
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-mailscannerV2-'.$app['app_id'].'.rrd';
$array = array(
'spam' => array('descr' => 'Spam', 'colour' => 'FF8800'),
'virus' => array('descr' => 'Virus', 'colour' => 'FF0000')
);
'spam' => array(
'descr' => 'Spam',
'colour' => 'FF8800',
),
'virus' => array(
'descr' => 'Virus',
'colour' => 'FF0000',
),
);
$i = 0;
$i = 0;
if (is_file($rrd_filename))
{
foreach ($array as $ds => $vars)
{
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
$rrd_list[$i]['ds'] = $ds;
$rrd_list[$i]['colour'] = $vars['colour'];
$i++;
}
if (is_file($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
$rrd_list[$i]['ds'] = $ds;
$rrd_list[$i]['colour'] = $vars['colour'];
$i++;
}
}
include("includes/graphs/generic_multi_simplex_seperated.inc.php");
?>
require 'includes/graphs/generic_multi_simplex_seperated.inc.php';

View File

@@ -1,7 +1,5 @@
<?php
$rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-memcached-".$app['app_id'].".rrd";
if (is_file($rrd))
{
$rrd_filename = $rrd;
$rrd = $config['rrd_dir'].'/'.$device['hostname'].'/app-memcached-'.$app['app_id'].'.rrd';
if (is_file($rrd)) {
$rrd_filename = $rrd;
}
?>

View File

@@ -1,25 +1,23 @@
<?php
include("memcached.inc.php");
include("includes/graphs/common.inc.php");
require 'memcached.inc.php';
require 'includes/graphs/common.inc.php';
$nototal = 1;
$nototal = 1;
$ds_in = "cmd_set";
$ds_out = "cmd_get";
$ds_in = 'cmd_set';
$ds_out = 'cmd_get';
$in_text = "Set";
$out_text = "Get";
$in_text = 'Set';
$out_text = 'Get';
$graph_title .= ":: Commands";
$unit_text = "Commands";
$colour_line_in = "008800FF";
$colour_line_out = "000088FF";
$colour_area_in = "bEFFbEAA";
$colour_area_out = "bEbEFFAA";
$colour_area_in_max = "CC88CC";
$colour_area_out_max = "FFEFAA";
$graph_title .= ':: Commands';
$unit_text = 'Commands';
$colour_line_in = '008800FF';
$colour_line_out = '000088FF';
$colour_area_in = 'bEFFbEAA';
$colour_area_out = 'bEbEFFAA';
$colour_area_in_max = 'CC88CC';
$colour_area_out_max = 'FFEFAA';
include("includes/graphs/generic_duplex.inc.php");
?>
require 'includes/graphs/generic_duplex.inc.php';

View File

@@ -1,34 +1,41 @@
<?php
include("memcached.inc.php");
include("includes/graphs/common.inc.php");
require 'memcached.inc.php';
require 'includes/graphs/common.inc.php';
$scale_min = 0;
$colours = "mixed";
$nototal = 0;
$unit_text = "Packets/sec";
$array = array(
'limit_maxbytes' => array('descr' => 'Capacity', 'colour' => '555555'),
'bytes' => array('descr' => 'Used', 'colour' => 'cc0000', 'areacolour' => 'ff999955'),
);
$scale_min = 0;
$colours = 'mixed';
$nototal = 0;
$unit_text = 'Packets/sec';
$array = array(
'limit_maxbytes' => array(
'descr' => 'Capacity',
'colour' => '555555',
),
'bytes' => array(
'descr' => 'Used',
'colour' => 'cc0000',
'areacolour' => 'ff999955',
),
);
$i = 0;
$i = 0;
if (is_file($rrd_filename))
{
foreach ($array as $ds => $vars)
{
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
$rrd_list[$i]['ds'] = $ds;
$rrd_list[$i]['colour'] = $vars['colour'];
if (!empty($vars['areacolour'])) { $rrd_list[$i]['areacolour'] = $vars['areacolour']; }
$i++;
}
} else {
echo("file missing: $file");
if (is_file($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
$rrd_list[$i]['ds'] = $ds;
$rrd_list[$i]['colour'] = $vars['colour'];
if (!empty($vars['areacolour'])) {
$rrd_list[$i]['areacolour'] = $vars['areacolour'];
}
$i++;
}
}
else {
echo "file missing: $file";
}
include("includes/graphs/generic_multi_line.inc.php");
?>
require 'includes/graphs/generic_multi_line.inc.php';

View File

@@ -1,33 +1,36 @@
<?php
include("memcached.inc.php");
include("includes/graphs/common.inc.php");
require 'memcached.inc.php';
require 'includes/graphs/common.inc.php';
$scale_min = 0;
$colours = "mixed";
$nototal = 0;
$unit_text = "Items";
$array = array(
'curr_items' => array('descr' => 'Items', 'colour' => '555555'),
);
$scale_min = 0;
$colours = 'mixed';
$nototal = 0;
$unit_text = 'Items';
$array = array(
'curr_items' => array(
'descr' => 'Items',
'colour' => '555555',
),
);
$i = 0;
$i = 0;
if (is_file($rrd_filename))
{
foreach ($array as $ds => $vars)
{
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
$rrd_list[$i]['ds'] = $ds;
$rrd_list[$i]['colour'] = $vars['colour'];
if (!empty($vars['areacolour'])) { $rrd_list[$i]['areacolour'] = $vars['areacolour']; }
$i++;
}
} else {
echo("file missing: $file");
if (is_file($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
$rrd_list[$i]['ds'] = $ds;
$rrd_list[$i]['colour'] = $vars['colour'];
if (!empty($vars['areacolour'])) {
$rrd_list[$i]['areacolour'] = $vars['areacolour'];
}
$i++;
}
}
else {
echo "file missing: $file";
}
include("includes/graphs/generic_multi_line.inc.php");
?>
require 'includes/graphs/generic_multi_line.inc.php';

View File

@@ -1,20 +1,18 @@
<?php
include("memcached.inc.php");
include("includes/graphs/common.inc.php");
require 'memcached.inc.php';
require 'includes/graphs/common.inc.php';
$device = device_by_id_cache($vars['id']);
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$scale_min = 0;
$ds = "threads";
$colour_area = "F6F6F6";
$colour_line = "555555";
$colour_area_max = "FFEE99";
#$graph_max = 100;
$unit_text = "Threads";
$ds = 'threads';
$colour_area = 'F6F6F6';
$colour_line = '555555';
$colour_area_max = 'FFEE99';
// $graph_max = 100;
$unit_text = 'Threads';
include("includes/graphs/generic_simplex.inc.php");
?>
require 'includes/graphs/generic_simplex.inc.php';

View File

@@ -1,18 +1,16 @@
<?php
$scale_min = "0";
$scale_min = '0';
include("memcached.inc.php");
include("includes/graphs/common.inc.php");
require 'memcached.inc.php';
require 'includes/graphs/common.inc.php';
$device = device_by_id_cache($vars['id']);
$rrd_options .= " DEF:uptime=".$rrd_filename.":uptime:AVERAGE";
$rrd_options .= " CDEF:cuptime=uptime,86400,/";
$rrd_options .= ' DEF:uptime='.$rrd_filename.':uptime:AVERAGE';
$rrd_options .= ' CDEF:cuptime=uptime,86400,/';
$rrd_options .= " 'COMMENT:Days Current Minimum Maximum Average\\n'";
$rrd_options .= " AREA:cuptime#EEEEEE:Uptime";
$rrd_options .= " LINE1.25:cuptime#36393D:";
$rrd_options .= " GPRINT:cuptime:LAST:%6.2lf GPRINT:cuptime:AVERAGE:%6.2lf";
$rrd_options .= ' AREA:cuptime#EEEEEE:Uptime';
$rrd_options .= ' LINE1.25:cuptime#36393D:';
$rrd_options .= ' GPRINT:cuptime:LAST:%6.2lf GPRINT:cuptime:AVERAGE:%6.2lf';
$rrd_options .= " GPRINT:cuptime:MAX:%6.2lf 'GPRINT:cuptime:AVERAGE:%6.2lf\\n'";
?>

View File

@@ -1,37 +1,63 @@
<?php
include('includes/graphs/common.inc.php');
require 'includes/graphs/common.inc.php';
$rrd_filename = $config["rrd_dir"] . '/' . $device["hostname"] . '/app-mysql-'.$app["app_id"].'.rrd';
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-mysql-'.$app['app_id'].'.rrd';
$array = array('CDe' => array('descr' => 'Delete', 'colour' => '22FF22'),
'CIt' => array('descr' => 'Insert', 'colour' => '0022FF'),
'CISt' => array('descr' => 'Insert Select', 'colour' => 'FF0000'),
'CLd' => array('descr' => 'Load Data', 'colour' => '00AAAA'),
'CRe' => array('descr' => 'Replace', 'colour' => 'FF00FF'),
'CRSt' => array('descr' => 'Replace Select', 'colour' => 'FFA500'),
'CSt' => array('descr' => 'Select', 'colour' => 'CC0000'),
'CUe' => array('descr' => 'Update', 'colour' => '0000CC'),
'CUMi' => array('descr' => 'Update Multiple', 'colour' => '0080C0'),
);
$array = array(
'CDe' => array(
'descr' => 'Delete',
'colour' => '22FF22',
),
'CIt' => array(
'descr' => 'Insert',
'colour' => '0022FF',
),
'CISt' => array(
'descr' => 'Insert Select',
'colour' => 'FF0000',
),
'CLd' => array(
'descr' => 'Load Data',
'colour' => '00AAAA',
),
'CRe' => array(
'descr' => 'Replace',
'colour' => 'FF00FF',
),
'CRSt' => array(
'descr' => 'Replace Select',
'colour' => 'FFA500',
),
'CSt' => array(
'descr' => 'Select',
'colour' => 'CC0000',
),
'CUe' => array(
'descr' => 'Update',
'colour' => '0000CC',
),
'CUMi' => array(
'descr' => 'Update Multiple',
'colour' => '0080C0',
),
);
$i = 0;
if (is_file($rrd_filename))
{
foreach ($array as $ds => $vars)
{
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
$rrd_list[$i]['ds'] = $ds;
# $rrd_list[$i]['colour'] = $vars['colour'];
$i++;
}
} else { echo("file missing: $file"); }
if (is_file($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
$rrd_list[$i]['ds'] = $ds;
// $rrd_list[$i]['colour'] = $vars['colour'];
$i++;
}
} else {
echo "file missing: $file";
}
$colours = "mixed";
$colours = 'mixed';
$nototal = 1;
$unit_text = "Commands";
$unit_text = 'Commands';
include("includes/graphs/generic_multi_simplex_seperated.inc.php");
?>
require 'includes/graphs/generic_multi_simplex_seperated.inc.php';

View File

@@ -1,36 +1,54 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
include('includes/graphs/common.inc.php');
require 'includes/graphs/common.inc.php';
$rrd_filename = $config["rrd_dir"] . '/' . $device["hostname"] . '/app-mysql-'.$app["app_id"].'.rrd';
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-mysql-'.$app['app_id'].'.rrd';
$array = array('MaCs' => array('descr' => 'Max Connections', 'colour' => '22FF22'),
'MUCs' => array('descr' => 'Max Used Connections', 'colour' => '0022FF'),
'ACs' => array('descr' => 'Aborted Clients', 'colour' => 'FF0000'),
'AdCs' => array('descr' => 'Aborted Connects', 'colour' => '0080C0'),
'TCd' => array('descr' => 'Threads Connected', 'colour' => 'FF0000'),
'Cs' => array('descr' => 'New Connections', 'colour' => '0080C0'),
);
$array = array(
'MaCs' => array(
'descr' => 'Max Connections',
'colour' => '22FF22',
),
'MUCs' => array(
'descr' => 'Max Used Connections',
'colour' => '0022FF',
),
'ACs' => array(
'descr' => 'Aborted Clients',
'colour' => 'FF0000',
),
'AdCs' => array(
'descr' => 'Aborted Connects',
'colour' => '0080C0',
),
'TCd' => array(
'descr' => 'Threads Connected',
'colour' => 'FF0000',
),
'Cs' => array(
'descr' => 'New Connections',
'colour' => '0080C0',
),
);
$i = 0;
if (is_file($rrd_filename))
{
foreach ($array as $ds => $vars)
{
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
$rrd_list[$i]['ds'] = $ds;
# $rrd_list[$i]['colour'] = $vars['colour'];
$i++;
}
} else { echo("file missing: $file"); }
if (is_file($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
$rrd_list[$i]['ds'] = $ds;
// $rrd_list[$i]['colour'] = $vars['colour'];
$i++;
}
}
else {
echo "file missing: $file";
}
$colours = "mixed";
$colours = 'mixed';
$nototal = 1;
$unit_text = "Connections";
$unit_text = 'Connections';
include("includes/graphs/generic_multi_simplex_seperated.inc.php");
?>
require 'includes/graphs/generic_multi_simplex_seperated.inc.php';

View File

@@ -1,32 +1,32 @@
<?php
include('includes/graphs/common.inc.php');
require 'includes/graphs/common.inc.php';
$rrd_filename = $config["rrd_dir"] . '/' . $device["hostname"] . '/app-mysql-'.$app["app_id"].'.rrd';
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-mysql-'.$app['app_id'].'.rrd';
$array = array('TOC' => array('descr' => 'Table Cache'),
'OFs' => array('descr' => 'Open Files'),
'OTs' => array('descr' => 'Open Tables'),
'OdTs' => array('descr' => 'Opened Tables'),
);
$array = array(
'TOC' => array('descr' => 'Table Cache'),
'OFs' => array('descr' => 'Open Files'),
'OTs' => array('descr' => 'Open Tables'),
'OdTs' => array('descr' => 'Opened Tables'),
);
$i = 0;
if (is_file($rrd_filename))
{
foreach ($array as $ds => $vars)
{
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
$rrd_list[$i]['ds'] = $ds;
# $rrd_list[$i]['colour'] = $vars['colour'];
$i++;
}
} else { echo("file missing: $file"); }
if (is_file($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
$rrd_list[$i]['ds'] = $ds;
// $rrd_list[$i]['colour'] = $vars['colour'];
$i++;
}
}
else {
echo "file missing: $file";
}
$colours = "mixed";
$colours = 'mixed';
$nototal = 1;
$unit_text = "";
$unit_text = '';
include("includes/graphs/generic_multi_simplex_seperated.inc.php");
?>
require 'includes/graphs/generic_multi_simplex_seperated.inc.php';

View File

@@ -1,36 +1,37 @@
<?php
include('includes/graphs/common.inc.php');
require 'includes/graphs/common.inc.php';
$rrd_filename = $config["rrd_dir"] . '/' . $device["hostname"] . '/app-mysql-'.$app["app_id"].'.rrd';
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-mysql-'.$app['app_id'].'.rrd';
$array = array('IBPse' => 'Buffer Pool Size',
'IBPDBp' => 'Database Pages',
'IBPFe' => 'Free Pages',
'IBPMps' => 'Modified Pages',
);
$array = array(
'IBPse' => 'Buffer Pool Size',
'IBPDBp' => 'Database Pages',
'IBPFe' => 'Free Pages',
'IBPMps' => 'Modified Pages',
);
$i = 0;
if (is_file($rrd_filename))
{
foreach ($array as $ds => $vars)
{
if (is_file($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
if (is_array($vars))
{
$rrd_list[$i]['descr'] = $vars['descr'];
} else {
$rrd_list[$i]['descr'] = $vars;
if (is_array($vars)) {
$rrd_list[$i]['descr'] = $vars['descr'];
}
else {
$rrd_list[$i]['descr'] = $vars;
}
$rrd_list[$i]['ds'] = $ds;
$i++;
}
$rrd_list[$i]['ds'] = $ds;
$i++;
}
} else { echo("file missing: $file"); }
}
else {
echo "file missing: $file";
}
$colours = "mixed";
$colours = 'mixed';
$nototal = 1;
$unit_text = "Commands";
$unit_text = 'Commands';
include("includes/graphs/generic_multi_simplex_seperated.inc.php");
?>
require 'includes/graphs/generic_multi_simplex_seperated.inc.php';

View File

@@ -1,35 +1,36 @@
<?php
include('includes/graphs/common.inc.php');
require 'includes/graphs/common.inc.php';
$rrd_filename = $config["rrd_dir"] . '/' . $device["hostname"] . '/app-mysql-'.$app["app_id"].'.rrd';
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-mysql-'.$app['app_id'].'.rrd';
$array = array('IBRd' => 'Pages Read',
'IBCd' => 'Pages Created',
'IBWr' => 'Pages Written',
);
$array = array(
'IBRd' => 'Pages Read',
'IBCd' => 'Pages Created',
'IBWr' => 'Pages Written',
);
$i = 0;
if (is_file($rrd_filename))
{
foreach ($array as $ds => $vars)
{
if (is_file($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
if (is_array($vars))
{
$rrd_list[$i]['descr'] = $vars['descr'];
} else {
$rrd_list[$i]['descr'] = $vars;
if (is_array($vars)) {
$rrd_list[$i]['descr'] = $vars['descr'];
}
else {
$rrd_list[$i]['descr'] = $vars;
}
$rrd_list[$i]['ds'] = $ds;
$i++;
}
$rrd_list[$i]['ds'] = $ds;
$i++;
}
} else { echo("file missing: $file"); }
}
else {
echo "file missing: $file";
}
$colours = "mixed";
$colours = 'mixed';
$nototal = 1;
$unit_text = "activity";
$unit_text = 'activity';
include("includes/graphs/generic_multi_simplex_seperated.inc.php");
?>
require 'includes/graphs/generic_multi_simplex_seperated.inc.php';

View File

@@ -1,35 +1,36 @@
<?php
include('includes/graphs/common.inc.php');
require 'includes/graphs/common.inc.php';
$rrd_filename = $config["rrd_dir"] . '/' . $device["hostname"] . '/app-mysql-'.$app["app_id"].'.rrd';
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-mysql-'.$app['app_id'].'.rrd';
$array = array('IBIIs' => 'Inserts',
'IBIMRd' => 'Merged Records',
'IBIMs' => 'Merges',
);
$array = array(
'IBIIs' => 'Inserts',
'IBIMRd' => 'Merged Records',
'IBIMs' => 'Merges',
);
$i = 0;
if (is_file($rrd_filename))
{
foreach ($array as $ds => $vars)
{
if (is_file($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
if (is_array($vars))
{
$rrd_list[$i]['descr'] = $vars['descr'];
} else {
$rrd_list[$i]['descr'] = $vars;
if (is_array($vars)) {
$rrd_list[$i]['descr'] = $vars['descr'];
}
else {
$rrd_list[$i]['descr'] = $vars;
}
$rrd_list[$i]['ds'] = $ds;
$i++;
}
$rrd_list[$i]['ds'] = $ds;
$i++;
}
} else { echo("file missing: $file"); }
}
else {
echo "file missing: $file";
}
$colours = "mixed";
$colours = 'mixed';
$nototal = 1;
$unit_text = "";
$unit_text = '';
include("includes/graphs/generic_multi_simplex_seperated.inc.php");
?>
require 'includes/graphs/generic_multi_simplex_seperated.inc.php';

View File

@@ -1,12 +1,11 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$mysql_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-mysql-".$app['app_id'].".rrd";
$mysql_rrd = $config['rrd_dir'].'/'.$device['hostname'].'/app-mysql-'.$app['app_id'].'.rrd';
if (is_file($mysql_rrd))
{
$rrd_filename = $mysql_rrd;
if (is_file($mysql_rrd)) {
$rrd_filename = $mysql_rrd;
}
$rrd_options .= ' DEF:a='.$rrd_filename.':IBIRd:AVERAGE ';
@@ -35,5 +34,3 @@ $rrd_options .= 'LINE1:d#00AAAA:"File syncs " ';
$rrd_options .= 'GPRINT:d:LAST:"%6.2lf %s" ';
$rrd_options .= 'GPRINT:d:AVERAGE:"%6.2lf %s" ';
$rrd_options .= 'GPRINT:d:MAX:"%6.2lf %s\\n" ';
?>

View File

@@ -1,39 +1,40 @@
<?php
include('includes/graphs/common.inc.php');
require 'includes/graphs/common.inc.php';
$rrd_filename = $config["rrd_dir"] . '/' . $device["hostname"] . '/app-mysql-'.$app["app_id"].'.rrd';
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-mysql-'.$app['app_id'].'.rrd';
$array = array('IBILog' => 'AIO Log',
'IBISc' => 'AIO Sync',
'IBIFLg' => 'Buf Pool Flush',
'IBFBl' => 'Log Flushes',
'IBIIAo' => 'Insert Buf AIO Read',
'IBIAd' => 'Normal AIO Read',
'IBIAe' => 'Normal AIO Writes',
);
$array = array(
'IBILog' => 'AIO Log',
'IBISc' => 'AIO Sync',
'IBIFLg' => 'Buf Pool Flush',
'IBFBl' => 'Log Flushes',
'IBIIAo' => 'Insert Buf AIO Read',
'IBIAd' => 'Normal AIO Read',
'IBIAe' => 'Normal AIO Writes',
);
$i = 0;
if (is_file($rrd_filename))
{
foreach ($array as $ds => $vars)
{
if (is_file($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
if (is_array($vars))
{
$rrd_list[$i]['descr'] = $vars['descr'];
} else {
$rrd_list[$i]['descr'] = $vars;
if (is_array($vars)) {
$rrd_list[$i]['descr'] = $vars['descr'];
}
else {
$rrd_list[$i]['descr'] = $vars;
}
$rrd_list[$i]['ds'] = $ds;
$i++;
}
$rrd_list[$i]['ds'] = $ds;
$i++;
}
} else { echo("file missing: $file"); }
}
else {
echo "file missing: $file";
}
$colours = "mixed";
$colours = 'mixed';
$nototal = 1;
$unit_text = "";
$unit_text = '';
include("includes/graphs/generic_multi_simplex_seperated.inc.php");
?>
require 'includes/graphs/generic_multi_simplex_seperated.inc.php';

View File

@@ -1,12 +1,11 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$mysql_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-mysql-".$app['app_id'].".rrd";
$mysql_rrd = $config['rrd_dir'].'/'.$device['hostname'].'/app-mysql-'.$app['app_id'].'.rrd';
if (is_file($mysql_rrd))
{
$rrd_filename = $mysql_rrd;
if (is_file($mysql_rrd)) {
$rrd_filename = $mysql_rrd;
}
$rrd_options .= ' DEF:a='.$rrd_filename.':IDBLBSe:AVERAGE ';
@@ -29,5 +28,3 @@ $rrd_options .= 'LINE1:c#0022FF:"KB Written " ';
$rrd_options .= 'GPRINT:c:LAST:"%6.2lf %s" ';
$rrd_options .= 'GPRINT:c:AVERAGE:"%6.2lf %s" ';
$rrd_options .= 'GPRINT:c:MAX:"%6.2lf %s\\n" ';
?>

View File

@@ -1,36 +1,37 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$rrd_filename = $config["rrd_dir"] . '/' . $device["hostname"] . '/app-mysql-'.$app["app_id"].'.rrd';
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-mysql-'.$app['app_id'].'.rrd';
$array = array('IDBRDd' => 'Deletes',
'IDBRId' => 'Inserts',
'IDBRRd' => 'Reads',
'IDBRUd' => 'Updates',
);
$array = array(
'IDBRDd' => 'Deletes',
'IDBRId' => 'Inserts',
'IDBRRd' => 'Reads',
'IDBRUd' => 'Updates',
);
$i = 0;
if (is_file($rrd_filename))
{
foreach ($array as $ds => $vars)
{
if (is_file($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
if (is_array($vars))
{
$rrd_list[$i]['descr'] = $vars['descr'];
} else {
$rrd_list[$i]['descr'] = $vars;
if (is_array($vars)) {
$rrd_list[$i]['descr'] = $vars['descr'];
}
else {
$rrd_list[$i]['descr'] = $vars;
}
$rrd_list[$i]['ds'] = $ds;
$i++;
}
$rrd_list[$i]['ds'] = $ds;
$i++;
}
} else { echo("file missing: $file"); }
}
else {
echo "file missing: $file";
}
$colours = "mixed";
$colours = 'mixed';
$nototal = 0;
$unit_text = "Rows";
$unit_text = 'Rows';
include("includes/graphs/generic_multi_simplex_seperated.inc.php");
?>
require 'includes/graphs/generic_multi_simplex_seperated.inc.php';

View File

@@ -1,35 +1,36 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$rrd_filename = $config["rrd_dir"] . '/' . $device["hostname"] . '/app-mysql-'.$app["app_id"].'.rrd';
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-mysql-'.$app['app_id'].'.rrd';
$array = array('IBSRs' => 'Spin Rounds',
'IBSWs' => 'Spin Waits',
'IBOWs' => 'OS Waits',
);
$array = array(
'IBSRs' => 'Spin Rounds',
'IBSWs' => 'Spin Waits',
'IBOWs' => 'OS Waits',
);
$i = 0;
if (is_file($rrd_filename))
{
foreach ($array as $ds => $vars)
{
if (is_file($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
if (is_array($vars))
{
$rrd_list[$i]['descr'] = $vars['descr'];
} else {
$rrd_list[$i]['descr'] = $vars;
if (is_array($vars)) {
$rrd_list[$i]['descr'] = $vars['descr'];
}
else {
$rrd_list[$i]['descr'] = $vars;
}
$rrd_list[$i]['ds'] = $ds;
$i++;
}
$rrd_list[$i]['ds'] = $ds;
$i++;
}
} else { echo("file missing: $file"); }
}
else {
echo "file missing: $file";
}
$colours = "mixed";
$colours = 'mixed';
$nototal = 1;
$unit_text = "Semaphores";
$unit_text = 'Semaphores';
include("includes/graphs/generic_multi_simplex_seperated.inc.php");
?>
require 'includes/graphs/generic_multi_simplex_seperated.inc.php';

View File

@@ -1,33 +1,32 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$rrd_filename = $config["rrd_dir"] . '/' . $device["hostname"] . '/app-mysql-'.$app["app_id"].'.rrd';
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-mysql-'.$app['app_id'].'.rrd';
$array = array('IBTNx' => 'Transactions created',
);
$array = array('IBTNx' => 'Transactions created');
$i = 0;
if (is_file($rrd_filename))
{
foreach ($array as $ds => $vars)
{
$rrd_list[$i]['filename'] = $rrd_filename;
if (is_array($vars))
{
$rrd_list[$i]['descr'] = $vars['descr'];
} else {
$rrd_list[$i]['descr'] = $vars;
if (is_file($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
if (is_array($vars)) {
$rrd_list[$i]['descr'] = $vars['descr'];
}
else {
$rrd_list[$i]['descr'] = $vars;
}
$rrd_list[$i]['ds'] = $ds;
$i++;
}
$rrd_list[$i]['ds'] = $ds;
$i++;
}
} else { echo("file missing: $file"); }
}
else {
echo "file missing: $file";
}
$colours = "mixed";
$colours = 'mixed';
$nototal = 1;
$unit_text = "transactions";
$unit_text = 'transactions';
include("includes/graphs/generic_multi_simplex_seperated.inc.php");
?>
require 'includes/graphs/generic_multi_simplex_seperated.inc.php';

View File

@@ -1,36 +1,37 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$rrd_filename = $config["rrd_dir"] . '/' . $device["hostname"] . '/app-mysql-'.$app["app_id"].'.rrd';
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-mysql-'.$app['app_id'].'.rrd';
$array = array( 'KRRs' => 'read requests',
'KRs' => 'reads',
'KWR' => 'write requests',
'KWs' => 'writes',
);
$array = array(
'KRRs' => 'read requests',
'KRs' => 'reads',
'KWR' => 'write requests',
'KWs' => 'writes',
);
$i = 0;
if (is_file($rrd_filename))
{
foreach ($array as $ds => $vars)
{
if (is_file($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
if (is_array($vars))
{
$rrd_list[$i]['descr'] = $vars['descr'];
} else {
$rrd_list[$i]['descr'] = $vars;
if (is_array($vars)) {
$rrd_list[$i]['descr'] = $vars['descr'];
}
else {
$rrd_list[$i]['descr'] = $vars;
}
$rrd_list[$i]['ds'] = $ds;
$i++;
}
$rrd_list[$i]['ds'] = $ds;
$i++;
}
} else { echo("file missing: $file"); }
}
else {
echo "file missing: $file";
}
$colours = "mixed";
$colours = 'mixed';
$nototal = 1;
$unit_text = "Keys";
$unit_text = 'Keys';
include("includes/graphs/generic_multi_simplex_seperated.inc.php");
?>
require 'includes/graphs/generic_multi_simplex_seperated.inc.php';

View File

@@ -1,19 +1,16 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$mysql_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-mysql-".$app['app_id'].".rrd";
$mysql_rrd = $config['rrd_dir'].'/'.$device['hostname'].'/app-mysql-'.$app['app_id'].'.rrd';
if (is_file($mysql_rrd))
{
$rrd_filename = $mysql_rrd;
if (is_file($mysql_rrd)) {
$rrd_filename = $mysql_rrd;
}
$multiplier = 8;
$ds_in = "BRd";
$ds_out = "BSt";
$ds_in = 'BRd';
$ds_out = 'BSt';
include("includes/graphs/generic_data.inc.php");
?>
require 'includes/graphs/generic_data.inc.php';

View File

@@ -1,38 +1,52 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$mysql_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-mysql-".$app['app_id'].".rrd";
$mysql_rrd = $config['rrd_dir'].'/'.$device['hostname'].'/app-mysql-'.$app['app_id'].'.rrd';
if (is_file($mysql_rrd))
{
$rrd_filename = $mysql_rrd;
if (is_file($mysql_rrd)) {
$rrd_filename = $mysql_rrd;
}
$array = array('QCQICe' => array('descr' => 'Queries in cache', 'colour' => '22FF22'),
'QCHs' => array('descr' => 'Cache hits', 'colour' => '0022FF'),
'QCIs' => array('descr' => 'Inserts', 'colour' => 'FF0000'),
'QCNCd' => array('descr' => 'Not cached', 'colour' => '00AAAA'),
'QCLMPs' => array('descr' => 'Low-memory prunes', 'colour' => 'FF00FF'),
);
$array = array(
'QCQICe' => array(
'descr' => 'Queries in cache',
'colour' => '22FF22',
),
'QCHs' => array(
'descr' => 'Cache hits',
'colour' => '0022FF',
),
'QCIs' => array(
'descr' => 'Inserts',
'colour' => 'FF0000',
),
'QCNCd' => array(
'descr' => 'Not cached',
'colour' => '00AAAA',
),
'QCLMPs' => array(
'descr' => 'Low-memory prunes',
'colour' => 'FF00FF',
),
);
$i = 0;
if (is_file($rrd_filename))
{
foreach ($array as $ds => $vars)
{
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
$rrd_list[$i]['ds'] = $ds;
# $rrd_list[$i]['colour'] = $vars['colour'];
$i++;
}
} else { echo("file missing: $file"); }
if (is_file($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
$rrd_list[$i]['ds'] = $ds;
// $rrd_list[$i]['colour'] = $vars['colour'];
$i++;
}
}
else {
echo "file missing: $file";
}
$colours = "mixed";
$colours = 'mixed';
$nototal = 1;
$unit_text = "Commands";
$unit_text = 'Commands';
include("includes/graphs/generic_multi_simplex_seperated.inc.php");
?>
require 'includes/graphs/generic_multi_simplex_seperated.inc.php';

View File

@@ -1,34 +1,35 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$rrd_filename = $config["rrd_dir"] . '/' . $device["hostname"] . '/app-mysql-'.$app["app_id"].'.rrd';
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-mysql-'.$app['app_id'].'.rrd';
$array = array( 'QCs' => 'Cache size',
'QCeFy' => 'Free mem',
);
$array = array(
'QCs' => 'Cache size',
'QCeFy' => 'Free mem',
);
$i = 0;
if (is_file($rrd_filename))
{
foreach ($array as $ds => $vars)
{
if (is_file($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
if (is_array($vars))
{
$rrd_list[$i]['descr'] = $vars['descr'];
} else {
$rrd_list[$i]['descr'] = $vars;
if (is_array($vars)) {
$rrd_list[$i]['descr'] = $vars['descr'];
}
else {
$rrd_list[$i]['descr'] = $vars;
}
$rrd_list[$i]['ds'] = $ds;
$i++;
}
$rrd_list[$i]['ds'] = $ds;
$i++;
}
} else { echo("file missing: $file"); }
}
else {
echo "file missing: $file";
}
$colours = "mixed";
$colours = 'mixed';
$nototal = 1;
$unit_text = "Bytes";
$unit_text = 'Bytes';
include("includes/graphs/generic_multi_simplex_seperated.inc.php");
?>
require 'includes/graphs/generic_multi_simplex_seperated.inc.php';

View File

@@ -1,37 +1,38 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$rrd_filename = $config["rrd_dir"] . '/' . $device["hostname"] . '/app-mysql-'.$app["app_id"].'.rrd';
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-mysql-'.$app['app_id'].'.rrd';
$array = array( 'SFJn' => 'Full Join',
'SFRJn' => 'Full Range',
'SRe' => 'Range',
'SRCk' => 'Range Check',
'SSn' => 'Scan',
);
$array = array(
'SFJn' => 'Full Join',
'SFRJn' => 'Full Range',
'SRe' => 'Range',
'SRCk' => 'Range Check',
'SSn' => 'Scan',
);
$i = 0;
if (is_file($rrd_filename))
{
foreach ($array as $ds => $vars)
{
if (is_file($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
if (is_array($vars))
{
$rrd_list[$i]['descr'] = $vars['descr'];
} else {
$rrd_list[$i]['descr'] = $vars;
if (is_array($vars)) {
$rrd_list[$i]['descr'] = $vars['descr'];
}
else {
$rrd_list[$i]['descr'] = $vars;
}
$rrd_list[$i]['ds'] = $ds;
$i++;
}
$rrd_list[$i]['ds'] = $ds;
$i++;
}
} else { echo("file missing: $file"); }
}
else {
echo "file missing: $file";
}
$colours = "mixed";
$colours = 'mixed';
$nototal = 0;
$unit_text = "Queries";
$unit_text = 'Queries';
include("includes/graphs/generic_multi_simplex_seperated.inc.php");
?>
require 'includes/graphs/generic_multi_simplex_seperated.inc.php';

View File

@@ -1,34 +1,32 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$rrd_filename = $config["rrd_dir"] . '/' . $device["hostname"] . '/app-mysql-'.$app["app_id"].'.rrd';
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-mysql-'.$app['app_id'].'.rrd';
$array = array(
'SQs' => 'Slow queries',
);
$array = array('SQs' => 'Slow queries');
$i = 0;
if (is_file($rrd_filename))
{
foreach ($array as $ds => $vars)
{
$rrd_list[$i]['filename'] = $rrd_filename;
if (is_array($vars))
{
$rrd_list[$i]['descr'] = $vars['descr'];
} else {
$rrd_list[$i]['descr'] = $vars;
if (is_file($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
if (is_array($vars)) {
$rrd_list[$i]['descr'] = $vars['descr'];
}
else {
$rrd_list[$i]['descr'] = $vars;
}
$rrd_list[$i]['ds'] = $ds;
$i++;
}
$rrd_list[$i]['ds'] = $ds;
$i++;
}
} else { echo("file missing: $file"); }
}
else {
echo "file missing: $file";
}
$colours = "mixed";
$colours = 'mixed';
$nototal = 1;
$unit_text = "Queries";
$unit_text = 'Queries';
include("includes/graphs/generic_multi_simplex_seperated.inc.php");
?>
require 'includes/graphs/generic_multi_simplex_seperated.inc.php';

View File

@@ -1,37 +1,37 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$rrd_filename = $config["rrd_dir"] . '/' . $device["hostname"] . '/app-mysql-'.$app["app_id"].'.rrd';
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-mysql-'.$app['app_id'].'.rrd';
$array = array(
'SRows' => 'Rows Sorted',
'SRange' => 'Range',
'SMPs' => 'Merge Passes',
'SScan' => 'Scan',
);
'SRows' => 'Rows Sorted',
'SRange' => 'Range',
'SMPs' => 'Merge Passes',
'SScan' => 'Scan',
);
$i = 0;
if (is_file($rrd_filename))
{
foreach ($array as $ds => $vars)
{
$rrd_list[$i]['filename'] = $rrd_filename;
if (is_array($vars))
{
$rrd_list[$i]['descr'] = $vars['descr'];
} else {
$rrd_list[$i]['descr'] = $vars;
if (is_file($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
if (is_array($vars)) {
$rrd_list[$i]['descr'] = $vars['descr'];
}
else {
$rrd_list[$i]['descr'] = $vars;
}
$rrd_list[$i]['ds'] = $ds;
$i++;
}
$rrd_list[$i]['ds'] = $ds;
$i++;
}
} else { echo("file missing: $file"); }
}
else {
echo "file missing: $file";
}
$colours = "mixed";
$colours = 'mixed';
$nototal = 0;
$unit_text = "";
$unit_text = '';
include("includes/graphs/generic_multi_simplex_seperated.inc.php");
?>
require 'includes/graphs/generic_multi_simplex_seperated.inc.php';

View File

@@ -1,51 +1,51 @@
<?php
include('includes/graphs/common.inc.php');
require 'includes/graphs/common.inc.php';
$rrd_filename = $config["rrd_dir"] . '/' . $device["hostname"] . '/app-mysql-'.$app["app_id"].'-status.rrd';
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-mysql-'.$app['app_id'].'-status.rrd';
$array = array(
'State_closing_tables' => 'd2',
'State_copying_to_tmp_table' => 'd3',
'State_end' => 'd4',
'State_freeing_items' => 'd5',
'State_init' => 'd6',
'State_locked' => 'd7',
'State_login' => 'd8',
'State_preparing' => 'd9',
'State_reading_from_net' => 'da',
'State_sending_data' => 'db',
'State_sorting_result' => 'dc',
'State_statistics' => 'dd',
'State_updating' => 'de',
'State_writing_to_net' => 'df',
'State_none' => 'dg',
'State_other' => 'dh'
'State_closing_tables' => 'd2',
'State_copying_to_tmp_table' => 'd3',
'State_end' => 'd4',
'State_freeing_items' => 'd5',
'State_init' => 'd6',
'State_locked' => 'd7',
'State_login' => 'd8',
'State_preparing' => 'd9',
'State_reading_from_net' => 'da',
'State_sending_data' => 'db',
'State_sorting_result' => 'dc',
'State_statistics' => 'dd',
'State_updating' => 'de',
'State_writing_to_net' => 'df',
'State_none' => 'dg',
'State_other' => 'dh',
);
$i = 0;
if (is_file($rrd_filename))
{
foreach ($array as $vars => $ds)
{
$rrd_list[$i]['filename'] = $rrd_filename;
if (is_array($vars))
{
$rrd_list[$i]['descr'] = $vars['descr'];
} else {
$rrd_list[$i]['descr'] = $vars;
if (is_file($rrd_filename)) {
foreach ($array as $vars => $ds) {
$rrd_list[$i]['filename'] = $rrd_filename;
if (is_array($vars)) {
$rrd_list[$i]['descr'] = $vars['descr'];
}
else {
$rrd_list[$i]['descr'] = $vars;
}
$rrd_list[$i]['descr'] = str_replace('_', ' ', $rrd_list[$i]['descr']);
$rrd_list[$i]['descr'] = str_replace('State ', '', $rrd_list[$i]['descr']);
$rrd_list[$i]['ds'] = $ds;
$i++;
}
$rrd_list[$i]['descr'] = str_replace("_", " ", $rrd_list[$i]['descr']);
$rrd_list[$i]['descr'] = str_replace("State ", "", $rrd_list[$i]['descr']);
$rrd_list[$i]['ds'] = $ds;
$i++;
}
} else { echo("file missing: $file"); }
}
else {
echo "file missing: $file";
}
$colours = "mixed";
$colours = 'mixed';
$nototal = 1;
$unit_text = "activity";
$unit_text = 'activity';
include("includes/graphs/generic_multi_simplex_seperated.inc.php");
?>
require 'includes/graphs/generic_multi_simplex_seperated.inc.php';

View File

@@ -1,35 +1,35 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$rrd_filename = $config["rrd_dir"] . '/' . $device["hostname"] . '/app-mysql-'.$app["app_id"].'.rrd';
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-mysql-'.$app['app_id'].'.rrd';
$array = array(
'TLIe' => 'immed',
'TLWd' => 'waited',
);
'TLIe' => 'immed',
'TLWd' => 'waited',
);
$i = 0;
if (is_file($rrd_filename))
{
foreach ($array as $ds => $vars)
{
$rrd_list[$i]['filename'] = $rrd_filename;
if (is_array($vars))
{
$rrd_list[$i]['descr'] = $vars['descr'];
} else {
$rrd_list[$i]['descr'] = $vars;
if (is_file($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
if (is_array($vars)) {
$rrd_list[$i]['descr'] = $vars['descr'];
}
else {
$rrd_list[$i]['descr'] = $vars;
}
$rrd_list[$i]['ds'] = $ds;
$i++;
}
$rrd_list[$i]['ds'] = $ds;
$i++;
}
} else { echo("file missing: $file"); }
}
else {
echo "file missing: $file";
}
$colours = "mixed";
$colours = 'mixed';
$nototal = 0;
$unit_text = "Table locks";
$unit_text = 'Table locks';
include("includes/graphs/generic_multi_simplex_seperated.inc.php");
?>
require 'includes/graphs/generic_multi_simplex_seperated.inc.php';

View File

@@ -1,36 +1,36 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$rrd_filename = $config["rrd_dir"] . '/' . $device["hostname"] . '/app-mysql-'.$app["app_id"].'.rrd';
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-mysql-'.$app['app_id'].'.rrd';
$array = array(
'CTMPDTs' => 'disk tables',
'CTMPTs' => 'tables',
'CTMPFs' => 'files',
);
'CTMPDTs' => 'disk tables',
'CTMPTs' => 'tables',
'CTMPFs' => 'files',
);
$i = 0;
if (is_file($rrd_filename))
{
foreach ($array as $ds => $vars)
{
$rrd_list[$i]['filename'] = $rrd_filename;
if (is_array($vars))
{
$rrd_list[$i]['descr'] = $vars['descr'];
} else {
$rrd_list[$i]['descr'] = $vars;
if (is_file($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
if (is_array($vars)) {
$rrd_list[$i]['descr'] = $vars['descr'];
}
else {
$rrd_list[$i]['descr'] = $vars;
}
$rrd_list[$i]['ds'] = $ds;
$i++;
}
$rrd_list[$i]['ds'] = $ds;
$i++;
}
} else { echo("file missing: $file"); }
}
else {
echo "file missing: $file";
}
$colours = "mixed";
$colours = 'mixed';
$nototal = 0;
$unit_text = "Temp";
$unit_text = 'Temp';
include("includes/graphs/generic_multi_simplex_seperated.inc.php");
?>
require 'includes/graphs/generic_multi_simplex_seperated.inc.php';

View File

@@ -2,33 +2,45 @@
$scale_min = 0;
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-nginx-".$app['app_id'].".rrd";
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-nginx-'.$app['app_id'].'.rrd';
$array = array('Reading' => array('descr' => 'Reading', 'colour' => '750F7DFF'),
'Writing' => array('descr' => 'Writing', 'colour' => '00FF00FF'),
'Waiting' => array('descr' => 'Waiting', 'colour' => '4444FFFF'),
'Active' => array('descr' => 'Starting', 'colour' => '157419FF'),
);
$array = array(
'Reading' => array(
'descr' => 'Reading',
'colour' => '750F7DFF',
),
'Writing' => array(
'descr' => 'Writing',
'colour' => '00FF00FF',
),
'Waiting' => array(
'descr' => 'Waiting',
'colour' => '4444FFFF',
),
'Active' => array(
'descr' => 'Starting',
'colour' => '157419FF',
),
);
$i = 0;
if (is_file($rrd_filename))
{
foreach ($array as $ds => $vars)
{
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
$rrd_list[$i]['ds'] = $ds;
$rrd_list[$i]['colour'] = $vars['colour'];
$i++;
}
} else { echo("file missing: $file"); }
if (is_file($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
$rrd_list[$i]['ds'] = $ds;
$rrd_list[$i]['colour'] = $vars['colour'];
$i++;
}
}
else {
echo "file missing: $file";
}
$colours = "mixed";
$colours = 'mixed';
$nototal = 1;
$unit_text = "Workers";
$unit_text = 'Workers';
include("includes/graphs/generic_multi_simplex_seperated.inc.php");
?>
require 'includes/graphs/generic_multi_simplex_seperated.inc.php';

View File

@@ -1,25 +1,22 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-nginx-".$app['app_id'].".rrd";
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-nginx-'.$app['app_id'].'.rrd';
if (is_file($rrd_filename))
{
if (is_file($rrd_filename)) {
$rrd_options .= ' -b 1000 ';
$rrd_options .= ' -l 0 ';
$rrd_options .= ' DEF:a='.$rrd_filename.':Requests:AVERAGE';
$rrd_options .= " -b 1000 ";
$rrd_options .= " -l 0 ";
$rrd_options .= " DEF:a=".$rrd_filename.":Requests:AVERAGE";
$rrd_options .= " COMMENT:'Requests Current Average Maximum\\n'";
$rrd_options .= " COMMENT:'Requests Current Average Maximum\\n'";
$rrd_options .= " AREA:a#98FB98";
$rrd_options .= " LINE1.5:a#006400:'Requests '";
$rrd_options .= " GPRINT:a:LAST:'%6.2lf %s'";
$rrd_options .= " GPRINT:a:AVERAGE:'%6.2lf %s'";
$rrd_options .= " GPRINT:a:MAX:'%6.2lf %s\\n'";
} else {
$error_msg = "Missing RRD";
$rrd_options .= ' AREA:a#98FB98';
$rrd_options .= " LINE1.5:a#006400:'Requests '";
$rrd_options .= " GPRINT:a:LAST:'%6.2lf %s'";
$rrd_options .= " GPRINT:a:AVERAGE:'%6.2lf %s'";
$rrd_options .= " GPRINT:a:MAX:'%6.2lf %s\\n'";
}
else {
$error_msg = 'Missing RRD';
}
?>

View File

@@ -1,21 +1,18 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$scale_min = 0;
$ds = "frequency";
$colour_area = "F6F6F6";
$colour_line = "B3D0DB";
$colour_area_max = "FFEE99";
$ds = 'frequency';
$colour_area = 'F6F6F6';
$colour_line = 'B3D0DB';
$colour_area_max = 'FFEE99';
$graph_max = 100;
$unit_text = "Frequency";
$ntpclient_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-ntpclient-".$app['app_id'].".rrd";
$unit_text = 'Frequency';
$ntpclient_rrd = $config['rrd_dir'].'/'.$device['hostname'].'/app-ntpclient-'.$app['app_id'].'.rrd';
if (is_file($ntpclient_rrd))
{
$rrd_filename = $ntpclient_rrd;
if (is_file($ntpclient_rrd)) {
$rrd_filename = $ntpclient_rrd;
}
include("includes/graphs/generic_simplex.inc.php");
?>
require 'includes/graphs/generic_simplex.inc.php';

View File

@@ -1,34 +1,31 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$colours = "mixed";
$nototal = (($width<224) ? 1 : 0);
$unit_text = "Milliseconds";
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-ntpclient-".$app['app_id'].".rrd";
$colours = 'mixed';
$nototal = (($width < 224) ? 1 : 0);
$unit_text = 'Milliseconds';
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-ntpclient-'.$app['app_id'].'.rrd';
$array = array(
'offset' => array('descr' => 'Offset'),
'jitter' => array('descr' => 'Jitter'),
'noise' => array('descr' => 'Noise'),
'stability' => array('descr' => 'Stability')
);
'offset' => array('descr' => 'Offset'),
'jitter' => array('descr' => 'Jitter'),
'noise' => array('descr' => 'Noise'),
'stability' => array('descr' => 'Stability'),
);
$i = 0;
$i = 0;
if (is_file($rrd_filename))
{
foreach ($array as $ds => $vars)
{
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
$rrd_list[$i]['ds'] = $ds;
$rrd_list[$i]['colour'] = $config['graph_colours'][$colours][$i];
$i++;
}
} else {
echo("file missing: $file");
if (is_file($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
$rrd_list[$i]['ds'] = $ds;
$rrd_list[$i]['colour'] = $config['graph_colours'][$colours][$i];
$i++;
}
}
else {
echo "file missing: $file";
}
include("includes/graphs/generic_multi_line.inc.php");
?>
require 'includes/graphs/generic_multi_line.inc.php';

View File

@@ -1,35 +1,30 @@
<?php
// $units = "b";
// $total_units = "B";
// $colours_in = "greens";
//$multiplier = "0";
// $colours_out = "blues";
// $units = "b";
// $total_units = "B";
// $colours_in = "greens";
// $multiplier = "0";
// $colours_out = "blues";
$nototal = 1;
$nototal = 1;
$ds_in = 'packets_recv';
$ds_out = 'packets_sent';
$ds_in = "packets_recv";
$ds_out = "packets_sent";
$graph_title .= '::packets';
$unit_text = 'Packets';
$graph_title .= "::packets";
$unit_text = "Packets";
$colour_line_in = '330033';
$colour_line_out = 'FF6600';
$colour_area_in = 'AA66AA';
$colour_area_out = 'FFDD88';
$colour_area_in_max = 'CC88CC';
$colour_area_out_max = 'FFEFAA';
$colour_line_in = "330033";
$colour_line_out = "FF6600";
$colour_area_in = "AA66AA";
$colour_area_out = "FFDD88";
$colour_area_in_max = "CC88CC";
$colour_area_out_max = "FFEFAA";
$ntpdserver_rrd = $config['rrd_dir'].'/'.$device['hostname'].'/app-ntpdserver-'.$app['app_id'].'.rrd';
$ntpdserver_rrd = $config['rrd_dir'] . "/". $device['hostname'] . "/app-ntpdserver-".$app['app_id'].".rrd";
if (is_file($ntpdserver_rrd))
{
$rrd_filename = $ntpdserver_rrd;
if (is_file($ntpdserver_rrd)) {
$rrd_filename = $ntpdserver_rrd;
}
// include("includes/graphs/generic_bits.inc.php");
include("includes/graphs/generic_duplex.inc.php");
?>
// include("includes/graphs/generic_bits.inc.php");
require 'includes/graphs/generic_duplex.inc.php';

View File

@@ -1,34 +1,31 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$scale_min = 0;
$colours = "mixed";
$nototal = (($width<224) ? 1 : 0);
$unit_text = "Buffer";
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-ntpdserver-".$app['app_id'].".rrd";
$colours = 'mixed';
$nototal = (($width < 224) ? 1 : 0);
$unit_text = 'Buffer';
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-ntpdserver-'.$app['app_id'].'.rrd';
$array = array(
'buffer_recv' => array('descr' => 'Received'),
'buffer_used' => array('descr' => 'Used'),
'buffer_free' => array('descr' => 'Free')
);
'buffer_recv' => array('descr' => 'Received'),
'buffer_used' => array('descr' => 'Used'),
'buffer_free' => array('descr' => 'Free'),
);
$i = 0;
$i = 0;
if (is_file($rrd_filename))
{
foreach ($array as $ds => $vars)
{
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
$rrd_list[$i]['ds'] = $ds;
$rrd_list[$i]['colour'] = $config['graph_colours'][$colours][$i];
$i++;
}
} else {
echo("file missing: $file");
if (is_file($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
$rrd_list[$i]['ds'] = $ds;
$rrd_list[$i]['colour'] = $config['graph_colours'][$colours][$i];
$i++;
}
}
else {
echo "file missing: $file";
}
include("includes/graphs/generic_multi_line.inc.php");
?>
require 'includes/graphs/generic_multi_line.inc.php';

View File

@@ -1,21 +1,18 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$scale_min = 0;
$ds = "frequency";
$colour_area = "F6F6F6";
$colour_line = "B3D0DB";
$colour_area_max = "FFEE99";
$ds = 'frequency';
$colour_area = 'F6F6F6';
$colour_line = 'B3D0DB';
$colour_area_max = 'FFEE99';
$graph_max = 100;
$unit_text = "Frequency";
$ntpdserver_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-ntpdserver-".$app['app_id'].".rrd";
$unit_text = 'Frequency';
$ntpdserver_rrd = $config['rrd_dir'].'/'.$device['hostname'].'/app-ntpdserver-'.$app['app_id'].'.rrd';
if (is_file($ntpdserver_rrd))
{
$rrd_filename = $ntpdserver_rrd;
if (is_file($ntpdserver_rrd)) {
$rrd_filename = $ntpdserver_rrd;
}
include("includes/graphs/generic_simplex.inc.php");
?>
require 'includes/graphs/generic_simplex.inc.php';

View File

@@ -1,34 +1,36 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$scale_min = 0;
$nototal = (($width<224) ? 1 : 0);
$unit_text = "Packets";
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-ntpdserver-".$app['app_id'].".rrd";
$nototal = (($width < 224) ? 1 : 0);
$unit_text = 'Packets';
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-ntpdserver-'.$app['app_id'].'.rrd';
$array = array(
'packets_drop' => array('descr' => 'Dropped', 'colour' => '880000FF'),
'packets_ignore' => array('descr' => 'Ignored', 'colour' => 'FF8800FF')
);
'packets_drop' => array(
'descr' => 'Dropped',
'colour' => '880000FF',
),
'packets_ignore' => array(
'descr' => 'Ignored',
'colour' => 'FF8800FF',
),
);
$i = 0;
$i = 0;
if (is_file($rrd_filename))
{
foreach ($array as $ds => $vars)
{
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
$rrd_list[$i]['ds'] = $ds;
$rrd_list[$i]['colour'] = $vars['colour'];
$i++;
}
} else {
echo("file missing: $file");
if (is_file($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
$rrd_list[$i]['ds'] = $ds;
$rrd_list[$i]['colour'] = $vars['colour'];
$i++;
}
}
else {
echo "file missing: $file";
}
// include("includes/graphs/generic_multi_line.inc.php");
include("includes/graphs/generic_multi_simplex_seperated.inc.php");
?>
// include("includes/graphs/generic_multi_line.inc.php");
require 'includes/graphs/generic_multi_simplex_seperated.inc.php';

View File

@@ -1,34 +1,31 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$colours = "mixed";
$nototal = (($width<224) ? 1 : 0);
$unit_text = "Milliseconds";
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-ntpdserver-".$app['app_id'].".rrd";
$colours = 'mixed';
$nototal = (($width < 224) ? 1 : 0);
$unit_text = 'Milliseconds';
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-ntpdserver-'.$app['app_id'].'.rrd';
$array = array(
'offset' => array('descr' => 'Offset'),
'jitter' => array('descr' => 'Jitter'),
'noise' => array('descr' => 'Noise'),
'stability' => array('descr' => 'Stability')
);
'offset' => array('descr' => 'Offset'),
'jitter' => array('descr' => 'Jitter'),
'noise' => array('descr' => 'Noise'),
'stability' => array('descr' => 'Stability'),
);
$i = 0;
$i = 0;
if (is_file($rrd_filename))
{
foreach ($array as $ds => $vars)
{
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
$rrd_list[$i]['ds'] = $ds;
$rrd_list[$i]['colour'] = $config['graph_colours'][$colours][$i];
$i++;
}
} else {
echo("file missing: $file");
if (is_file($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
$rrd_list[$i]['ds'] = $ds;
$rrd_list[$i]['colour'] = $config['graph_colours'][$colours][$i];
$i++;
}
}
else {
echo "file missing: $file";
}
include("includes/graphs/generic_multi_line.inc.php");
?>
require 'includes/graphs/generic_multi_line.inc.php';

View File

@@ -1,21 +1,18 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$scale_min = 0;
$ds = "stratum";
$colour_area = "FFCECE";
$colour_line = "880000";
$colour_area_max = "FFCCCC";
$ds = 'stratum';
$colour_area = 'FFCECE';
$colour_line = '880000';
$colour_area_max = 'FFCCCC';
$graph_max = 0;
$unit_text = "Stratum";
$ntpdserver_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-ntpdserver-".$app['app_id'].".rrd";
$unit_text = 'Stratum';
$ntpdserver_rrd = $config['rrd_dir'].'/'.$device['hostname'].'/app-ntpdserver-'.$app['app_id'].'.rrd';
if (is_file($ntpdserver_rrd))
{
$rrd_filename = $ntpdserver_rrd;
if (is_file($ntpdserver_rrd)) {
$rrd_filename = $ntpdserver_rrd;
}
include("includes/graphs/generic_simplex.inc.php");
?>
require 'includes/graphs/generic_simplex.inc.php';

Some files were not shown because too many files have changed in this diff Show More