I am not following you when you say "a new syslog message just 2 code lines
after the evaluated True messages." Does that mean you have something like
this:
# Log it
syslog.syslog(syslog.LOG_INFO, "alarm: Alarm expression \"%s\"
evaluated True at %s" % (self.expression, t_str))
# Form the message text:
msg_text = "Alarm expression \"%s\" evaluated True at
%s\nRecord:\n%s" % (self.expression, t_str, str(rec))
# Convert to MIME:
msg = MIMEText(msg_text)
syslog.syslog(syslog.LOG_INFO, "New logging message")
# Fill in MIME headers:
msg['Subject'] = self.SUBJECT
msg['From'] = self.FROM
msg['To'] = ','.join(self.TO)
If so, and you got the expected email message, then I am totally mystified
as to why the other log messages did not appear.
-tk
On Mon, Feb 12, 2018 at 7:30 AM, Jesper <[email protected]> wrote:
>
> Thanks for the new version of alarm.py. Unfortunately it didn't change the
> function. Syslog file is attached. I have tried to include a new syslog
> message just 2 code lines after the evaluated True messages. Result nothing
> in the syslog. After that the email facility in Python was test with a
> positive result. The expected email was received.
>
> I have also tried to change the time_wait constant, but realized that
> alarm is only reported when archive records are generated.
>
> Jesper
>
>>
>>
>
>