Adding a column to an existing RRD database...

23/04/09 | par jmspaggi [mail] | Catégories: Non catégorisé

If you are like me and looking for a way to add a nex column to an existing RRD database, maybe you are going to spend a lot of time on google to look for it.

Unable to find any solution, I tried with some basic tools (RRDDump, RRDRestore, replace, etc.) and I was able to find a way to do so. So I'm sharing what I found in case that can help you.

I have initialy created a database to store the temperature of the water inside my water tank. With this script.


rrdtool create eau.rrd --start 1202484376 \
DS:HWH:GAUGE:288:U:U \
RRA:AVERAGE:0.5:1:12 \
RRA:AVERAGE:0.5:1:288 \
RRA:AVERAGE:0.5:1:2016 \
RRA:AVERAGE:0.5:1:8928 \
RRA:AVERAGE:0.5:1:105408 \
RRA:AVERAGE:0.5:1:316224

HWH for Hot Water High, because I thought also about adding a sensor on the bottom of the tank. Which I did. So now, I want to have HWH, HWL and Room for the room temperature.

First, stop your cronjob which is feeding your source. Then, export your data to an XML file and at the same time, add the numbers of new columns you want. In the example below, I'm adding 2 new columns. The "replace" tool is available in the MYSQL package.

rrdtool dump eau.rrd | replace "</v></row>" "</v><v> NaN </v><v> NaN </v></row>" > eau.xml

This is going to generate the XML file with the new columns blank.

Now, you have to edit the XML file to update some more fields.

So in the eau.xml file, search for each cdp_prep section.

Your section should look like:

<cdp_prep>
   <ds>
        <primary_value> 0,0000000000e+00 </primary_value>
        <secondary_value> 0,0000000000e+00 </secondary_value>
        <value> NaN </value>
        <unknown_datapoints> 0 </unknown_datapoints>
    </ds>
</cdp_prep>

So simply duplicate the ds section for each value you want to add.

For me, which want to add 2 values, the result is:

<cdp_prep>
   <ds>
        <primary_value> 0,0000000000e+00 </primary_value>
        <secondary_value> 0,0000000000e+00 </secondary_value>
        <value> NaN </value>
        <unknown_datapoints> 0 </unknown_datapoints>
    </ds>
   <ds>
        <primary_value> 0,0000000000e+00 </primary_value>
        <secondary_value> 0,0000000000e+00 </secondary_value>
        <value> NaN </value>
        <unknown_datapoints> 0 </unknown_datapoints>
   </ds>
   <ds>
        <primary_value> 0,0000000000e+00 </primary_value>
        <secondary_value> 0,0000000000e+00 </secondary_value>
        <value> NaN </value>
        <unknown_datapoints> 0 </unknown_datapoints>
   </ds>
</cdp_prep>

You have to do that for each cdp_prep section and not only for the first one.

Then, you "simply" have to reload those data in a new dabatase.

rrdtool restore eau.xml eau2.rrd

And voila. You have your new database with your 2 new columns.

Enjoy.

JM




Configuring the Serial port for the Javelin Terminal

17/04/09 | par jmspaggi [mail] | Catégories: Javelin

Javelin terminal is sending information on an RS-232 protocol, but at 28800 bauds. This is not a standard rate and you migh face some troubles to configure it under Linux.

I wasted 2 days searching how to make it works, so here is the result.

First you have to configure your serial port to be at 115200, but with a divisor at 4. So 4 * 28 800 = 115300.

This is done by:
setserial /dev/ttyS0 baud_base 115200 spd_cust divisor 4
Then I used stty to configure the port, but since after I'm using java to read the data, I'm not 100% sur if it's require.

However, the line is:
stty -F /dev/ttyS0 38400

Then on the Java side, using javax.comm API, set the port with:
serialPort.setSerialPortParams(38400, SerialPort.DATABITS_8,
SerialPort.STOPBITS_1,
SerialPort.PARITY_NONE);

And that's all. Simply use the javax.comm example (SimpleRead.java) and update it with your needs.

JM




Video Card ATI HD3300

01/10/08 | par jmspaggi [mail] | Catégories: Non catégorisé

The M3A78-T has an ATI HD3300 onboard videocard.

I you are trying to install debian with the regular radeonhd driver, your X server will not start because this chipset is not yet managed by the driver. You will have to choose to use the VESA driver, or recompile the radeonhd one.

I choosed the 2 option, and here are the steps to do so.

Install all the related packages
apt-get install ibtool libdrm-dev xserver-xorg-dev xorg-dev xutils-dev git-arch
git-core libglc-dev

Get the last version of the code using
git clone git://anongit.freedesktop.org/git/xorg/driver/xf86-video-radeonhd

Move to the xf86-video-radeonhd directory and start autogen.sh then make.

The make install command did not worked for me, so I copied the file src/.libs/radeonhd_drv.so directly under /usr/lib/xorg/modules/drivers.

I was not able to start X with the radeonhd driver before the install,
and I'm now able. So I think it's working.




Network card

09/29/08 | by jmspaggi [mail] | Categories: Non catégorisé

The network card on this mother board is: a Marvell 88E8056. What's a big s&*$% ;)

Here is the details using lspci -v:

02:00.0 Ethernet controller: Marvell Technology Group Ltd. 88E8056 PCI-E Gigabit Ethernet Controller (rev 12)
Subsystem: ASUSTeK Computer Inc. Device 81f8
Flags: bus master, fast devsel, latency 0, IRQ 1278
Memory at feafc000 (64-bit, non-prefetchable) [size=16K]
I/O ports at e800 [size=256]
Expansion ROM at feac0000 [disabled] [size=128K]
Capabilities: [48] Power Management version 3
Capabilities: [50] Vital Product Data
Capabilities: [5c] Message Signalled Interrupts: Mask- 64bit+ Queue=0/0 Enable+
Capabilities: [e0] Express Legacy Endpoint, MSI 00
Capabilities: [100] Advanced Error Reporting
Kernel driver in use: sky2
Kernel modules: sky2

This network card is well detected by kernel 2.6.26, but does'nt work. The issue is related to the speed of the card. After many hours spend on google, I find a magic command to solve this.

So in order to install Debian, I had 2 options.
1) Use another network card for the installation, the configure the onboard one, are remove the installed.
2) Install linux with the install CD instead of the NetInst version, then configure the card.

I choosed the 1st in order to not download all the CDs.

I installated an old 3com Etherlink card which is working verywell.

After installation, install ethtool package
apt-get install ethtool

and configure you network card
ethtool -s eth0 speed 10 duplex full autoneg off

get it down, then up
ifdown eth0 && ifup eth0

And everything should works well after that.

Now, in order to have the card working fine after the next reboot, update your /etc/network/interface file like this.

iface eth0 inet static
        address 192.168.0.2
        netmask 255.255.255.0
        gateway 192.168.0.250
        broadcast 192.168.0.0
        pre-up /usr/sbin/ethtool -s eth0 speed 10 duplex full autoneg off

(the last line is somecute cut. It's "pre-up /usr/sbin/ethtool -s eth0 speed 10 duplex full autoneg off")

You don't need to reboot to test it, but I did it just to be sure everything will be fine next time I will restart.

It seems that it's because of the revision of the network card. Some over the net said we can get an update firmware from ASUS or Marvell. I have not yet ask but I will, in order to be able to use my card at 100 and not only 10.

I hope that it will help you the way it has helped me...

JM




New mother board, new issues ;)

09/29/08 | by jmspaggi [mail] | Categories: Non catégorisé

Link: http://www.asus.com/products.aspx?l1=3&l2=149&l3=731&l4=0&model=2321&modelmenu=1

Last week I bought new mother board, new memory, new fan and a new CPU and I decided to reinstall my linux distrib to get a clean environment.

Of course, I went into a lot of issues. Here you will find so tricks if you have the same hardware and you are facing the same issues.

Here is the hardware description.

Mother board: ASUS M3A78-T
CPU: AMD Phenom 9950 (Quad-Core)
Memory: Corsair Dominator (4Gb) with fan
Fan: ASUS Silent Square

JM




March 2019
Sun Mon Tue Wed Thu Fri Sat
 << <   > >>
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            

Statistiques

Free counter and web stats

Search

XML Feeds

powered by b2evolution