What's new

Scribe Logging Mesh nodes - Scribe 3.03

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

aex.perez

Senior Member
So, followed the instructions here:
https://www.snbforums.com/threads/feature-to-support-aimesh-node-s-log.69868/

But I'm pretty sure I messed something up doing this as the logs from the mesh nodes (MasterBedroom and Bedroom) as well as the router are all intertwined both in UIScribe as well as the individual log files on /opt/var/log
Everything documented in the link above for the mesh nodes I did replacing the name "MeshBasement" with the hostname of the node specifically for each node (MasterBedroom and Bedroom). The names show up correctly but the mesh nodes logs show in each others logs (MasterBedroom in MesterBedroom.log and Bedroom.log, as well as Bedroom in MasterBedroom.log and Bedroom.log) . In the system log, Its the router and the individual mesh nodes (Router, Bedroom and MasterBedroom).

I've must've reviewed my steps a dozen times, but can't find what step(s) I missed/messed up
Any guidance on what I missed to get each in their own log?
 
So, followed the instructions here:
https://www.snbforums.com/threads/feature-to-support-aimesh-node-s-log.69868/

But I'm pretty sure I messed something up doing this as the logs from the mesh nodes (MasterBedroom and Bedroom) as well as the router are all intertwined both in UIScribe as well as the individual log files on /opt/var/log
Everything documented in the link above for the mesh nodes I did replacing the name "MeshBasement" with the hostname of the node specifically for each node (MasterBedroom and Bedroom). The names show up correctly but the mesh nodes logs show in each others logs (MasterBedroom in MesterBedroom.log and Bedroom.log, as well as Bedroom in MasterBedroom.log and Bedroom.log) . In the system log, Its the router and the individual mesh nodes (Router, Bedroom and MasterBedroom).

I've must've reviewed my steps a dozen times, but can't find what step(s) I missed/messed up
Any guidance on what I missed to get each in their own log?
I hunted for what you were referring to and I guess it is this:
Code:
# MeshBasement - log all AI Mesh (Basement) logs to /opt/var/log/MeshBasement.log

destination d_MeshBasement {
    file("/opt/var/log/MeshBasement.log");
};

log {
    source(net);
    destination(d_MeshBasement);
#    flags(final);
};
This isn't going to work for you, because it sends everything from a net source (your nodes) to that destination. The # before flags(final) means that the message is then passed on and ends up in your system log.

If you want to sort each node into its own log, then you need to create a filter, a destination and a log statement for each node, each like this:

Code:
destination d_MasterBedroom {
 file("/opt/var/log/MasterBedroom.log");
};

filter f_MasterBedroom{
host("MasterBedroom");
};

log {
source(net);
filter(f_MasterBedroom);
destination(d_MasterBedroom);
flags(final);
}
You can put all three in the same file. Every message from outside the router will pass through the three logging statements in order; if it matches the filter, then it will get sent to the destination file and further processing stops, and if it doesn't, it goes on to the next logging statement, and if it doesn't match any of them, on to messages.

EDITED: to fix typo in code
 
Last edited:
My first attempt with using a filter didn't fair so well, seeing yours I was missing host("meshnode"). Copying and pasting yours into two files (after adding the ") made scribe very unhappy.

Gonna try it again with a slight variation
 
nope, not happy

Result:
reloading syslog-ng.conf ... Syntax error parsing configuration file, previous config remained intact

Restarting uiScribe ...Error parsing log statement, syntax error, unexpected KW_DESTINATION, expecting ';' in /opt/etc/syslog-ng.d/Bedroom:14:5-14:16:
9 };
10
11 log {
12 source(net);
13 filter(f_Bedroom)
14----> destination(d_Bedroom);
14----> ^^^^^^^^^^^
15 # flags(final);
16 };


New:
destination d_Bedroom {
file("/opt/var/log/Bedroom.log");
};

filter f_Bedroom{
host("Bedroom");
};


log {
source(net);
filter(f_Bedroom)
destination(d_Bedroom);
# flags(final);
};

Old:
destination d_Bedroom {
file("/opt/var/log/Bedroom.log");
};

log {
source(net);
destination(d_Bedroom);
# flags(final);
};
 
What would be the chances of MasterBedroom and Bedroom confilcting and by renaning the node and all subsequent files that it begins to work all of a sudden. Now I can turn off / on each log within UIScribe where before I could not turn Bedroom back on from the GUI (only from the command line) - Once I renamed the node, no more error now to see if the filters work
 
If you leave it with "# flags(final), the message will continue to be processed and end up in the system log. If you delete the "#", it won't go to the system log.
What would be the chances of MasterBedroom and Bedroom confilcting
Good point. message() and host() are triggered if the sequence is found, so both nodes would match both filters.
 
Bingo!

After renaming and removing the # from #flags(final), and a scribe restart on all three everything working perfectly. The renaming of the nodes driven by uiscribe (when trying to deselect one it would deselect both and one renable one vis gui, both via SSH) and scribe (when rl) was the initial trigger that got it working, then the aha moment kicked in once the filter started to work to get rid of the #. Been playing with this for a couple of days, and didn't realize with MasterBedroom and Bedroom there would be a conflict. I had this working in a previous version of firmware and decided to redo it. The nodes had much more unique names back then. Me trying to make it simpler, created a different problem.

Live and Learn...
 
Last edited:

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top