How to Monitor Juniper Firewall Filter Counter

Hello Everyone,

I’m trying to generate the graph of Juniper firewall filter counter like Cacti does. I tried to add OID by using the custom OID page from community and Nagios plugin, but both failed to generate Bits graph.

Juniper Firewall Filter OID

  • .1.3.6.1.4.1.2636.3.5.2.1.4 contains your counters packets
  • .1.3.6.1.4.1.2636.3.5.2.1.5 contains your counters bytes
  • .1.3.6.1.4.1.2636.3.5.2.1.6 contains your filter names
  • .1.3.6.1.4.1.2636.3.5.2.1.7 contains your counter names

Is it have the chance to add the Discovery Modules or plug the this OID to default port snmp discovery?

Are there any suggest and method of it?

Thanks.

I have found that this OID is contain in “JUNIPER-FIREWALL-MIB”.

However, can I know how to add this content to database and gen the graph?

Thanks!

Custom Graph can follow this link to add.
https://docs.librenms.org/Developing/os/Custom-Graphs/

How can I add this OID to database?

Anyone can help? Thanks!!!

Just a little update of my failed testing

I have try to add the custom graph. After rerun poller.php -h HOSTNAME -d , there is still noting update.

How can I verify my config ?

vi /opt/librenms/includes/definitions.inc.php

// Juniper Firewall Counter
$config['graph_types']['device']['junos_firewall_count']['section'] = 'network';
$config['graph_types']['device']['junos_firewall_count']['order'] = '0';
$config['graph_types']['device']['junos_firewall_count']['descr'] = ‘Count’;

vi /opt/librenms/includes/ polling/ports/junos-fwc.inc.php

<?php

use LibreNMS\RRD\RrdDefinition;

$requests = snmp_get($device, 'jnxFirewallCounterEntry.0’, '-OQv', 'PULSESECURE-PSG-MIB'); //JUNIPER-FIREWALL-MIB

if (is_numeric($requests)) {
    $rrd_def = RrdDefinition::make()->addDataset('requests', 'GAUGE', 0);

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

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

vi /opt/librenms/html/includes/ graphs/port/junos_firewall_count.inc.php

<?php

$rrd_filename = rrd_name($device['hostname'], 'junos_firewall_count'); //

require 'includes/graphs/common.inc.php';

$ds = 'requests';

$colour_area = '9999cc';

$colour_line = '0000cc';

$colour_area_max = '9999cc';

$graph_max = 1;

$graph_min = 0;

$unit_text = 'requests';

require 'includes/graphs/generic_simplex.inc.php';

Many thanks for help!