mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
docs: Update custom OS graphs doc to current standard. (#6837)
This commit is contained in:
committed by
Neil Lathwood
parent
572277bfaa
commit
c66f6c9704
@@ -27,10 +27,12 @@ We declare two specific graphs for users and sessions numbers. Theses two graphs
|
||||
```php
|
||||
<?php
|
||||
|
||||
use LibreNMS\RRD\RrdDefinition;
|
||||
|
||||
$users = snmp_get($device, 'iveConcurrentUsers.0', '-OQv', 'PULSESECURE-PSG-MIB');
|
||||
|
||||
if (is_numeric($users)) {
|
||||
$rrd_def = 'DS:users:GAUGE:600:0:U';
|
||||
$rrd_def = RrdDefinition::make()->addDataset('users', 'GAUGE', 0);
|
||||
|
||||
$fields = array(
|
||||
'users' => $users,
|
||||
@@ -44,7 +46,7 @@ if (is_numeric($users)) {
|
||||
$sessions = snmp_get($device, 'iveConcurrentUsers.0', '-OQv', 'PULSESECURE-PSG-MIB');
|
||||
|
||||
if (is_numeric($sessions)) {
|
||||
$rrd_def = 'DS:sessions:GAUGE:600:0:U';
|
||||
$rrd_def = RrdDefinition::make()->addDataset('sessions', 'GAUGE', 0);
|
||||
|
||||
$fields = array(
|
||||
'sessions' => $sessions,
|
||||
@@ -68,8 +70,8 @@ php includes/sql-schema/update.php
|
||||
Or put the SQL commands directly in Mysql or PhpMyadmin for our tests:
|
||||
|
||||
```php
|
||||
INSERT INTO `graph_types`(`graph_type`, `graph_subtype`, `graph_section`, `graph_descr`, `graph_order`) VALUES ('device', 'pulse_users', 'firewall', 'Active Users', '');
|
||||
INSERT INTO `graph_types`(`graph_type`, `graph_subtype`, `graph_section`, `graph_descr`, `graph_order`) VALUES ('device', 'pulse_sessions', 'firewall', 'Active Sessions', '');
|
||||
INSERT INTO `graph_types`(`graph_type`, `graph_subtype`, `graph_section`, `graph_descr`, `graph_order`) VALUES ('device', 'pulse_users', 'firewall', 'Active Users', 0);
|
||||
INSERT INTO `graph_types`(`graph_type`, `graph_subtype`, `graph_section`, `graph_descr`, `graph_order`) VALUES ('device', 'pulse_sessions', 'firewall', 'Active Sessions', 0);
|
||||
```
|
||||
|
||||
#### Displaying
|
||||
|
||||
Reference in New Issue
Block a user