Cisco ASA not showing number of remote sessions - explanation + possible fix

LNMS has code to poll and graph the number of remote sessions terminated on the Cisco ASA firewall.

LNMS expects to receive the following OIDS:
$oid_list = [‘crasEmailNumSessions.0’, ‘crasIPSecNumSessions.0’, ‘crasL2LNumSessions.0’, ‘crasLBNumSessions.0’, ‘crasSVCNumSessions.0’, ‘crasWebvpnNumSessions.0’];

It is not obvious to me what crasEmailNumSessions does in that list, but there may be a perfectly good reason for it. I do not know.

What I do know is that my ASAv running 9.12(3) returns:
‘crasEmailNumSessions.0 = No Such Object available on this agent at this OID’.

And this causes the relevant RRD to not be generated or populated. No data, no graph. Fixing that, the code generating the graphs barfs on the missing data in the RRD file. So that too needs a bit of surgery.

So, for me, this fixes it:

Is this a bug in LNMS, or did Cisco change something? Something not enabled on our ASA? Not sure.

Doesn’t mean it’s never returned on some older versions so may be better to remove the is_numeric() check in the polling code for that OID.

Yes, it is likelly there for a reason, as I said. I’ll cook a patch which covers both variants.

diff --git a/includes/polling/cisco-remote-access-monitor.inc.php b/includes/polling/cisco-remote-access-monitor.inc.php
index 8236358..7f78128 100644
- - - a/includes/polling/cisco-remote-access-monitor.inc.php
+++ b/includes/polling/cisco-remote-access-monitor.inc.php
@@ -37,7 +37,7 @@ if ($device['os_group'] == 'cisco') {
     $data     = snmp_get_multi($device, $oid_list, '-OUQs', 'CISCO-REMOTE-ACCESS-MONITOR-MIB');
     $data     = $data[0];
 
-    if (is_numeric($data['crasEmailNumSessions']) && is_numeric($data['crasIPSecNumSessions']) && is_numeric($data['crasL2LNumSessions']) && is_numeric($data['crasLBNumSessions']) && is_numeric($data['crasSVCNumSessions']) && is_numeric($
+    if (is_numeric($data['crasIPSecNumSessions']) && is_numeric($data['crasL2LNumSessions']) && is_numeric($data['crasLBNumSessions']) && is_numeric($data['crasSVCNumSessions']) && is_numeric($data['crasWebvpnNumSessions'])) {
         $rrd_def = RrdDefinition::make()
             ->addDataset('email', 'GAUGE', 0)
             ->addDataset('ipsec', 'GAUGE', 0)
@@ -46,6 +46,8 @@ if ($device['os_group'] == 'cisco') {
             ->addDataset('svc', 'GAUGE', 0)
             ->addDataset('webvpn', 'GAUGE', 0);
 
+       if (!is_numeric($data['crasEmailNumSessions'])) { $data['crasEmailNumSessions'] = 0; }
+
         $fields = array(
             'email'   => $data['crasEmailNumSessions'],
             'ipsec'   => $data['crasIPSecNumSessions'],

Actually you might just be able to do:

$data['crasEmailNumSessions'] = set_numeric($data['crasEmailNumSessions']);

Instead of if (!is_numeric($data['crasEmailNumSessions'])) { $data['crasEmailNumSessions'] = 0; }

set_numeric does not appear to be a php function?