https://developer.ridgerun.com/wiki/api.php?action=feedcontributions&user=Jhidalgo&feedformat=atomRidgeRun Developer Wiki - User contributions [en]2024-03-28T21:40:30ZUser contributionsMediaWiki 1.40.0https://developer.ridgerun.com/wiki/index.php?title=How_to_Configure_Remote_Syslog_Logging&diff=1363How to Configure Remote Syslog Logging2010-09-06T21:01:12Z<p>Jhidalgo: /* General Information */</p>
<hr />
<div>== General Information ==<br />
<br />
'''syslogd''' is the Linux system logging utility that take manages files in the <tt>/var/log</tt> directory.<br />
<br />
On a typical desktop system, logging produced by local application and is saved to files on the local drive. But syslog can also be configured to receive logging from a remote client, or to send logging information to a remote syslog server.<br />
<br />
This ''How to'' gives the basic procedure for configuring a remote syslog server (e.g. your Ubuntu desktop PC) and a client (e.g. your target hardware running a RidgeRun SDK produced file system).<br />
<br />
Commands to be run on the <span style="background:#FFFF00">Ubuntu host</span> have a yellow background. Commands to be run on the <span style="background:#00FFFF">Ubuntu target</span> have an aqua background. <br />
<br />
<br />
=== Configuring host PC syslogd server ===<br />
<br />
The changes on this side are minimal. Basically you have to tell syslogd to listen for remote messages. To enable your host computer's syslogd server to accept log data from a remote client, you need to edit the file <tt>/etc/default/syslogd</tt> and set<br />
<br />
<pre style="background:#FFFF00"><br />
SYSLOGD="-r" <br />
</pre><br />
<br />
Save the file and restart '''syslogd''' by doing: <br />
<br />
<pre style="background:#FFFF00"><br />
sudo /etc/init.d/syslogd restart <br />
</pre><br />
<br />
You host syslogd server will now accept remove log messages.<br />
<br />
=== Configuring Busybox syslogd to send messages to remote logging service ===<br />
<br />
==== Manual steps to verify functionality ====<br />
<br />
On your target hardware verify syslogd is not running<br />
<br />
<pre style="background:#00FFFF"><br />
killall -9 syslogd<br />
</pre><br />
<br />
Manually start syslogd enabling remote logging<br />
<br />
<pre style="background:#00FFFF"><br />
REMOTE_LOGGING_SERIVCE=10.111.0.3<br />
PORT=514<br />
<br />
/sbin/syslogd -R $REMOTE_LOGGING_SERIVCE:$PORT -L -O /var/log/messages <br />
</pre><br />
<br />
==== Automatically starting remote logging ====<br />
<br />
You can configure your system to automatically start the remote logging service be editing the file <tt>$DEVDIR/fs/overlay/etc/init.d/syslogd</tt> and adding<br />
<br />
<pre style="background:#00FFFF"><br />
REMOTE_LOGGING_SERIVCE=10.111.0.3<br />
PORT=514<br />
<br />
/sbin/syslogd -R $REMOTE_LOGGING_SERIVCE:$PORT -L -O /var/log/messages <br />
</pre><br />
<br />
=== Verifying proper operation ===<br />
<br />
A simple way to add a log message every few seconds is using the Busybox logger utility. You man need to reconfigure your SDK to enable the building of the Busybox logger utility.<br />
<br />
<br />
On the target, start a simple script that add a message to the log every two seconds. <br />
<br />
<pre style="background:#00FFFF"><br />
( while sleep 2 ; do date ; done | logger -t "DATE:" ) &<br />
</pre><br />
<br />
==== Logging on target hardware ====<br />
<br />
If you used the <tt>-L</tt> option with syslogd on the target hardware, then you can verify local logging is occurring as expected.<br />
<br />
<pre style="background:#00FFFF"><br />
tail -f /var/log/messages<br />
</pre><br />
<br />
==== Logging on host PC ====<br />
<br />
To check the messages are been sent to the server:<br />
<br />
<pre style="background:#FFFF00"><br />
tail -f /var/log/messages<br />
</pre><br />
<br />
=== Debugging ===<br />
<br />
If remote logging is not working, use ''wireshark'' on your Ubuntu host computer to watch the network traffic to verify that the target hardware is sending the messages to the host computer.</div>Jhidalgohttps://developer.ridgerun.com/wiki/index.php?title=How_to_Configure_Remote_Syslog_Logging&diff=1355How to Configure Remote Syslog Logging2010-09-03T16:21:33Z<p>Jhidalgo: /* General Information */</p>
<hr />
<div>== General Information ==<br />
<br />
'''syslogd''' is the Linux system logging utility that take care of filling up your files in /var/log when it is asked to.<br />
<br />
On a standard system, logging is only done on the local drive. But syslog can be configured to receive logging from a remote client, or to send logging to a remote syslog server.<br />
<br />
This ''How to'' gives the basic procedure need it for configuring a remote syslog server (in your PC) and client (in your board with our SDK filesystem structure).<br />
<br />
=== Configuring BusyBox for setting up the syslogd server ===<br />
<br />
The changes on this side are minimal. Basically you have to tell syslogd to listen for remote messages. To enable this you have to go and edit the following file in your host machine:<br />
<br />
<pre><br />
host$ sudo <Prefer text editor>/etc/default/syslogd<br />
</pre><br />
<br />
Make sure in this file SYSLOGD is set to:<br />
<br />
SYSLOGD="-r" <br />
<br />
Save the file and restart '''syslogd''' by doing: <br />
<br />
<pre><br />
host$ sudo /etc/init.d/syslogd restart <br />
</pre><br />
<br />
=== Configuring BusyBox for setting up the syslogd remote feature using our SDK FileSystem structure in the board===<br />
<br />
This can be done in two ways. <br />
<br />
1) The first one, it can be done when the board has boot up and Linux is also running up. Our file system initializes a default configuration for '''syslogd''', then for add the remote feature you have to stop this process and configure a new one following this steps:<br />
<br />
<pre><br />
target# ps aux | grep syslogd<br />
</pre><br />
<br />
If there is a '''syslogd''' process running then kill it.<br />
<br />
<pre><br />
target# killall -9 syslogd<br />
</pre><br />
<br />
Create a new process of '''syslogd''' enabling the remote feature:<br />
<br />
<pre><br />
target# /sbin/syslogd -R <serverip>:<port using by UDP (default PORT=514/UDP)> -L (this save the messages in the server and the client. Optional) -O <PATH where you want to send the log messages><br />
</pre><br />
<br />
Example:<br />
<br />
<pre><br />
target# /sbin/syslogd -R 10.251.101.60 -L -O /var/log/messages <br />
</pre><br />
<br />
<br />
2) For the second way to this, the work should be done if you are familiar with our SDK build system and has to be set it before you create the images of the kernel and file system with it. If not just follow the first case, is the easy way to do this. <br />
<br />
Generally we have an script in our file system that initializes '''syslogd''' when the board boot up the kernel and the file system customized by us. For setting up the''' syslogd''' remote edit this file in the host side:<br />
<br />
<pre><br />
host$ <Prefer text editor> $(DEVDIR)/fs/overlay/etc/init.d/ syslogd <br />
</pre><br />
<br />
As the first way described above, add the following line:<br />
<br />
<pre><br />
/sbin/syslogd -R <serverip>:<port using by UDP (default PORT=514/UDP)> -L (this save the messages in the server and the client. Optional) -O <PATH where you want to send the log messages><br />
</pre> <br />
<br />
Save the file and build and install the images create it by our SDK build system.<br />
<br />
This will automatically execute the syslogd with the remote feature anytime the board is boot up and the file system loads.<br />
<br />
You can check it by doing:<br />
<br />
<pre><br />
target# ps aux | grep syslogd<br />
</pre><br />
<br />
<br />
For checking configuration has successfully done, try the following:<br />
<br />
<pre><br />
target# while sleep 2 ; do date ; done | logger -t "DATE:"<br />
target# tail -f <PATH (Default:/var/log/messages)><br />
</pre><br />
<br />
To check the messages are been sent to the server:<br />
<br />
<pre><br />
host# tail -f <PATH (Default:/var/log/messages)<br />
</pre></div>Jhidalgohttps://developer.ridgerun.com/wiki/index.php?title=How_to_Configure_Remote_Syslog_Logging&diff=1354How to Configure Remote Syslog Logging2010-09-03T16:00:38Z<p>Jhidalgo: /* Configuring BusyBox for setting up the syslogd remote using our SDK FileSystem structure in the board */</p>
<hr />
<div>== General Information ==<br />
<br />
'''syslogd''' is the Linux system logging utility that take care of filling up your files in /var/log when it is asked to.<br />
<br />
On a standard system, logging is only done on the local drive. But syslog can be configured to receive logging from a remote client, or to send logging to a remote syslog server.<br />
<br />
This ''How to'' gives the basic procedure need it for configuring a remote syslog server (in your PC) and client (in your board with our SDK filesystem structure).<br />
<br />
=== Configuring BusyBox for setting up the syslogd server ===<br />
<br />
The changes on this side are minimal. Basically you have to tell syslogd to listen for remote messages. To enable this you have to go and edit the following file in your host machine:<br />
<br />
<pre><br />
host$ sudo <Prefer text editor>/etc/default/syslogd<br />
</pre><br />
<br />
Make sure in this file SYSLOGD is set to:<br />
<br />
SYSLOGD="-r" <br />
<br />
<br />
Save the file and restart '''syslogd''' by doing: <br />
<br />
<pre><br />
host$ sudo /etc/init.d/syslogd restart <br />
</pre><br />
<br />
=== Configuring BusyBox for setting up the syslogd remote feature using our SDK FileSystem structure in the board===<br />
<br />
This can be done in two ways. <br />
<br />
1) The first one, it can be done when the board has boot up and Linux is also running up. Our file system initializes a default configuration for '''syslogd''', then for add the remote feature you have to stop this process and configure a new one following this steps:<br />
<br />
<pre><br />
target# ps aux | grep syslogd<br />
</pre><br />
<br />
If there is a '''syslogd''' process running then kill it.<br />
<br />
<pre><br />
target# killall -9 syslogd<br />
</pre><br />
<br />
Create a new process of '''syslogd''' enabling the remote feature:<br />
<br />
<pre><br />
target# /sbin/syslogd -R <serverip>:<port using by UDP (default PORT=514/UDP)> -L (this save the messages in the server and the client. Optional) -O <PATH where you want to send the log messages><br />
</pre><br />
<br />
Example:<br />
<br />
<pre><br />
target# /sbin/syslogd -R 10.251.101.60 -L -O /var/log/messages <br />
</pre><br />
<br />
<br />
2) For the second way to this, the work should be done if you are familiar with our SDK build system and has to be set it before you create the images of the kernel and file system with it. If not just follow the first case, is the easy way to do this. <br />
<br />
Generally we have an script in our file system that initializes '''syslogd''' when the board boot up the kernel and the file system customized by us. For setting up the''' syslogd''' remote edit this file in the host side:<br />
<br />
<pre><br />
host$ <Prefer text editor> $(DEVDIR)/fs/overlay/etc/init.d/ syslogd <br />
</pre><br />
<br />
As the first way described above, add the following line:<br />
<br />
<pre><br />
/sbin/syslogd -R <serverip>:<port using by UDP (default PORT=514/UDP)> -L (this save the messages in the server and the client. Optional) -O <PATH where you want to send the log messages><br />
</pre> <br />
<br />
Save the file and build and install the images create it by our SDK build system.<br />
<br />
This will automatically execute the syslogd with the remote feature anytime the board is boot up and the file system loads.<br />
<br />
You can check it by doing:<br />
<br />
<pre><br />
target# ps aux | grep syslogd<br />
</pre><br />
<br />
<br />
For checking configuration has successfully done, try the following:<br />
<br />
<pre><br />
target# while sleep 2 ; do date ; done | logger -t "DATE:"<br />
target# tail -f <PATH (Default:/var/log/messages)><br />
</pre><br />
<br />
To check the messages are been sent to the server:<br />
<br />
<pre><br />
host# tail -f <PATH (Default:/var/log/messages)<br />
</pre></div>Jhidalgohttps://developer.ridgerun.com/wiki/index.php?title=How_to_Configure_Remote_Syslog_Logging&diff=1353How to Configure Remote Syslog Logging2010-09-02T22:37:13Z<p>Jhidalgo: Created page with '== General Information == '''syslogd''' is the Linux system logging utility that take care of filling up your files in /var/log when it is asked to. On a standard system, loggi...'</p>
<hr />
<div>== General Information ==<br />
<br />
'''syslogd''' is the Linux system logging utility that take care of filling up your files in /var/log when it is asked to.<br />
<br />
On a standard system, logging is only done on the local drive. But syslog can be configured to receive logging from a remote client, or to send logging to a remote syslog server.<br />
<br />
This ''How to'' gives the basic procedure need it for configuring a remote syslog server (in your PC) and client (in your board with our SDK filesystem structure).<br />
<br />
=== Configuring BusyBox for setting up the syslogd server ===<br />
<br />
The changes on this side are minimal. Basically you have to tell syslogd to listen for remote messages. To enable this you have to go and edit the following file in your host machine:<br />
<br />
<pre><br />
host$ sudo <Prefer text editor>/etc/default/syslogd<br />
</pre><br />
<br />
Make sure in this file SYSLOGD is set to:<br />
<br />
SYSLOGD="-r" <br />
<br />
<br />
Save the file and restart '''syslogd''' by doing: <br />
<br />
<pre><br />
host$ sudo /etc/init.d/syslogd restart <br />
</pre><br />
<br />
=== Configuring BusyBox for setting up the syslogd remote using our SDK FileSystem structure in the board===<br />
<br />
Generally we have an script in our file system that initializes syslogd when the board boot up the kernel customized by us.<br />
<br />
For setting up the syslogd remote edit this file in the host side:<br />
<br />
<pre><br />
host$ <Prefer text editor> $(DEVDIR)/fs/overlay/etc/init.d/ syslogd <br />
</pre><br />
<br />
Add the following line:<br />
<br />
<pre><br />
/sbin/syslogd -R <serverip>:<port using by UDP> -L (this save the messages in the server and the client. Optional) -O <PATH where you want to send the log messages><br />
</pre></div>Jhidalgo