What Can you Expect? —A Data Collection Project Using Linux
Both the temperature conversion circuit and the multimeter run from 9-volt batteries. Since I wanted to take data for weeks at a time without worrying about them going dead, I designed and built a couple of simple power supplies using adjustable voltage regulators and the cube transformers that plug in the wall, to act as battery eliminators. These also fit on a piece of vector board a little over one square inch. (See Figure 4.)
The last part was visualizing the data. I used gnuplot to read the log file and plot temperature versus time. I hadn't used gnuplot before, but a couple of hours going through the man pages got me to a point where I could view the plot on the Linux console or print it to my HP LaserJetIII.
Lines in /var/log/temps.log look like this:
Dec 31 10:45:01 server1 rddmm: 68.9 Degrees F
The operative gnuplot directives are:
set xdata time set format x "%b %d\n%H:%M" set title "Internal Server Temperature at Timekeeping Crystal" set timefmt "%b %d %H:%M:%S" set xrange [ "Jan 03 14:00:00" : "Jan 04 07:59:00"] set ylabel "Degrees F" -2 plot "/var/log/temps.log" using 1:6 with lines 1The xdata and timefmt directives tell gnuplot the horizontal axis is measured in time and how the times in the log file look. The xrange directive determines which lines of the log file get plotted. The format x directive defines the labels on the x axis; the \n between the date and time forces a two-line label. The plot command tells gnuplot where to find the log file, which columns to plot and to use line plot style 1. The set title and set ylabel put a title and y-axis label on the plot.
To print the plot to the laser jet, I used:
set terminal pcl5 set output '/root/plot.out' replot
Then from the shell:
lpr /root/plot.outIn a similar fashion, I plotted the difference of system clock time measurements versus the reference NTP server on the Internet with the gnuplot directives shown here:
set xdata time set timefmt "%Y-%m-%d %H:%M" set xrange ["1999-01-03 15:00":"1999-01-04 07:00"] set format x "%b %d\n%H:%M" set title "Delta sysclock Minus Delta refclock" set ylabel "Seconds" -2 plot "/root/clk_hr.prn" using 1:3 with lines 1
And now, after all of this, is the system clock being affected by temperature? By looking at Figures 4 and 5, you can see that the variations in the clock differences do not follow the temperature variations inside the server. As a matter of fact, there is a large time variation that corrected itself, which I must chalk up to variations in network latency. By taking time data once per hour instead of once per day as I was originally doing, it became easier to identify the random network variations, which had originally peaked my curiosity.
These techniques are also adaptable to measuring and recording other physical parameters using devices with a serial interface. This particular digital multimeter can measure DC and AC voltage and current, capacitance, frequency and transistor gain. All these are accessible through the serial interface.
Linux and a project like this have brought me back to the days when you could actually create something useful with hardware and software. Sadly, most things for computers today come out of a shrink-wrapped box. Linux provides me with the tools I can use to make things happen in the real world.
Fast/Flexible Linux OS Recovery
On Demand Now
In this live one-hour webinar, learn how to enhance your existing backup strategies for complete disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible full-system recovery solution for UNIX and Linux systems.
Join Linux Journal's Shawn Powers and David Huffman, President/CEO, Storix, Inc.
Free to Linux Journal readers.Register Now!
- Server Hardening
- BitTorrent Inc.'s Sync
- Download "Linux Management with Red Hat Satellite: Measuring Business Impact and ROI"
- New Container Image Standard Promises More Portable Apps
- The Humble Hacker?
- The Death of RoboVM
- The US Government and Open-Source Software
- Open-Source Project Secretly Funded by CIA
- EnterpriseDB's EDB Postgres Advanced Server and EDB Postgres Enterprise Manager
- AdaCore's SPARK Pro
In modern computer systems, privacy and security are mandatory. However, connections from the outside over public networks automatically imply risks. One easily available solution to avoid eavesdroppers’ attempts is SSH. But, its wide adoption during the past 21 years has made it a target for attackers, so hardening your system properly is a must.
Additionally, in highly regulated markets, you must comply with specific operational requirements, proving that you conform to standards and even that you have included new mandatory authentication methods, such as two-factor authentication. In this ebook, I discuss SSH and how to configure and manage it to guarantee that your network is safe, your data is secure and that you comply with relevant regulations.Get the Guide