mstaint.com Less paint more taint!


1
Sep/09
0

Detect empty arrays in VBScript

So for those of you who have tried to determine the size of an array in VBScript and have failed this may be for you. I recently needed to be able to determine if an array was size 0 in VBscript and was running into some issues.

VBScript does not have a .SizeOf() function that you can execute on an array to determine it's size. Normally what I would do in most other languages is something like the following:


if sizeof(array) = 0
{
//do something here
}

To accomplish this in VBScript you need to do the following.


If IsNull(array) Then
//Do Something Here
End If

Why can't you do things like the rest of the world VBScript!!!!! That is all.

30
Jul/09
2

Windows Update monitoring with Xymon

Xymon is a pretty cool and free system and network monitoring solution. Some of you may know it as Hobbitmon as it recently was forced to change it's name because of some lawsuit I guess.

For those of you who haven't heard of it before check it out over at http://hobbitmon.sourceforge.net/. We use it currently at RIT to monitor a few hundred systems ranging from Windows to VMWare and Solaris. It basically does it all.

Using the BBWin client over at http://bbwin.sourceforge.net/ we are able to monitor anything and everything that you can script in Windows. Whether it be monitoring drive and memory usage right on down to parsing log files for specific events...if you can script it, it can be monitored.

What I ended up doing was writing a VBScript that would be executed by BBWin and would then use the Windows Update API built into windows to check and then create a report about critical patches not being installed or active (the patch installed but system not rebooted).

You can download the script on my Google Code at http://code.google.com/p/mstaint/. Installation instructions are included in the zip file download.

Drop me an email if you have a feature request for something you would like to see added to it.

Enjoy.