Saturday, March 29, 2014

Syslog to MySQL Update

I am in the process of updating some machines around here.
I am installing Mageia 4 Linux on one machine and it will be my syslog repository.

Mageia 4 is running journalctl and does not use syslog natively by default.
I had to install rsyslog, rsyslog-mysql, mariadb, and other required packages.

The first step is to modify the 00_ common.conf. Most of the lines matched what I needed but we needed to enable the UDP port to listen for other devices logging to this one.
 Uncomment the following two lines.

$ModLoad imudp.so
$UDPServerRun 514




Restart rsyslog to use the new settings.

systemctl rsyslog restart

Now run netstat -a and verify the the UDP port *.syslog or UDP port 514 is open.

Force some device that is configured to log to this server to do something to create and entry. I logged into a switch to get it to log. Then check the log file.

tail /var/log/syslog

If you have entries from the correct device you know that remote logging is working. Now to get the database part done.

rsyslog come with a default SQL schema in  /usr/share/doc/rsyslog-mysql/.
The file is called createDB.sql.

To setup the default database I ran:

mysql < createDB.sql

 This creates a database called Syslog with two tables.

Then I created a new user and gave it privileges to the Syslog database:

GRANT ALL PRIVILEGES ON Syslog.* To 'Syslogusername'@'localhost' IDENTIFIED BY 'password';
 
The rsyslog config file /etc/rsyslog.conf calls config files in two other locations.
One location is /etc/rsyslodg.d/ and the file 01_mysql.conf needs to have two lines:
 
$ModLoad ommysql.so
 
*.*     :ommysql:127.0.0.1,Syslog,Syslogusername,password
 
The first line loads the mysql library and the second line has the database name and the user credentials.
 
Another restart of the rsyslog service and your entries should now start being logged into the database.
 
SELECT * FROM Syslog.SystemEvents; and check for the entries. 
 
 

 
 

Tuesday, February 25, 2014

Reverse Sensing System Troubleshooting

The reverse sensing system on my 2006 F-150 stopped working recently. I had not noticed that the off light was illuminated on the switch and I while I was backing up, it dawned on me that there was no beeping from the reverse sensing system.

The reverse sensing system OFF light being illuminates is one of the key determinations for where to start troubleshooting. If the OFF light is illuminated ALL of the time, even when parked and driving forward then you most likely have a problem with the module/speaker.
If however the OFF light only illuminates when you put the vehicle in reverse then you most likely have a bad sensor or wiring to the sensors. We will tackle the sensor problem first.


To troubleshoot the sensors, park the vehicle in a quiet and safe place. Put a chock BEHIND one of the wheels. Then turn the key to the run position but DO NOT start the vehicle. Then place vehicle in reverse. Walk behind the vehicle and place your ear close to each of the sensors.
You should hear a faint, tic - tic - tic - tic. The sensors are ultrasonic and you should be able to hear each one fire. Listen to each one until you find one that is not making any sound. That is probably the bad one. This assumes that you have not been in an accident or had any damage recently, that should be rather obvious. Also take a look at the sensor wiring connector for corroded or loose connections. If you have to replace a sensor they are about $150 each from the dealer.

Now if the OFF light is illuminated all of the time then we probably have a speaker or module issue. The speakers appear to be a common problem as there was a tech bulletin issued and their is a Parking Distance Control Kit  P/N 4L1Z-15A866-AA that is specifically addressed for the Tech Bulletin. In my 2006 F150 Crew Cab, the module was located on the drivers side up under the dash, up above the drivers left foot. Lay on the floor where your left foot would go and look up. You should see a black box with a speaker on it.





I used a multimeter to take a resistance check of the speaker and received a reading of infinity. The speaker appeared to be open, a common failure mode for speakers. The resistance should be close to the impedance of the speaker, about 4 ohms for a speaker with 4 ohms of impedance.

I picked up a new speaker from the dealership for $34 even though I found it online for much cheaper. I felt ripped off but I wanted to get it fixed and not have to wait for shipping since when I put things off I almost never get back to them again soon.

I replaced the speaker and my system started working again just fine.

Now if you want, you can take the vehicle to the dealership and they can hook up the computer and they can tell you which sensor or part to replace but I do not like paying over $100 and waiting half of the day for that. The reverse sensor engine codes are not readable by most of the scanners. I have a decent scanner that can read extended codes on most makes but nothing on the reverse sensing system.