I'm trying to scan my backup emails to see if they were successful. I have had success using the imap sensor and scanning the subject for certain words. However, when I try to scan the 'body' for certain words, it never finds the words even when they are most certainly contained within the email.
For example: Email subject: Alert Notification Email body contains phrase: Backup Operation Successful
I have the imap sensor set to identify by Subject Field: Alert Notification (which it successfully identifies) and the Set to Alarm If mail body does not contain: Backup Operation Successful
I even have a special error message 'Search text not found' that should appear if the body does not contain the specified text.
When the sensor runs, it fails saying 'Search text not found' but the email DOES have the text 'Backup Operation Successful' in the message.
What can the problem be? I'm using a basic 'String search' and the text is an exact match. I even tried searching the body for 'e' which is obviously in the message, but that still fails.
It seems body search does work for me but subject is fine. Does anyone know what the problem might be?
Article Comments
Our version is: 13.1.1.1182 x64. I didn't see it as a known issue in any version, but if it is known to be fixed in a newer version, we may upgrade sooner.
Dec, 2013 - Permalink
Please update to the current version 13.4.7 first, we recently fixed an issue with the IMAP Sensor on multi-part emails (most likely listed as "minor fix" in the version history).
Dec, 2013 - Permalink
We upgraded to 13.4.7.3706 x64 and our problem still exists.
I have also tried to setup a filecontent sensor, and it also cannot find strings that ARE in the file.
Interestingly, I have a similar email content sensor that DOES work correctly. It seems to be something with the email that causes the sensor to not scan correctly. Is there a certain structure emails must conform to for these sensors to work? The one that DOES work contains an email footer, but it doesn't look like this would be required to scan the 'body' of the email.
The email I'm trying to scan looks like: From: xyz@ourmail.com [mailto:xyz@ourmail.com] Sent: Wednesday, January 8, 2014 2:02 AM To: Oncall - Support Subject: Alert Notification
OTCAD1: [JobID:3218 AD LDS Backup - New] Backup Operation Successful.
And the sensor is set to 'fail if body does not contain': Backup Operation Successful The error thrown in this case will be: Search Text not Found
Each time it scans it fails with the error 'Search Text not Found' which should not be causing the failure.
If I change the sensor to scan for things in the subject, everything works perfectly, but in this case, we don't have the pass/fail criteria in the subject, so we need to scan the body.
Does anyone know why the email body scanning doesn't seem to work in my case? Any help would be appreciated. I assume our problem with the file content sensor is related as well.
Jan, 2014 - Permalink
Hello,
thank you very much for your KB-Post. May I ask, which exact version of PRTG are you using?
best regards
Dec, 2013 - Permalink