DataPower

 View Only

 How to filter by Object to send email for an SFTP failure

Bichu's profile image
Bichu posted Wed December 11, 2024 08:53 AM

Hi Everyone,

I’m working with an SFTP poller handler (let’s call it PollerA) that’s been having issues accessing files from a remote server. The remote server’s admin wants to check the logs when an error occurs, so I need to send an email notification whenever there’s an error. Here’s what I’ve done so far:

  1. Created a log target with Target type SMTP and configured it under the Main tab.
  2. Added the code 0x80e000c8 under the Event subscription filter.
  3. Set the Event category to ssh and the Minimum event priority to error.

I receive an email when I simulate an error, but I want to filter the notifications specifically for PollerA. I tried setting the Object type to SFTPFilePollerSourceProtocolHandler (the closest match for SFTP) and specifying the object name as PollerA, but then I’m no longer receiving any emails. I also tried leaving the object name blank, but still no luck.

Does anyone have any ideas on how to achieve this?

Thanks in advance!

Joseph Morgan's profile image
Joseph Morgan

When the event code '0x80e000c8' is published, which is the object type and name published with it?

 

Joseph Morgan's profile image
Joseph Morgan

A suggestion for an alternative, because if 0x80e000c8 doesn't publish the poller as the offender, your object type/name filter won't work.   You may can find other event code on which to filter for the specific poller when the error occurs, and that may work best.

However, when I'm seeking exact detail like this, I tend to set up a custom log category and then, within my processing policy (error rule maybe?) define a log action (or log from within an xslt or GWS if you need to get very specific) on a particular error condition (in your case, when error code 0x80e000c8 occurs) to log to that log category when PollerA is the offender.  Then, you can configure your logging target to subscribe to that custom category and send emails far more directly. 

Bichu's profile image
Bichu

@Joseph Morgan,
I could see in the log where the object name is mentioned as SFTP Poller Name exactly. I wanted to avoid adding a custom log category and an error action as our framwork is more common for all SFTP inputs feeding to B2B transactions.

Joseph Morgan's profile image
Joseph Morgan

Bichu,

Something is different about the site this morning.  

It seems like what you did should work.  Have you attempted to remove the event code from the filters and just filter by object type/name?

Bichu's profile image
Bichu

@Joseph Morgan,
I figured out this out. The culprit was the Event category under Event Subscriptions. I changed it from ssh to file-poller and then the filter worked with the Object Filters added for Poller A. Thanks for your time!

Bichu's profile image
Bichu

But wondering now whether we have the option to add multiple email address in Recipient email address under Log Target. Tried with comma(,), semicolon(;), space and ampersand(&) but no luck yet. Any idea?

Amit Munwes's profile image
Amit Munwes

If you can't make it work with the log target, and if you use DPOD, an alternative is to utilize DPOD alerts. Since it collects all the logs (and much more) from the gateway, you can send an alert on any condition (e.g.: more than 15 log messages in the last 5 minutes with message code "0x80e000c8" that don't include the text "1.2.3.4", etc.). Alerts can be sent via email (with multiple addresses), send an HTTP request, Syslog, etc.

Joseph Morgan's profile image
Joseph Morgan

It's been a long time since I've used the SMTP log target type, as in a large environment, you could wake up to 10,000 emails.  

I think you'll need to use something like a distribution group to get it to multiple people.