LinuxMCE Forums

General => Users => Topic started by: brononius on October 08, 2013, 02:33:31 pm

Title: Events log
Post by: brononius on October 08, 2013, 02:33:31 pm
Hey,

Is there somewhere a way to see all 'triggered' events?
From time to time, i'm wondering when this or that happened, so it would be nice that this could be seen in a kind of log file.
Title: Re: Events log
Post by: Marie.O on October 08, 2013, 04:45:03 pm
That stuff can be observed in /var/log/pluto/dcerouter.log
Title: Re: Events log
Post by: brononius on October 09, 2013, 09:22:10 am
Is there sometimes a 'special' parameter that I can use to filter out specific things?


The end idea is to have a list of events around the house. Let's call it a more 'human' list.
My girlfriend will never read logfiles, and i expect that most of the people will not do this.
I think that a more userfriendly loglist would be a step in the right direction to open up the system to everyone.

fe
Title: Re: Events log
Post by: Marie.O on October 09, 2013, 11:06:41 am
What I do, if I really want to see the triggered events, I use grep on a log file. If I want to see the current status of a light etc, I look at the floorplan. imho there is no need for anything in-between. Either I really want to see nitty gritty details, or I want to see what the current status is.

For security events, there is always the Security / Alert Log in the web admin.
Title: Re: Events log
Post by: brononius on October 09, 2013, 11:13:56 am
Just a thought, but it would be a nice feature that a kind of log-level could be created.

fe
loglevel 12: all details (all below + debug)
loglevel 10: system stuff (all below + system alerts)
loglevel 7: external triggers (all below + incoming calls and so)
loglevel 6: user triggers (all below + manual push of lights and so)
...

But I think that this will be a huge change to the systems, no?  :-\

So I guess that I'll see to create a kind of script that keeps an eye on the dcerouter.log and that copies some info to another log file...
Or if there are other suggestions, let me know...
Title: Re: Events log
Post by: Marie.O on October 09, 2013, 11:52:06 am
We already have loglevel. Search for LV_STATUS in the wiki, to get a list of different settings, and modify /etc/pluto.conf accordingly.
Title: Re: Events log
Post by: brononius on October 11, 2013, 03:09:15 pm
Based on this, i've created a small script that follows the logs, and put the most important info (for me) into a seperate log file.
Below you can find to commands. One to log the 'tripped sensors', and one to log the phonecalls. I'll see if i can find other intresting things to have in my 'filtered events log'.

Code: [Select]
#Log the triggered events
tail -f /var/log/pluto/DCERouter.log | awk '/Sensor Tripped/ {sub(/\(/,"",$8); sub(/)/,"",$12); sub(/Event:/,"",$22); sub(/,/,"",$23);print strftime("%Y-%m-
%d %H:%M:%S")," - Sensors: ",$8,$9,$10,$11,$12," - ",$22,$23 | "tee -a /var/log/events.log"}' &

#Log the phonecalls
tail -f /var/log/asterisk/full | awk '/Call completed to/ {sub(/Local\/0/,"",$9); sub(/@trusted/,"",$9);print strftime("%Y-%m-%d %H:%M:%S")," - Phone:", $6,
 $7, $8, $9 | "tee -a /var/log/events.log"}' &

This will return you following log:
more /var/log/events.log
Quote
2013-10-11 14:31:19  - Sensors:  K Sonar1 10x / FrontDoor  -  Sensor Tripped
2013-10-11 14:35:30  - Sensors:  K Button1 2x / Kitchen  -  Sensor Tripped
2013-10-11 14:35:30  - Sensors:  K Button1 1x / LivingRoom  -  Sensor Tripped
2013-10-11 15:06:20  - Phone: Call completed to 01534855


If you want to use it, it's possible that you'll need to change some parameters (like $8,$9,$10...). This is a first version, so it's rather 'raw' for my own intrest.