[Solved] Creating a custom graph

Pretty sure I followed everything in the docs for creating a custom graph, but I’m seeing nothing. I want to add a graph for total current APM connections on an F5 which is apmAccessStatCurrentActiveSessions.0 in the F5-BIGIP-APM-MIB. Where do I start troubleshooting this?

In mysql I have:
| device | apm_sessions | system | Active Sessions | 0 |

I added to the bottom of config.php:
// F5 APM graphs
$config[‘graph_types’][‘device’][‘apm_sessions’][‘section’] = ‘system’;
$config[‘graph_types’][‘device’][‘apm_sessions’][‘order’] = ‘0’;
$config[‘graph_types’][‘device’][‘apm_sessions’][‘descr’] = ‘Active Sessions’;

I created includes/polling/os/f5_apm.inc.php :

Preformatted text <?php

use LibreNMS\RRD\RrdDefinition;

$sessions = snmp_get($device, ‘apmAccessStatCurrentActiveSessions.0’, ‘-OQv’, ‘F5-BIGIP-APM-MIB’);

if (is_numeric($sessions)) {
$rrd_def = RrdDefinition::make()->addDataset(‘sessions’, ‘GAUGE’, 0);

$fields = array(
    'sessions' => $sessions,
);

$tags = compact('rrd_def');
data_update($device, 'apm_sessions', $tags, $fields);
$graphs['apm_sessions'] = true;

}Preformatted text

and html/includes/graphs/device/apm_sessions.inc.php:
Preformatted text<?php

$rrd_filename = rrd_name($device[‘hostname’], ‘apm_sessions’);

require ‘includes/graphs/common.inc.php’;

$ds = ‘sessions’;

$colour_area = ‘9999cc’;
$colour_line = ‘0000cc’;

$colour_area_max = ‘9999cc’;

$graph_max = 1;
$graph_min = 0;

$unit_text = ‘Sessions’;

require ‘includes/graphs/generic_simplex.inc.php’;Preformatted text

You’re probably better off submitting a pull request. You’ve basically just pasted a bunch of code in plain text and it’s really difficult to read.

Submitted pull requests for the relevant files - I think I got them all.

I put the pull request in github - I would very much appreciate it if anyone had a chance to take a quick look at the files and let me know what might be wrong…

I have submitted a new pull request, although I still have a problem - whilst I now have the apm graph section, with graphs, there is no data in them. I can pull the data manually, so I can’t see what is wrong with with my OS polling. Any ideas would be gratefully received and thanks for the pointers that have got me this far.

The data is being collected - If I click on one of the graphs and then select Bigip_apm_curr_sessions from the dropdown in the upper right, I have the graph. What am I missing from setup for having them on the main page?

Eventually solved - the device name is important and changing the name from the arbitrary f5_apm_sessions to bigip_apm_sessions got everything working.