Tuesday, January 26, 2010

One Man's Download Is Another Man's Upload

In my work environment, I often have to transfer files between UNIX servers and my Windows machine. For security and many "other reasons", I have to remote desktop to another Windows server (so call "gateway server") before I can access (ssh, sftp) to those UNIX machines. If not, I will have to answer all the "why". Although there is no firewall setup between all these layers, I often have to make use of the gateway server to be the middle man to do all the file transfer.

I blogged about how to download files from UNIX server, but never mentioned about how to upload file to the UNIX server. At the back of my mind I have been thinking about writing an http service for uploading. After some thoughts, I think I can simply run the same script in my Windows (Python under Cygwin) and use wget to download files to the UNIX server.

With this approach, I do not have to launch browser to upload files and all these can be done via command line. Also, I can reuse my old code.

Labels: ,

Thursday, January 21, 2010

What Can You Learn From The Governator

If you watch The Apprentice, you probably came across this clip with the "Governator"

Friday, January 15, 2010

HBA I/O Utilisation Monitoring

I recently just finished the development of monitoring 17 Brocade fibre channel switches with over 1200+ ports in total. The implementation is solely based on UNIX shell script, RRDtool, Tcl, Apache Web Server by polling the switches using SNMP.

Instead of polling individual port, we 'snmpwalk' the swFCPortTxWords ( and swFCPortRxWords ( MIB branches. With this, we only have to do two polls per switch. The output will be parsed by a Tcl program to output 'update somefile.rrd N:value' data stream and pipe it to 'rrdtool -' to update all the rrd files in one parse. Here is a sample pseudo code

for switch in $all_switches
  for mib in swFCPortTxWords swFCPortRxWords
      snmpwalk -v $version -c $community $switch $mib | tcl-program
      # expected output: "update somefile.rrd N:value"
done | rrdtool -

All these runs on Solaris. BTW, the search form allows you to key in search patten using regular expression. The return page provides a summary plot link to aggregate all traffic in one plot.

Below shows some of the screen dump.
Main page shows all the switches.

Click on the 4th switch and this will show you all the FC ports:

Click on the 4th port in the 4th switch. It shows you the daily, weekly, monthly and yearly Tx/Rx traffic

If you use the search form, which can take regular expression, it returns the matching switch ports. The result page will include a Summary plot link to allow user to put all the traffic in one single page.

A daily summary plot

A weekly summary plot

Labels: , , ,