You are not logged in.

#1 2015-03-17 13:23:25

piwwo
Member
Registered: 2013-05-15
Posts: 35

Journald email notification

Hello

According to
http://serverfault.com/questions/32360/ … ages-to-me
it is possible to use syslog to send email notification on certain log events using something like

local1.err    |while read log; do echo "$log" | /usr/bin/mail -s SYSLOG me@example.com; done

in syslog.conf

How would it be possible to do the same or similar with journald, preferred without cron but event based instead?

Greetings

Offline

#2 2015-03-18 12:52:56

piwwo
Member
Registered: 2013-05-15
Posts: 35

Re: Journald email notification

Anyone? Is this even possible?

Offline

#3 2015-03-18 12:56:10

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Journald email notification

Offline

#4 2015-03-18 13:31:26

piwwo
Member
Registered: 2013-05-15
Posts: 35

Re: Journald email notification

Hello

No, this seems not to be that. From the post:

journalwatch is a tool which can find error messages in the systemd journal.

I do not want to find error messages, I want to send an email when a certain event occurs in the syslog. Like in the serverfault post

local1.err    |while read log; do echo "$log" | /usr/bin/mail -s SYSLOG me@example.com; done

This supposed to send an email containing the log as soon as a local1.err event occurs.
This is supposed to work event-based not using cron or similar. I already thought about having a python script executing journalctl -t IDENTIFIER like all 5 minutes, checking the timestamp and sending an email as soon as a new event occurred. However I wanted to stay within systemd functionality if possible and use what it provides. I know that syslog was possible to send emails to admins, but systemd journal is not?

Offline

#5 2015-03-19 00:10:19

jjacky
Member
Registered: 2011-11-09
Posts: 347
Website

Re: Journald email notification

Maybe this could be of use?

Offline

#6 2015-03-19 09:05:26

piwwo
Member
Registered: 2013-05-15
Posts: 35

Re: Journald email notification

jjacky wrote:

Maybe this could be of use?

Hi

This seems to do something like what I could need too. Have you shown it to freedesktop because I find a tool like this is needed especially when you want to use systemd on servers, routers, NAS and similar devices. All my questions to them in this regard have so far not been answered. Maybe they focus a little too much on the desktop-linux for such a comprehensive reach in the system flow like systemd attempts.

Would be great if they could include your service into the official systemd project for that it becomes safe to use them on productive systems.

Offline

Board footer

Powered by FluxBB