mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Include to read graphs from the graph_types table
This commit is contained in:
22
includes/load_db_graph_types.inc.php
Normal file
22
includes/load_db_graph_types.inc.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/*
|
||||
* LibreNMS dynamic graph types
|
||||
*
|
||||
* Copyright (c) 2015 Gear Consulting Pty Ltd <github@libertysys.com.au>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
// load graph types from the database
|
||||
foreach (dbFetchRows('select * from graph_types') as $graph) {
|
||||
// remove leading 'graph_' from column names
|
||||
foreach ($graph as $k => $v) {
|
||||
$key = strpos($k, 'graph_') == 0 ? str_replace('graph_', '', $k) : $k;
|
||||
$g[$key] = $v;
|
||||
}
|
||||
$config['graph_types'][$g['type']][$g['subtype']] = $g;
|
||||
}
|
||||
Reference in New Issue
Block a user