Wednesday, December 12, 2012

Planview

As a grumpy old software engineer, I complain about other people's software a lot, as shown in this blog. But I must say, Planview has to be on top of the pile for being arrogant, stupid and time-wasting. I am no management expert -- I am not even a manager, but this message is a bit too much -- I don't know what you think.

The problem is caused by me closing the lid on my laptop before I finished what I was doing. When I came back to it, the session apparently timed out. I clicked on something and was shown this message implying that I might be treated as a criminal -- One would expect that a leader in an industry could at least be able to tell a simple timed out session from a criminal attack.

As for what I was doing, well -- I don't even want to go there. Here is my take on Planview: If your company is planning to implement this software and you have any say in that decision process at all, fight against it with all you have got. You will thank yourself down the road if you still work for the same organization.

Saturday, December 1, 2012

They are Branded as Windows

They are branded as Windows -- in fact, they have been for years. But this is how you know, it's just holes in the wall.

Saturday, November 24, 2012

Pain with Windows Continues

I admit that I seriously lack in-depth knowledge of Microsoft Windows, but this one still looks ridiculous never-the-less.

I am trying to hook up a ViewSonic gTablet to a Windows XP machine to load a ROM. Upon plug in the USB cable, Windows recognized the new device and popped up the Found New Hardware Wizard. All seems smooth sailing, until the wizard seems to stuck at copying a file.


Of course, when I check the destination folder, the file is there. The copying is already done but the Wizard just sits there twiddling its thumb, forever and ever. I can't even cancel it as the buttons are all greyed out. It only goes away and declares that it has finished installing the software for the device when I unplug the USB cable or power off the device.

Yet, when I plug the device back in, it is not functioning properly as an APX device. The properties dialog box in the Windows Device Manager says that "No drivers are installed for this device."

So the next thing I try is to remove the device from the Device Manager. Windows stuck again:


I guess I am going to try Linux.

[Edit 2012-11-25] -- I thought if Linux was to help, I would write another post titled "Linux to the Rescue" or something. But Linux made it so easy which made me question myself as why I started with Windows in the first place -- Possibly because most of the how-to type articles mention Windows. Well, anyway, I found this article on SlateDroid.com and followed its instructions to nvflash the tablet, which is basically, plug in the device using a mini USB cable, download nvflash, download the device image you want to install on the device and run the nvflash script -- not worth writing another post.

Friday, November 23, 2012

Windows Registry is Evil

I have heard from colleagues who worked in end user support, that Windows registry was a source for many problems. But this one that just bit me int he rear is evil.

I have an old Asus EeePC running Windows XP. It was setup initially as a box to automatically logon. I wanted to give it to my kid to carry around. So I needed to turn off the auto logon. Googling "Windows XP auto logon", I found this Microsoft article titled "How to turn on automatic logon in Windows XP". So I went ahead and found the "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon". I then removed the DefaultUserName entry, assuming that would be enough to disable auto logon.

Upon reboot, however, Windows popped up an error message which is quickly covered with the Windows startup screen. It seemed to just hang there. The mouse cursor moved, but Ctrl-Alt-Del did not do anything. I rebooted it a couple of times by pressing on the power button. I got distracted for a while and come back to find Windows actually timed out from whatever it was doing.

One wouldn't have thought Windows would behave like that with removing one single value from the registry. But I guess this just shows that I have not messed around in the Windows registry enough.

I ended up downloading the Microsoft Fixit program in the How to page linked above. That did work to turn off auto logon for me. Otherwise, I guess I would have to break out my Windows XP CD, go into recovery console mode, find a registry backup and restore it. That would have been the last straw to break it for me to replace this Windows installation with Linux.

Monday, November 12, 2012

Sharing the Pain from IE

I just complained to a colleague, after he spent some time helping me with an issue in Microsoft Internet Explorer 8, that Microsoft wanted to conquer the world. They did it, but with whole truck loads of manure, piled up high in everybody's backyard. Now we are left to clean up all that smelly stuff.

The issue is that, the hospital has some legacy applications that run only on IE. We finally got to IE8 not too long ago after a relatively brief encounter with IE7, which was after a long tiring adventure with IE6. But some applications still require IE7. So the standard issue browser on everyone's desktop is IE8 running in IE7 compatibility mode. Web based applications that I have worked on usually are used by technical people so I usually could care less if something works in IE or not.

The latest project involves a dashboard for the non-techies, including executives, which means we are not allowed to bring a tool not sanctioned by the enterprise, such as Firefox. Fortunately, we have another colleague who has dealt with IE quite extensively. He provided information that was priceless to us, with a caveat: The tricks he gave us may or may not work. At least he had not been able to get them all to work.

The one trick is to force IE8 to render HTML as IE8, rather than in IE7 compatibility mode. There are three ways to do that:
  1. Change Compatibility View Settings in IE8: That function is listed in Tools menu. One just needs to check off the Display Intranet sites in Compatibility View.
  2. Add a meta tag in the HTML document head part:
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
  3. Add an item in the HTTP response header: x-ua-compatible: IE=Edge
#1 is a non-starter because it requires manually configuring the browser.

#2 worked for my colleague right away in one of his applications. So he gave me the information to try out in my code.

It didn't work!

After a number of frustrating trials, every single time clearing IE8 cache, closing the browser, open the browser again and checking the rendering mode, etc., with no luck whatsoever, we decided to try #3.

That worked.

At this point, I am too lazy to bother with the changes in previous trials. So I still don't know if #3 alone or the a combination of #2 and #3 made it work. I am just glad that it works.

Thursday, October 25, 2012

web2py and apache2/mod_python

Finally got it to work!

web2py is an open source Python based web application framework. I had the fun of setting one up on a SuSE ELS 11.1 server. Not wanting to go outside the distribution to alert the server administrative team, I stayed with what are available in the repository, which does not have the WSGI module. So I went with the Python module for Apache.

There is a file named modpythonhandler.py in the top folder of web2py installation, with sample configuration in it. But following that I get an "invalid request" message from accessing web2py. I searched on Google for setting up web2py with mod_python, but it still took me some time and trials to get it right. So here is what I have learned from this experience.

One thing is to setup access to the static files (CSS, JavaScripts, etc.):
AliasMatch ^/([^/]+)/static/(.+)$ /path/to/web2py/applications/$1/static/$2
That turns request for welcome/static/js/jquery.js to the actual path to that file, which is usually in the applications subfolder.

Next, setup the handler for web2py -- All client requests pass through the handler, except for the static files:


SetHandler python-program PythonHandler web2py_modpython PythonPath "sys.path+['/path/to/web2py']"
AllowOverride FileInfo Options -Indexes FollowSymLinks Order Allow,Deny Allow from all
Next, the static files:

SetHandler None Options -Indexes FollowSymLinks ExpiresActive On ExpiresDefault "access plus 1 hour" Order Allow,Deny Allow from all
Files in all the static/ subfolders should be handled by Apache directly.

The content of the web2py_modpython.py file (the Python handler):
from mod_python import apacheimport modpythonhandler
def handler(req):    req.subprocess_env['PATH_INFO'] = '/welcome/default/index'    return modpythonhandler.handler(req)
The end.

Saturday, October 20, 2012

VPN in Ubuntu and Upgrading to 12.10, Quantal Quetzal

The latest release of Ubuntu hit the news a couple of days ago. I have been hesitant upgrading for some time as I have become less enthusiastic about new operating system features since moving away from system level development.

My experiences following Ubuntu has been that, every time a new release comes out, some functions are broken. Over time, bugs get reported, updates released and broken functions repaired. It has been a great OS for years, although Unity has not been my favorite. Between Gnome and KDE, I have always liked Gnome better, so I have stayed with Ubuntu, using it on my desktop, my netbook, and home server.

After reading about the 12.10 release for a few days, I decided to upgrade my desktop. The upgrade went pretty smooth besides taking a while. I went the command line route as that was easier for me.

Before I started the upgrade process, I had to enable the upgrade to a non-long-term-support (LTS) release -- Ubuntu does 2 release every year, one in April and one in October, which is where the release numbers like 10.04 and 12.10 come from. The latest release, 12.10, means it is released in October 2012. I forgot the file containing that option, so I started the System Tools » Administration » Update Manager, went to Settings and change the Notify me of a new Ubuntu version option from For long-term support versions to For any new version.

Then in a terminal window, I did a do-release-upgrade. That's pretty much it -- all I had to do after than was answering a few questions about new configuration files -- Since I haven't done much customization, I only had to answer y.

The upgrade process kept all my personalizations, including my choice of Gnome 3 and background images, etc.

But then almost immediately after reboot into 12.10, I noticed something not working: My VPN to work. It is a Cisco AnyConnect setup. The Network Manager isn't much help -- it just says connection failed. In syslog, this one message looks quite suspicious: Failed to open tun device: Permission denied -- I checked /dev/net/tun, I should already have read and write access to it per group permissions. Only by granting world read/write access to the tun device seems to make VPN work -- That seems rather strange. But that's a story for another day.

Saturday, July 14, 2012

Problem Connecting an XP VBox to WHS

The Acer EasyStore AH340 is a nice little headless box running Windows Home Server. It has 4 SATA hard drive bays, a gigabit Ethernet, a few USB ports and an expansion slot. With an Intel Atom CPU, it is obviously not a power computer. But it serves the purpose of backing up home PCs well. But the bad news is that Acer has discontinued the product line.

Anyway, my AH340 currently is backing up a Windows XP laptop from work. But I am having much trouble trying to connect an XP virtual machine running in Oracle VirtualBox inside my Ubuntu desktop.

After connecting from the VBox to HTTP port 55000 on the AH340, I downloaded the WHSConnectorInstall.exe software. Starts it. It goes looking for the server on the network:


It seems to find it OK and start to download software:


But that's as far as it gets:


There isn't really much help in troubleshooting. I searched online but did not find anyone else with the exact same problem.

Wireshark came to the rescue. It turns out that the WHS connector installer program changes the Windows hosts file after it finds the home server. Because the XP VM network adaptor is configured in NAT mode, the home server's address is translated to 10.0.0.2 by VirtualBox.

After changing the VM's network interface to Bridged mode, everything works.

Friday, July 13, 2012

Cygwin OpenSSH Server

SSH is a Swiss army knife of secure remote access and much more. It has been prevalent on all operating systems but glaringly missing from all versions of Microsoft Windows. Which is one of the reasons I put Cygwin on every Windows machine I am allowed to install software on.

Installing the SSH service in Windows has become much easier with the newest version of Cygwin, as instructions found online changing from that long to this short.

Yes, it is that simple to setup OpenSSH in Windows now. But problems do occur. The easiest way to fix an OpenSSH SSHD service installation problem is probably to follow the Cygwin SSHD HowTo: How to run the OpenSSH SSHD server on Windows using Cygwin instruction, remove an old installation and reinstall.

One particular installation I botched kept giving me Windows error code 1069 when trying to start the service. I double checked the user id configured for the service but could not find anything wrong. As it turns out, one thing I need is to make sure that the /var/empty folder (in Cygwin) is owned by and writeable to the user running the sshd service, which is cyg_server if you follow the short instructions above and run ssh-host-config -y to setup the sshd service.

After the installation and starting the service, you should be able to test it by opening a Cygwin terminal window and connect to the computer itself using ssh localhost.

If you can connect to the localhost but not from a different computer, you may need to add a Windows firewall exception for SSH by allowing incoming connection to TCP port 22.

While writing this note, I found the two part tutorial The 101 Uses of OpenSSH (Part 1 and Part 2, published in the LINUX Journal on Jan 01, 2001 by Mick Bauer) to be a quite comprehensive read. But still, SSH offers much more.

Tuesday, June 12, 2012

A Google Docs Bug

Google Docs seems to have a bug with adding a center tab-stop. It's hard to tell what version I am using since Google doesn't show that anywhere. But I have tried this both as a regular Gmail user and as a Google Apps user.

This seems to happen only when adding a center tab-stop when a marked block (in my case, several list items), with one of the lines marked having a previously added center tab-stop -- It did not happen when that center tab-stop was previously added, nor did it happen after that center tab-stop was removed before this action is repeated.

Here is how it happens:

  1. Add one center tab-stop in the first list item line;
  2. Mark the list items;
  3. Add a center tab-stop in the same spot (being at the same spot may or may not matter);
  4. Immediately, you get the Google Docs error pop-up message in the middle of the window and the red error bar on the top (see screen captures below).

I have been able to reproduce this error in both Firefox and Chrome.

The work around seems to be removing existing center tab-stops. But I guess if there are many of them, that could get annoying.

Saturday, May 12, 2012

Random Ranting on Cisco Prime LMS

Cisco Prime LMS is the company's LAN Management Solution software, re-branded from the CiscoWorks label. I am sure there are many reason for the re-branding for marketing reasons, but one of them, I believe, is that CiscoWorks has never worked very well.

Cisco has a decent reputation with its networking gears, with the company's long history in the industry. What surprises me is that, Cisco's software (which is running all those iron boxes) are of such low quality that it is almost shocking.

Case in point: Cisco Prime LMS, which is at version 4.2 as of this writing. LMS also has had a long history. I am not into all the details but from what I have learned from working with it: there are a few main modules that Cisco has acquired from other companies -- the Campus Manager (CM), the Resource Management Essentials (RME), Device Fault Manager (DFM), Internetwork Performance Monitor (IPM), CiscoView, and more recently the Health and Utilization Monitor (HUM) is added into the mix. Before version 4, those modules are clearly displayed in CiscoWorks portal as distinctively independent pieces with visible overlaps and confusing user interface layouts. For example, many of those modules do Reports. I as the user of LMS need to know exactly where to go to create what report.

Although things have not changed much under the hood, so to speak, LMS 4.x versions have done a better job in presenting a more unified user interface over those modules that still function pretty much the same way they used to. The main menu is now organized into functional activities: Monitor, Inventory, Configuration, Reports, Admin and Work Centers -- These are now the main UI menu components.

Judging from what I have heard from others, it is not my ignorance of the product alone that makes it so difficult to use. The software is at version 4.2 at this point, to expect it to not break down randomly should not be an unreachable goal. But that just seems to keep happening.

A minor case of quality problem: I want to run a script to export the user tracking data. Since that data is then fed to other scripts that I don't control, I need to use a custom layout for the export so that I don't break other people's scripts.

I created the layout in the Report Designer. When I tried to use the layout, I got an error message saying that ERROR UTCLI: Error loading preferences. custom-ut-export-layout is not a valid layout name for this user.

Since there seems to be no way to allow a custom layout designed by one user to be used by another -- at least I have not been able to find that if it does exist, I deleted the layout. Logged out of my session. Logged back in under the user account in my script. Re-designed the layout with the same name. Re-ran my script. I got the same error.

I logged back in as the script user, went to the Custom Layouts page. My layout was nowhere to be found.

I logged out. Logged back in as myself. No custom layout of that name, or in fact, no layout besides the three standard ones in the list.

Out of ideas, I restarted the LMS. Logged back in, still nothing.

Logged back in as the script user, created the custom layout with a different name. I made a copy of it just in case. I logged out then back in again. Nothing. Both copies of my layouts are gone.

To make sure that I didn't confuse LMS, I restarted it, then repeated my steps. Still the same result: No custom layout.

At this point, I seem to have lost the capability to create custom layout with no clue about what I did wrong to get into such a bind. Maybe because I reused the layout name between two users? If that was a bad thing to do, I certainly did not receive a warning from the software.

I should probably start to look for an open source alternative to LMS.

Friday, May 11, 2012

SNMP MIB Version Control

I work with Cisco devices a lot, especially in network management. So I naturally have to work with SNMP. Cisco does a pretty good job when it comes to publishing their MIBs. But often I find much inconsistencies in their MIB file distributed from different sources. From minor issues of file-naming differences (you may find the same MIB in files with .mib, .my or .txt extensions), to major changes inside the MIB without a version update. This is probably not a problem that happens in Cisco alone.

It occurred to me that these files are just text, so source code version control tools are perfect for managing them. Digging around a little bit on Google Code and github, I found out some one had already done it.

The SnmpMibs project on github is just what I was thinking about. I hope that the project gets more widely recognized. Especially, I think network device vendors should adopt this model in publishing their MIBs, that would make this whole world a slightly better place.

Monday, May 7, 2012

Cisco LMS: It Depends on What "IS" Is

One has to be a certain age to understand the meaning of the statement: It depends on what the meaning of the word IS is. But the other day, Cisco's LAN Management Solution software gave me a subtle reminder.

After setting up the Cisco Prime LMS 4.2 appliance, and struggling through issues like throwing up an null pointer exception (Ironically, Java claims having no pointer as an advantage over C.) when looking up User Tracking summary, we find out that it is not archiving device configurations from most of our devices.

In troubleshooting this, I see that all descriptions of the job failures are the same:
SSH: Failed to establish SSH connection to 111.222.33.44 - Cause: Authentication failed on device 3 times. TELNET: Failed to establish TELNET connection to 111.222.33.44 - Cause:  Connection refused.   PRIMARY-STARTUP config Fetch Operation failed for TFTP.
That could not have been all true! Because when I manually SSH from the appliance to the device, using the credentials setup for LMS, I had not problem. In fact, when I do a Reachability Status test in Device Center, SSHv2 shows success.

In Reachability Status I did notice that SNMPv2c Write shows failed, which I did not dig into in the beginning thinking there may be an issue with an access list not getting updated to allow SNMP write traffic through. When I did credential test on a selected device, SNMP write succeeded, which initially lead me to think SNMP was not an issue. But then I grew a bit suspicious and took a second look at the credential checking job: It turned out that the LMS reported success on the SNMP write check because it did not do any checking because there was no credentials setup for it.

So, LMS reports failure on SNMP write access but success on SNMP write credential check -- This, unfortunately, is just one example of how LMS could be confusing. It seems to come down to depend on what the meaning of the word success is.

So I re-entered my default credential sets and applied them to my discovered devices -- That seems to have fixed the SNMP write reachability failure. After that, configuration archive started to work a lot better.

On my way trying to get into the LMS to check something as I was writing this, I got a 404:


Really? An error for missing the favicon? (I didn't have time to figure out what was the issue, so I just restarted dmgtd.)

Tuesday, May 1, 2012

Notes on Drush

My drush commands suddenly stopped working -- I have been too lazy to follow the project, so now I have to dig in to find out why.

As it turns out, the drush command object structure seems to have changed since version 3.x, hence this note to self:

/**
 * Matches a commands array, as returned by drush_get_arguments, with the
 * current command table.
 *
 * Note that not all commands may be discoverable at the point-of-call,
 * since Drupal modules can ship commands as well, and they are
 * not available until after bootstrapping.
 *
 * drush_parse_command returns a normalized command descriptor, which
 * is an associative array with the following entries:
 * - callback: name of function to invoke for this command.
 * - callback arguments: an array of arguments to pass to the calback.
 * - description: description of the command.
 * - arguments: an array of arguments that are understood by the command. for help texts.
 * - options: an array of options that are understood by the command. for help texts.
 * - examples: an array of examples that are understood by the command. for help texts.
 * - scope: one of 'system', 'project', 'site'.
 * - bootstrap: drupal bootstrap level (depends on Drupal major version). -1=no_bootstrap.
 * - core: Drupal major version required.
 * - drupal dependencies: drupal modules required for this command.
 * - drush dependencies: other drush command files required for this command (not yet implemented)
 *
 * @example
 *   drush_parse_command();
 *
 */

Tuesday, March 27, 2012

Drupal 6 jquery_update and jQuery 1.7.1

In experimenting jQuery 1.7.1 with Drupal 6, I found my portman application which uses jQuery UI is broken. Searching on Drupal's website, it seems that the discussion has been going on for a while, dating back to jQuery 1.5. There may be other issues with newer jQuery versions as many Drupal modules are not updated to work with new jQuery.

So, this article is written to record my experiment only. Use the information here with caution if you do.

The jquery_update module would not load the minified jQuery 1.7.1 because the version id in the minified file changes for some reason. I choose to patch the jquery_update module -- hopefully jQuery people don't change the version id too often. Below is the patch.

--- jquery_update.module~       2010-04-23 12:34:39.000000000 -0400
+++ jquery_update.module        2012-03-27 10:54:30.170830649 -0400
@@ -96,7 +96,8 @@
  */
 function jquery_update_get_version($jquery_path = NULL) {
   $version = 0;
-  $pattern = '# * jQuery JavaScript Library v([0-9\.a-z]+)#';
+  $pattern1 = '# * jQuery JavaScript Library v([0-9\.a-z]+)#';
+  $pattern2 = '#/*! jQuery v([0-9\.a-z]+) jquery.com | jquery.org/license */#';

   // No file is passed in so default to the file included with this module.
   if (is_null($jquery_path)) {
@@ -105,7 +106,8 @@

   // Return the version provided by jQuery Update.
   $jquery = file_get_contents($jquery_path);
-  if (preg_match($pattern, $jquery, $matches)) {
+  if (preg_match($pattern1, $jquery, $matches)
+      || preg_match($pattern2, $jquery, $matches)) {
     $version = $matches[1];
   }

Wednesday, February 22, 2012

Difficulties with Google Gadget in WordPress

I had a hard time trying to put my little flickr-show Google Gadget into a WordPress page -- Various versions of the gadget has been used in Google Sites and Blogger pages (also on the sidebar) successfully.

This gadget is very much a proof of concept: The Gadget concept is Google's way for developers to write small apps in XML and JavaScript that could be placed in all kinds of web pages and the Google Desktop. It's not a novel concept but Google seems to be the most open among the companies that have something like it. Google Gadget is simple conceptually: You write an XML module that specifies a number of things, among that relevant to interfacing with the users are (1) a section for options, (2) content area which functions as an HTML/DOM container, (3) JavaScripts that work in the content area and (4) optional message files in XML for multiple language support.

One issue I take with Google's handling of gadgets is inconsistency: The same gadget behaves differently in Google Sites than in a non-Google website where you have to use Google's gadget creator tool to turn the XML modules into an HTML for rendering by user's browsers. Little differences can be very annoying. For example, the gadget creator tool generates three div containers around the iframe with white background color for no apparent reason. I mean, I can understand that Google wants to put their logo on rendered gadgets, but why this obnoxious white background?

Blogger allows gadgets in the sidebar directly. But if you want to put one in your blog entry contents, you have to run it through the gadget creator. Now, on to what I think is a bug somewhere in the Google code cloud. The code the creator tool generated calling Flickr's API function to search for photos returns an empty list in a WordPress page while it works in a Blogger page -- I have later learned that this could be caused by the chaotic use of jQuery in WordPress and many of its plugins, but this seems to be a problem of a different kind as the call does go out through Google's gadgets.io.makeRequest() proxy function and return with results.


To avoid using the Google gadget creator tool, I made changes to make the flickr-show.js module work with or without the Google Gadget API.


On the WordPress side, we observed a situation in which multiple instances of jQuery gets loaded. Which caused chaos for jQuery UI: UI widget functions would randomly disappear from the jQuery namespace. WordPress seems to need a JavaScript library manager badly -- something like the Drupal JavaScript Libraries Manager.

Tuesday, February 21, 2012

An InterMapper Probe in Python

InterMapper ships with Python -- the recent releases come with Python 2.7, making extending it using Python a natural choice.

So when a colleague diagnosed a problem between Cisco ACE and some application servers it load-balances for, I thought about turning his curl script into a probe. Previously I tried to put curl on the Windows 2008 server where our InterMapper software runs, but I didn't get far with that effort. I turned to Python since then when I need to do anything with InterMapper, like writing notifiers and probes.

My notifier and probe code are available on Google Code. My first probe is one that talks to the Cisco xml_agent process, which seems to be supported in more and more Cisco boxes. The probe itself is in the xmlprobe.xml file -- Simple installation instructions are found in there. It connects to the agent on a Cisco box via HTTPS and runs a command configurable either in a configuration file or via InterMapper's "set probe" dialog.

Lessons learned in writing this simple probe: I really hope InterMapper has more documentation about the details of the probe syntaxes. For example, in the section, the arg value doesn't seem to require quotes around it, which leaves the double-quote to be used for quoting individual command line parameters. Also, Windows handles quoted command line parameters differently than Linux -- That caused my much grief as the command used in this case is "show xlate global %(vip)s | count" and the vertical bar caused error when InterMapper runs the probe although it runs fine manually under Cygwin. After searching around in the InterMapper support forums, I happened upon an earlier Q&A topic and found out how to turn on the detailed logging for troubleshooting a command line probe, which revealed the error that I did not see in my manual command line tests.

This probe still looks messy: The JSON configuration data has to be edited manually. It seems that a web-based front-end tool would be helpful. It seems that InterMapper could extend its HTTP API so that the remote access client could be extended through server side plug-ins.

Thursday, February 9, 2012

Working with Cisco LMS Database in Python

Cisco has published its CiscoWorks LAN Management Solution (LMS) database schema (4.2) since version 3.2. JDBC and ODBC are supported methods for accessing data LMS has collected. Setting up ODBC is a bit involved especially when I don't have the privilege to upgrade OS in a box. I don't particularly like Java either. So I thought about getting access to the data locally and possibly provide that data remotely through a web-based interface using an easier-to-use Python-based framework, maybe something like web2py.

So I installed Jython on the Windows Server 2008 box which runs my LMS 4.1 installation, copied down some sample Java code from Cisco and translated that into Python. After a few tries to get Jython to find the right Java class path, it actually worked.

So here is the code (of course, userid and password have to be filled in) that prints a list of devices in the database:


#!/usr/bin/env jython
##
##      Requires this: export CLASSPATH='E:\CSCOpx\lib\classpath'
##


import time
import java.sql


import com.sybase.jdbc2.jdbc.SybDriver


conn = java.sql.DriverManager.getConnection("jdbc:sybase:Tds:localhost:43441?SERVICENAME=cmfDb", userid, password)
print('[%s] INFO: Connection successful...' % time.strftime("%c"))
stmt = conn.createStatement()


query = "SELECT Device_Id, Device_Display_Name, Management_IPAddress FROM Network_Devices"
rs = stmt.executeQuery(query)


cnt = 0
while rs.next():
        cnt += 1
        print("%d. Device Id: %s" % (cnt, rs.getString("Device_Id")))
        print("  Display name: %s" % rs.getString("Device_Display_Name"))
        print("  Management IP address: %s" % rs.getString("Management_IPAddress"))

Friday, February 3, 2012

Obscure Problem with LMS 4.1

Finally got around to put Cisco Prime LMS 4.1 (They seem to be retiring the CiscoWorks brand.) on a Windows 2008 server -- I want to go the appliance route but more work is needed to get a VM in the enterprise environment for that.

First impression: LMS 4.1 looks very different from 3.2.1 on the web-based GUI. Cisco did put effort into modernizing the web-based interface and rearranging components to suite a network manager's work flow rather than around the various pieces that Cisco acquired to make up the LMS bundle. However, one may learn quickly the difference is much less profound under the hood.

Right off the bat, I hit a small snag.

After installation, I enabled HTTPS in Admin by going into Admin » Getting Started » Other System Settings » System Settings » Browser-Server Security Mode, selected Enable HTTPS and applied that setting.

After that, a user browser visiting the LMS server using HTTPS://server-name is redirected to http://server-name:1741/... after login, which produced a 403 (Forbidden) error.

TAC was not much help in this case. After poking my way around the server and the GUI, I think I have fixed the problem:

Go to Admin » Trust Management » Local Server » Browser-Server Security Mode Setup, select Change Setting To: Enable and apply.

It seems to me that both Browser-Server Security Mode from Getting Started and Browser-Server Security Mode Setup in Trust Management should mean exactly the same thing. But apparently they do not do the same thing.

Wednesday, January 18, 2012

Monitoring a Lenovo ThinkServer, with Help from Cygwin

The box is running Windows 2008 Server Foundation, which is a bare bone of Windows server software. But it works for a small business that has software that only runs on Windows.

The Lenove ThinkServer 100 series support an Intel SATA RAID controller. To monitor the RAID system, one may install the Intel Storage Management Console as described in this manual on page 10.

But there is a problem. Windows 2008 Server Foundation does not come with a mail server. The Storage Management Console is only capable of sending out notification of any issue in the storage system via plain vanilla SMTP (Simple Mail Transport Protocol), with no support for a smart-host kind of configuration.

Here is where Cygwin and its arsenal of software carried over from the UNIX/Linux world can help. I did not start out knowing what to do exactly. But simple Google search of Cygwin SMTP proxy turns up a lot of reading material. By the way, Cygwin should be on every Windows machine, just for packages like grep, openssh and rsync that comes with it if nothing else.

Following this article about running exim on Ubuntu to send email via Gmail, I have been able to get it up and running in short order. Installing exim is not very difficult. As of this writing, Cygwin comes with exim version 4.76-1. After installation, one runs exim-config to configure it.

There are things that need to be further configured. The line below to add the local network for mail relay:
hostlist   relay_from_hosts = 127.0.0.1 : 192.168.1.0/24
 To route mail not for local domains via Gmail:
begin routers
send_via_gmail:
        driver = manualroute
        domains = ! +local_domains
        transport = gmail_smtp
        route_list = * smtp.gmail.com
 To configure the Gmail SMTP service:
begin transports
gmail_smtp:
        driver = smtp
        port = 587
        hosts_require_auth = $host_address
        hosts_require_tls = $host_address
 Gmail SMTP server requires user authentication:
begin authenticators
gmail_login:
        driver = plaintext
        public_name = LOGIN
        client_send = : your-account@gmail.com : your-account-password

That's it! After that, start the exim service using net start exim. From the Intel Storage Management Console, one may then configure it to use the local server as the SMTP server to send out email when issues occur.

Friday, January 6, 2012

HP Quality Center


So, I guess they call this software Quality Center -- I just am not sure how they do that with a straight face.

Let me see:

  • It is a web-based application, yet Only Internet Explorer 6, Internet Explorer 7 and Internet Explorer 8 are supported.
  • And, I am supposed to figure out what the !@#$% CAPICOM.DLL is and how to get it installed?

Sunday, January 1, 2012

Impressions of Barnes and Nobel Nook Tablet

I saw a co-worker carrying his Barnes and Noble Nook Color around a lot, so I asked him about it. He said that he was pleased with it. So when the Nook Tablet came out, I compared it with the Amazon Kindle Fire and decided that the Nook Tablet has a better package over all: more RAM (1GB vs. 512MB), more flash storage (16GB vs. 8GB), and the Nook has a microSD slot that the Fire does not. So when B&N offered me a $25 discount as a former Borders' customer, I got one for my daughter.

But now I am starting to have second thoughts. The Nook feels nice when used for reading books purchased from Barnes and Nobel, but that seems to be the only thing it is good for. Since we have not had time to watch videos on it yet, I can't really say much about that except that video streaming from the same providers, Hulu and Netflix, should not differ much from using the same apps on a similar Android tablet.

The main problem is that, the Nook limits user storage to 1GB out of the 16GB in total, which means in practical terms, one can not install much of anything on it. I did install the Amazon App Store on it via side-loading. Now it refuses to install Kindle for Android.

Looks like it's time to root the device -- I was going to wait until the device is out of warranty. I understand that B&N is competing with Amazon. But limiting what the device does for its customers is not the right way to do it.