vanessa's profilesensory overloadBlogListsNetwork Tools Help

Blog


    11/22/2007

    Document your network

    Sydi seems to be the easiest, quickest way to generate documentation around your environment. From this site, you can download the Server, Exchange, SQL and Linux sydi scripts. A MOM sydi script is available here.
    The output produces a Word document by default, containing more information than you can possibly collect all by yourself. It is very useful, and takes a couple of minutes to run in a large environment.

    Talking about MOM 2005 - Custom disk space

      I recently posted a custom disk monitoring script here:

    MOM 2005 - Custom disk space

    which worked fine, but it didn't quire meet our requirements. We have updated this script to have thresholds based on the total size of the disk, which looks like this:

    ________________________________________________

    '*******************************************************************************
    ' Script Name - Custom - Check Disk Space
    '
    ' Version     - 0.2 (22-nov-2007)
    '
    ' Purpose     - Determines the % free space available on the logical disks
    '               and logs an event if the threshold is breached.
    '
    ' Events      - 1100 = "Disk space utilisation has breached warning threshold" (Warning)
    '             - 1101 = "Disk space utilisation has breached critical threshold" (Critical)
    '
    '
    '              
    '*************************************************************************

    ' --- Define Constants ---
    ' Event types
    Const Event_Type_Success = 0
    Const Event_Type_Error = 1
    Const Event_Type_Warning = 2
    Const Event_Type_Info = 4
    Const Event_Type_Audit_Success = 8
    Const Event_Type_Audit_Failure = 16
    ' Strings
    Dim strComputer, intThresholdSys, intThreshold, strMessage


    Dim objEvent 
    Dim objWMIService
    Set objEvent = ScriptContext.Event

    strComputer = "."

    Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!//" & strComputer & "\root\cimv2")
    set colItems = objWMIService.ExecQuery("Select DeviceID, FreeSpace, Size from Win32_LogicalDisk where DriveType = 3") 'Grab the name, the free space and total size for fixed drives

        For Each objItem In colItems
       
            TotalSize = FormatNumber((objItem.Size/1073741824), 2, -2, -1, 0)
            strDrive = objItem.DeviceID
            FreeSpace = FormatNumber((objItem.FreeSpace/1073741824), 2, -2, -1, 0)      
             
        if TotalSize <= 1 then
            intThresholdW = 0.244
            intThresholdC = 0.1
        elseif TotalSize >= 5 and TotalSize < 10 then 
            intThresholdW = 0.488
            intThresholdC = 0.244
        elseif TotalSize >= 10 and TotalSize < 50 then
           intThresholdW = 2
           intThresholdC = 1
        elseif TotalSize >= 50 and TotalSize < 100 then
            intThresholdW = 10
            intThresholdC = 5
        elseif TotalSize >= 100 and TotalSize < 200 then
            intThresholdW = 15
            intThresholdC = 10
        elseif TotalSize >= 200 then
            intThresholdW = 50
            intThresholdC = 25
        end if
       
        FreePerc = FormatNumber(100*(FreeSpace/TotalSize))
       
       
        if cInt(FreeSpace) < intThresholdW and cInt(FreeSpace) > intThresholdC then 
           
            strMessage = "Disk volume " & strDrive & " is low on free space. Free space available " & FreeSpace & "GB, which is "& FreePerc &"% free. This disk's total size is "& TotalSize &"GB and the threshold for this disk is " & intThresholdW &"GB."
            CreateEvent 1100, 1
           
        ElseIf cInt(FreeSpace) < intThresholdC then
       

            strMessage = "Disk volume " & strDrive & " is low on free space. Free space available " & FreeSpace & "GB, which is "& FreePerc &"% free. This disk's total size is "& TotalSize &"GB and the threshold for this disk is " & intThresholdC &"GB."
            CreateEvent 1101, 2
           
        ElseIf cInt(FreeSpace) > intThresholdC then
           
            strMessage = "Disk volume " & strDrive & " has " & FreeSpace & "GB available as free space, which is "& FreePerc &"% free. This disk's total size is "& TotalSize &"GB and the threshold for this disk is " & intThresholdW &"GB." 
            CreateEvent 1102, 4
              
        End if
       
        if strDrive = "C:" then
       
            strMessage = strMessage & " This is a system drive, and a low disk space condition may affect the overall performance of the system."
       
        end if
       
        next


    ' Sub         : CreateEvent
    ' Parameters  : None
    ' Description : Create and submit an event

    Sub CreateEvent (ByVal StrEventID, strEventType)
        ' Create new event and submit event objects
        set objCE_NewEvent = ScriptContext.CreateEvent     ' Set event properties
        objCE_NewEvent.Message = strMessage
        objCE_NewEvent.EventNumber = StrEventID
        objCE_NewEvent.EventType = strEventType
        objCE_NewEvent.EventSource = "Custom Disk space monitor"
        ' Submit the event
        ScriptContext.Submit(objCE_NewEvent)
        set objCE_NewEvent = Nothing
    End Sub

    ____________________________________________________

    I still suck at commenting Wink

    The script checks the total size of the disk, as well as the free space available, and then matches that up with the threshold specified. strThresholdW is the warning threshold and strThresholdC is the critical threshold. An event will be generated based on which threshold was breached. If neither thresholds have been breached, an info event will be logged.
    If you configure this script in your MOM environment, you need to create a timed event rule to run the script, and then a rule for warning alerts (event id 1100) and a rule for critical (event id 1101).

    11/20/2007

    HTC s710

    I have had my sparkly new HTC s710 for just about a month, and I might just be a little in love with it. I am not Stephen Fry by any means, and typically only get a new phone every 2 years, when my contract is renewed. I am also rather stingy, and will not pay outright for a phone, so I generally select the highest end phone that is available for free on my contract.
    My last phone was a Nokia 6670, which was a really cute, entry level smart phone that allowed me to send email, sync my calendar and sometimes, browse the internet. Oh, and I could receive calls.
     
    I have grown tired of Nokia, and wanted to try a different brand. When I started looking for a new phone, I decided that the next phone had to be a Windows Mobile phone. I am a techie, afterall, and I could see the benefits of going Windows Mobile, since it would allow me to load a couple of tools onto my phone, meaning I could, if i wanted to, manage my devices remotely.
     
    The good of the s710:
    • The interface is easy to use and intuitive. I no longer spend ages looking for things, because the locations of apps and files are where I expect them to be.
    • Wireless baby! I am no longer restricted to using Bluetooth and GPRS, because I can connect my phone to any wireless network, and use network and internet services without running up my phone bill.
    • The camera takes lovely pictures
    • Call quality is fantastic
    • Media Player!!!
    • Office compatibility
    • Did I mention wireless?
    • QWERTY keyboard. I was worried aout the slidey-outy keyboard, but it is sturdy and strong, and will be able to survive me for the 2 years that I will have this phone.
    • Internet explorer! and MSN!
    • Lightweight
    • Good screen size

    The bad and the ugly:

    • There doesn't seem to be an automatic picture download function. This is a bit of a bother, especially since my Nokia had this.
    • I haven't been able to figure out how to exit most applications, so I frequently close my apps by using task manager
    • Amazingly, one can only sync with one Exchange/MAPI profile. I was hoping ot be able to sync with both my home and work calendars, but this seems impossible.
    • Setting custom ring tones are confusing, to say the least.

    My requirements for a handset is simple: I want to make calls, receive calls, take pictures, listen to music, send email and have internet access. This phone meets those requirements, and has so much more to offer that will take me a fair while to discover. It feels like the logical step to take if one upgrades from an entry level non-Windows smart phone, rather than going to something bulky like the TYTN.

    11/15/2007

    a cautionary tale of wine and technology

    my laptop. *sighs* the night before last, she went mad so... i reinstalled. the laptop didn't crash and i didn't lose data. the laptop just went mad.
    i thought that, just maybe, it was the drivers, so i started by reinstalling the drivers, specifically for the network devices (as i lost all network comms on wireless and nic). nada.
    so, i reinstalled xp, loaded all the drivers and *tada* ... nope. still fooked.
    but i know i am just not compatible with xp, so i thought i would try my old friend, windows 2003 server. and... nope.
    by this time i had consumed copious amounts of wine, and remembered that my laptop came *giggle* with vista - of course this was the logical step. i installed happily. drinking some more wine and installed the drivers, full of drunken hope. nada.
    so i thought i would see what the vista experience score would be (don't ask why i would wonder this while all this other stuff is going on), and, strangely, while running the system check, the wireless controller decided to return to life (is it now a zombie?). yay.

    added my machine back to the domain, which prompted a reboot. bad idea. networking gone again.

    despondent, i switched the bastard off. had some more wine and went to sleep.

    the next morning, the wine had left my system and i decided to be a sober brave by switching the machine back on. lo and behold, i had network. i reboot and still had network. wow. installed office and still had network.

    the moral of the story: drink more wine
     
    actually, there is no moral to the story.
     
    after installing office, i managed to download my mail, and then had to run off to work. got home to a disconnected machine. i am currently moving all my stuff off the laptop, so i can restore it to factory default and take it in for repairs.
    11/6/2007

    Nano and the geek

    in my sphere of existence, it would almost seem like the whole world has gone Nano mad. and if the Nano i am referring to was nano technology, then it would make sense for this entry to appear on my tech blog.
    but it is NaNoWriMo (National Novel Writing MOnth), which happens every year november. the idea behind it is to write a 50000 word novel in a month. to the casual observer or lighthearted blogger, this may not seem all that difficult. the average blog entry (not mine, but for, you know, proper bloggers) is probably around 800 words. an A4 page in Word can hold around 450 words. 50000 words is peanuts, right?
    except, it is 50 blog substancial blog entries, or 180 A4 pages. to write 50000 words in a month, one has to write in the region of 1600 words on a daily basis, which is 2 substancial blog entries.
     
    but, you have to do this in addition to the stuff you normally do.
     
    why is this entry in a tech blog then?
     
    well, firstly, because this geek decided to sign up for NaNo this year. and, secondly, because my tool of choice for NaNo is Word, and it has been about a year since i have last written about Word, and office in general. The last time I wrote about Office, the 2007 edition was still in beta. The final release has been out for most of this year, and I know it is being adopted, both by businesses and home users, rather rapidly. It is still my favourite version of Office ever, and, if possible, I would like to have Word's babies.
     
    Word 2007 is my new best crush. I know some of the users have struggled getting used to the new interface, but, for the first time, Word makes sense to me. Finding the dictionary and thesaurus (very important for writing) is suddenly a breeze, and formatting on the fly no longer requires arcane knowledge and summoning demons. Templates have also been improved to allow a complete novice to create professional (or fun) documents within seconds, without having to hire a graphic designer.
    I am a bit of a finicky user, and struggle to use an application completely if I find it unfriendly. I loved writing in WordPerfect (oh so many years ago), and it seemed to aid my creativity greatly, just by being friendly. I haven't had the same experience with Word, until now. Suddenly, I am a cornucopia of words, the story streaming from me like a comet's tail - and, even if Word cannot help me be a better writer, it is friendly enough to allow me to get my story out.
    Now, if Word can just learn to dispense chocolate at the right time, we might just get married.
    11/2/2007

    XML errors

    Just a FYI (for myself more than others)
     
    If you are trying to read an XML file, and you have attached the filename to a variable, and you then delete the variable line from your code, you will get a Permission Denied message.
     
    So, if you are doing this:
     
      strfilename = objItem.Name
        
       Set xmlDoc = Server.CreateObject("Microsoft.xmldom")
       xmlDoc.async = False
       xmlDoc.load(Server.MapPath(strfilename))
     
    for example, and you delete this line:
     
    strfilename = objItem.Name
     
     
    Additionally, if you have spaces in your node names, you might also receive an Object Required error.
    11/1/2007

    MOM 2005 - Custom disk space

    If your environment makes use of SAN, NAS or other remote storage devices, you might also find the out-the-box disk space checker in MOM doesn't really work so well. I found a VBScript that uses WMI to check disk free space here, which eventually gew into this script:
     
    '*******************************************************************************
    ' Script Name - Custom - Check Disk Space
    '
    ' Version     - 0.1 (22-oct-2007)
    '
    ' Purpose     - Determines the % free space available on the logical disks
    '               and logs an event if the threshold is breached.
    '
    ' Events      - 1100 = "Disk space utilisation has breached threshold" (Warning)
    '
    ' Parameters  - strThreshold         = Threshold, in MB, for non-system drives. If this is not set, the threshold is 1024MB
    '               strThresholdSys      = Threshold in MB for system drives. This assumes that the C: partition is the OS partition.
    '                               If this is not set, the threshold is 1024MB
    '
    '              
    '*************************************************************************
    ' --- Define Constants ---
    ' Event types
    Const Event_Type_Success = 0
    Const Event_Type_Error = 1
    Const Event_Type_Warning = 2
    Const Event_Type_Info = 4
    Const Event_Type_Audit_Success = 8
    Const Event_Type_Audit_Failure = 16
    ' Strings
    Dim strComputer, strThresholdSys, strThreshold, strMessage
    Dim objEvent 
    Dim objWMIService
    Set objEvent = ScriptContext.Event
    set objParams = ScriptContext.Parameters
    strThresholdSys = objParams.get("StrThresholdSys")
    strThreshold = objParams.get("StrThreshold")
    ' set Thresholds
    if strThresholdSys = "" then
        strThresholdSys = "1024"
    end if
    if strThreshold = "" then
        strThreshold = "1024"
    end if
    strComputer = "."
    Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!//" & strComputer & "\root\cimv2")
    set colItems = objWMIService.ExecQuery("Select DeviceID, FreeSpace from Win32_LogicalDisk where DriveType = 3") 'Grab the name and the free space for fixed drives
        For Each objItem In colItems
            MBFree = FormatNumber((objItem.FreeSpace / 1048576), 2) 'Convert to MB then check for < 1GB
          
           If objItem.DeviceID = "C:" then
            If MBFree < strThresholdSys Then
                strMessage = "Disk volume " & objItem.DeviceID & " is low on free space. Free space available " & MBFree & "MB. This is a system disk, and the overall performance of the system could be affected."
                CreateEvent (1100)
            End If
           Else
            If MBFree < strThreshold Then
                strMessage = "Disk volume " & objItem.DeviceID & " is low on free space. Free space available " & MBFree & "MB."
                CreateEvent (1100)
            End If
        End if
           
        Next
    ' Sub         : CreateEvent
    ' Parameters  : None
    ' Description : Create and submit an event
    Sub CreateEvent (ByVal StrEventID)
        ' Create new event and submit event objects
        set objCE_NewEvent = ScriptContext.CreateEvent     ' Set event properties
        objCE_NewEvent.Message = strMessage
        objCE_NewEvent.EventNumber = StrEventID
        objCE_NewEvent.EventType = 1
        objCE_NewEvent.EventSource = "Custom Disk space monitor"
        'objCE_NewEvent.SourceComputer = strComputer
        ' Submit the event
        ScriptContext.Submit(objCE_NewEvent)
        set objCE_NewEvent = Nothing
    End Sub
     
    I suck at commenting (but I am getting better), but I think this is pretty easy to figure out.
     
    Your parameters are strThreshold and strThresholdSys. We wanted to be able to distinguish between OS and non-OS drives, and set different thresholds for each. So, strThresholdSys is your parameter for your OS drive/partition, and assumes that your OS is installed into the C: partition/drive. If you do not set the parameters when you configure the event rule, a default threshold of 1GB (1024MB) will be set, both for the OS and the non-OS drives/partitions.

    Change is as good...

    I recently started a new job as a MOM administrator, which means I am suddenly writing a whole bunch of scripts and doing all sorts of cool extensions on the base functionality of MOM. I will, on occassion, post some of those scripts/customisations here, on top of the general lively posts I normally make Tongue out
     
    Of course, I am by no means a scripting guru or a MOM expert, so this might also serve as a journal to chronicle my learning process - hopefully helping others who follow the same path in some way (even if by just sharing laughter)