Showing posts with label monitoring. Show all posts
Showing posts with label monitoring. Show all posts

Friday, October 13, 2017

Exchange post-reboot emailed status confirmation script

10/13/2017: If you've got a lot of servers to keep track of - whether doing maintenance (patching), or experiencing the inevitable random reboots/unscheduled-virtualization-burps/what-have-you - you want to know the full status of the system, as quickly as possible IMMEDIATELY after it comes back online. To that purpose, this script is the current rev of a series I've been using for the niche since 2007 or before.

In this case, it's the Exchange-specific version. I generally configure it as a Scheduled Task triggered by the OnBoot event (with a fire-delay for Win2012R2+). The script logs a transcripted file & emails an html-format report, covering the following tests & status:

Thursday, September 28, 2017

Powershell server RDP ping availability script

9/28/2017: Just a quicky today: A couple of quick bits I keep in my profile, and routinely leverage for server maintenance. Run ping-RDP.ps1, it will prompt you for a target server, and then run a looping port-test (1sec interval), until it detects the RDP port 3389 is up on the target box. At that point it launches an RDP session (mstsc.exe /v:$($tsrvr). Pretty simple, but handy when you're doing concurrent maintenance across multiple boxes.

Friday, September 22, 2017

Exchange Hub Top Queued Domains (Powershell Snippets)

9/22/2017: Here's a couple of quick code snippets for Exchange Server: I use this when I see external delivery domains piling up (in my running get-HtQueuesMonitor.ps1) , to quickly pull out the details on the problem child external domains.

Thursday, October 10, 2013

Powershell Script - Remote Drivespace (Mountpoints) Emailed Report

10/09/2013: Today's post will outline a remote drivespace reporting script that I routinely use to monitor and report on the available Transaction Log space on my Exchange servers. The script leverages WMI to remotely query for the current freespace & volume size metrics (on either specified drive letters, or all Volume Mount Points on the target system), calculates the space in terms of gigabytes and percentage-free, outputs a report file, and emails the results to an admin mailbox.

I'd generally design this type of script to leverage Exchange Management Shell and dynamically query all servers in the appropriate site in the mailbox role (to automatically accommodate server adds and removals over time). But in this case I wanted this script to be 'blind' to Exchange version differences and also avoid a dependency on Exchange Management Shell. A specific goal in this case was to provide a tool to enable junior admins to evaluate the drive status after backup failure alerts, without the need to run the queries from a machine with a specific version of the Exchange Management Tools installed. So I instead use semicolon-delmited string variables to statically store arrays of server names for processing within the script itself.

Wednesday, October 9, 2013

Powershell Script - Hub Queue Live Monitoring Script (Exch2007/Exch2010)

10/09/2013: Here's a script I've used in various forms since around 2007: A basic rolling Exchange Hubtransport Queue Depth monitor.

I've found over time, that regardless of SCOM or other active monitoring in place for your Exchange infrastructure, you can often see problems show up early and first in queuing behavior on your HubTransport servers:
  • Experiencing mail server storage latency issues? You'll probably see increasing patterns of queuing in the MapiDelivery queues to the problem stores, as you move into peak business primetime hours and increasing mail load delivers into the hubs, but can't be delivered into the mailbox server transaction logs and stores, fast enough to keep pace with the mail flow.
  • Experiencing cpu-saturation, or other capacity issues on your hubs, or Hub-CAS hybrid systems? You'll probably see the footprint on the CPU-dependant AV-scanning processes (you ARE running antivirus scanning on your hubs, correct? :D), which will lead to mail queuing in the Submissions queues.
    --in my case, I most recently saw this as a product of CAS Exchange Web Services load -- from Lync -- soaking up more CPU than the systems had been provisioned for, in 2007, well before the Lync infrastructure had been tacked onto the Exchange infrastructure -- looong story behind that one, that predated my arrival at the firm. :P))

So in a nutshell, I've found it a pretty good backup-monitoring option, to run a self-refreshing console display on the current queue status of all hubs in a given Exchange revision.

Wednesday, October 2, 2013

Powershell Script - Using EMS Get-MessageTrackingLog + LogParser to Retrieve Top-Traffic Metrics for the Hubs in a Site

10/02/2013:All mail admins will occasionally see "odd" Exchange HubTransport queuing behavior for "unknown" reasons (I'll generally notice these type of events in response to monitoring alerts or via a looping get-queue monitoring script I run 24/7).

In most cases these little 'surges' come and go in a matter of minutes with no material impact or footprint. But on other occasions, you see something about the queuing that warrants further investigation into exactly what occurred:
  • Possibly your interest is piqued due to the amount of mail that queued up (say a sudden spike into hundreds if not thousands of messages in normal delivery queues)
  • Or possibly you want to check further due to mail rapidly piling up in queues where you traditionally should see little to no traffic (e.g. in the Unreachable queue).