Could we change the logic from "AND" into "OR" on Cisco remote access monitoring detection?

Hi team,

I just notice that we use “AND” logic in “/opt/librenms/includes/polling/” and it will cause issue if some model didn’t support one of feature in this methdology.

if (is_numeric($data[‘crasEmailNumSessions’]) && is_numeric($data[‘crasIPSecNumSessions’]) && is_numeric($data[‘crasL2LNumSessions’]) && is_numeric($data[‘crasLBNumSessions’]) && is_numeric($data[‘crasSVCNumSessions’]) && is_numeric($data[‘crasWebvpnNumSessions’]))

Is it possible change the logic from “AND” into “OR”, and create the corresponding description on the graph?

The clean solution would be to have one RRD per variable, but that would break history graph for current users.

You can send nulls for missing values. @zexinfinite Make a pull request with your change and we will review it.

Hi Murrant,

Sorry, I didn’t get your point and it’s a little bit difficult to change function in the script, because I’m not a programmer. Maybe I can have a try to edit it and make PR for your review.

Do you mean we need to add new expression and identify is there have any unsupported feature and send nulls before we create RRD definition?

if ($device[‘os_group’] == ‘cisco’) {
$oid_list = [‘crasEmailNumSessions.0’, ‘crasIPSecNumSessions.0’, ‘crasL2LNumSessions.0’, ‘crasLBNumSessions.0’, ‘crasSVCNumSessions.0’, 'crasWeb$
$data = snmp_get_multi($device, $oid_list, ‘-OUQs’, ‘CISCO-REMOTE-ACCESS-MONITOR-MIB’);
$data = $data[0];

================ Add expression here? ================

if (is_numeric($data['crasEmailNumSessions']) || is_numeric($data['crasIPSecNumSessions']) || is_numeric($data['crasL2LNumSessions']) || is_nume$
    $rrd_def = RrdDefinition::make()
        ->addDataset('email', 'GAUGE', 0)
        ->addDataset('ipsec', 'GAUGE', 0)
        ->addDataset('l2l', 'GAUGE', 0)
        ->addDataset('lb', 'GAUGE', 0)
        ->addDataset('svc', 'GAUGE', 0)
        ->addDataset('webvpn', 'GAUGE', 0);

If you aren’t comfortable as is, that is fine. But I would still like to get test data from you so we can change the code later without breaking it on accident.

I will try to add support to collect data for this module, but I still need you to collect the snmp data. I can walk you through it on Discord sometime.

Hi Murrant,

Please find below result for “crasEmailNumSessions” with OID “” and “crasSVCNumSessions” with OID “”.

You can see didn’t support “crasEmailNumSessions” query, so it will occur error with existing module.

[[email protected]:~]$ snmpwalk -v 2c -c public
SNMPv2-SMI::enterprises.9.9.392.1.3.23 = No Such Object available on this agent at this OID
[[email protected]:~]$ snmpwalk -v 2c -c public
SNMPv2-SMI::enterprises.9.9.392. = Gauge32: 11
[[email protected]:~]$ snmpwalk -v 2c -c public
SNMPv2-SMI::enterprises.9.9.392. = Gauge32: 0
[[email protected]:~]$ snmpwalk -v 2c -c public
SNMPv2-SMI::enterprises.9.9.392. = Gauge32: 41