Friday, December 28, 2007

csvrss 0.1 released

The first release of csvrss. I've versioned it, at 0.1 since it's still very specialized in combination with pingit.

What does csvrss do. If you have two same structured csv files. That means same amount of columns in the same order. It tries matching the first columns of those files with each other and see if a value of column x has changed. It reports 3 kind of changes:

  • The value of the first column doesn't exists in the older csv, that means it's added.
  • A value of the first column in the older csv doesn't exist anymore in the newer, that means it has been deleted.
  • The value of column x of matching first columns is different, that means there has been a change.

These changes are appended as items to a (existing) rss file.

The targets for future releases are: using more standard available libs for the xml and csv involved ( under the hood ) . The second target is making it more general, so it will be usefull for other csv diff-ing tasks. You can think of , a primary consiting of multiple columns, looking for changes in multiple columns, other outputs beside rss, better guid generation.

The latest version of csvrss can be found at: http://sysutil.googlepages.com/csvrss

Thursday, December 27, 2007

Setting up a webserver to host the Html files that come with PingIt.

In this article i'm going to describe how you can setup a webserver hosting the html files that are included in PingIt. The html files display a very simple webpage with the data of the outputed csv file as html table. Nothing fancy. But in very near future i want to do some stuff with rss and somehow none of the feed applications are able to use rss feeds located on a local disk.
I don't mind anyway, since it's much nicer to have to feeds available for more than only me.

I've searched for a simple webserver, since it's all static content from a webserver point of view
The webserver i'm using in this article is shttpd ( simple httpd ). For a simple webserver it even has quite some nice features like md5 auth, ssl, cgi. It can be found at:

http://sourceforge.net/projects/shttpd/

I'm using 1.38 ( latest version, this time of writing ) You'll probably just want to grab the latest available.

It's a easy setup, shttpd is only one executable, i've unzipped it to C:\shttpd-1.38_win32

made a subdirectory called data.

In C:\shttpd-1.38_win32\data i've copied all the html files that are included in the PingIt zip.



If you start shttpd, you'll notice a icon that looks like a leaf. If you right click on it , go to settings. The Following screen is visible.














Here you can see that i've already changed the Web Root directory to C:\shttpd-1.38_win32\data


Change that too, save settings.


Last change is adapting your batch file so that the output.csv is written to C:\shttpd-1.38_win32\data



And your done. Go to http://127.0.0.1/ to see the result.


Wednesday, December 26, 2007

CSV results of PingIt showed as HTML page.

PingIt 1.1 includes html files that show the results of the csv file. You can open up index.html in the PingIt directory to see for yourself. You might get a bar on top of the screen to accept the use of a special control.
How it works and limitations:
Windows in combination with Internet Explorer has a Tabular Data Control. This control makes it very easy to display an csv file as table in your html page. Using this control comes ofcourse with two drawbacks, it won't work on a linux box, neither it will with FireFox on a Windows Machine. Details about the control can be found at:
Adapt it for your own needs:
In PingIt 1.1 i've included sample html files that will work if the output of PingIt goes to output.csv. If you are outputting to a different file, you'll have to edit the onlinelist.html, offlinelist.html and alllist.html yourself.
To be specific, this part:
param nAme="DataURL" value="output.csv">
Looking for alternative:
The html files are very raw, i didn't even used css to muck it up. I'm still looking out for an alternative to it, that works out of the box, and is cross platform/browser. Maby a fancy javascript or something in AJAX.

PingIt and windows scheduler

In this howto you will read howto scheduling a pingit task, pinging a range of ip'ees every 5 minutes 24 hours a day. I've tested this on a Window XP pro SP2 machine. It' most likely will work on other configurations but it might be slightly different than on the screenshots showed here.
I've got pingit.exe located in C:\pingit\ directory , this is most likely different on your machine so you have to fill in your path where ever you see the path i've used.


Creating the batch file

I've used notepad to create a batch file called mypingit.bat with the following contents:

pingit 192.168.177.* > output.csv







Start -> Control Panel -> Scheduled Tasks -> Add Scheduled Task

This will start the wizard
Pressing next










I’ve got pingit and the batch file located in C:\pingit\ this might be different
on your machine. Choose browse to locate and choose the mypingit.bat we’ve
created earlier.





















After pressing open the following screen is visible:
Choose Daily at first, we’ll modify this slightly later on.






Leaving this all default, just press next.
To run tasks in windows the user credentials are needed.
Tick the box "Open advanced properties for this task when i click finish" and press finish.
The screen will open up in the Task tab, choose for the Schedule tab
And press the Advanced Button.
Tick on “Repeat task”

Choose to repeat every 5 minutes, you might what this more or less often.
Tick on Duration : 24 hours and 0 minutes.
Press Ok, You’ll return to the mypingit task panel

Then Apply in the mypingit task panel.

And Ok in the mypingit task panel

And your done