CIFS Errors by User

triggers

#1

Our CIFS module gives you the ability to look at CIFS error messages, and list the IPs of the endstation that received the error, but no way to correlate the two. Using the trigger below and overloading the key, you can achieve this:

First, check to see if there is an error:

if (CIFS.error != null) {

If there is an error, load the error message and client IP into variables, and add them together:

           var error = CIFS.error; 
           var clientAddress = Flow.client.ipaddr;
           var clientanderror = clientAddress + " : " + error;  

Next add a counter, and put the overloaded variable into a details counter:

           Device.metricAddCount("cifs_error_count", 1);                                          
           Device.metricAddDetailCount("cifs_error_count_detail", clientanderror, 1); 
      }

The result is the ability to match up the error message with the client that received it:

To incorporate a host name and the file associated with the error, try the following:

if (CIFS.error != null) {
   var error = CIFS.error; 
   var file = CIFS.resource;
   var clientAddress = Flow.client.ipaddr || 'No Client IP';
   var clientDevice = Flow.client.device.cdpName || Flow.client.device.dhcpName || Flow.client.device.netbiosName || Flow.client.device.dnsNames[0] || 'No Hostname';
   var clientanderror = 'IP: ' + clientAddress + ' || Host: ' + clientDevice + ' || Error: ' + error + ' || File: ' + file;

   Device.metricAddCount("cifs_error_count", 1);                                          
   Device.metricAddDetailCount("cifs_error_count_detail", clientanderror, 1); 
}