O R G A N I C / F E R T I L I Z E R: 09.07

Sep 19, 2007

mom: missing data in top 100 mailboxes by size...

ran into a problem today where an administrator told me that their "top 100 mailboxes by size" report stopped working. now, to define the boundaries of "stopped working", let's evaluate these few things:
  1. report works for other servers
  2. report worked a month ago
i generally follow these basic rules to troubleshoot a report issue:
  1. check if the report contains data
  2. check if data exists in the console
  3. check if data exists in the reporting tables
so going on the boundaries of "stopped working", we start with step 1. i open up the report to verify what the person telling me is the same thing i'm seeing. in this case, it actually was. :o i tried switching the report to a different server and data came up. i tried switching it to the problem server and no data existed. perplexing! i went to step 2. to make this easier, i created some custom performance views to look at the object "mcexchdg" breaking it down into "mailbox mb" and "mailbox message count". both views work but again, same problem. no data is posted for the problem server. at this point, we know the rules must be working because some servers are posting data. this is definitely an agent-side problem then... right? since the person reported that this report worked on the same server in the past, we go to step 3. i ran a little query that looked like this just to see what was there:
select top 10 * from sdkperformanceview where computername = [problemserver] and performanceobjectname='mcexchdg'
i get back counters for mcexchdg but not for the expected "mailbox mb" counter! hmmm. so apparently the data never did exist for this server. so at least we know the thing never worked for this server, instead of thinking something changed along the way. to figure out what was happening, instead of being a good administrator and googling it, potentially finding results that could save me hours, i decided to use the script "exchange 2003 - collect mailbox statistics" to troubleshoot. in order to do this, i went through the following:
  • replace all createevent entries with wscript.echo
  • comment out on error resume next
  • use local reference of computer name instead of scriptcontext.targetnebioscomputer
now i figured when i ran it, i'd get errors. i did! i had to use an interactive cmd shell to make this work since the script demands to run as "localsystem". after that, i had to run through it for a few iterations to find where it failed, comment it, and move on. so what was the end result? you have to have the servernameMOM accounts. in this case, it turned out we did... however, someone inadvertently renamed the servernameMOM account!

mom: antigen retrieve update number script noise...

if you've got the antigen management pack deployed, you might be seeing a lot of irritating noise that looks similar to this message:
WARNING: are engine was not found on [servername]. Update number could not be retrieved.
a little bit of investigation in the script, prompts this joyful discovery. as it turns out, the script has no provision for logging/not logging errors that may occur. the only parameter that changes logging effect is one to log to text. apparently these events aren't very important since there are no corresponding alerts. :| hmmm. since it's generating quite a bit of event noise, i decided to shut off this behavior. this was easy enough. in the code block below, you'll see where i simply commented the line that writes the mom event. it's on line 81.
... 'If Update number is null, the engine was not found in the registry If IsNull(UpdateNumber) or UpdateNumber = "" Then WriteLog "WARNING: " & EngineName & " engine was not found on " & ScriptContext.TargetComputer ' WriteMOMEvent "WARNING: " & EngineName & " engine was not found on " & ScriptContext.TargetComputer & ". Update number could not be retrieved.", 2, Null ScriptContext.Quit End If ...
watch that word wrap... hope that helps!

Sep 18, 2007

misc: powershell compare-object to compare text files...

i guess i'm hooked because here i am again writing about this stuff. anyway, this was just too cool to pass up. using one line, you can compare two text files: compare-object $(get-content file1.txt) $(get-content file2.txt) didn't say the stuff was complicated. :)

misc: changing datetime stamps with powershell

i've been goofing off a little bit with powershell. it wasn't all the hype or fanfare from snover or the ps team or any of the other talented powershell people out there. it was a friend of a friend who kept talking about it until i was sick of hearing it. so, i spent a little time getting acquainted. turns out, it's pretty damn cool. it's more than hype... anyway, i took this post from ying li about manipulating datetime stamps on files. i thought i'd switch it into a one-liner... just for fun. here it is: gci | foreach {$_.lastwritetime = $(get-date).addminutes(5)}