Skip to main content

Posts

Showing posts from 2014

MongoDB Cluster Setup

I need to preface this with the following disclaimer: I have no prior knowledge of MongoDB, everything I have learned thus far has been from the MongoDB website and other blogs (my apologies in advance for not proper referencing, but I will try). I came into a situation where there was a need to develop and deploy a MongoDB cluster. And since I like learning new things, I decided to accept the project. The cluster consists of the following setup: One Mongos server, also acting a part of the config cluster Three Config servers Two Replica Sets, also configured into one Shard I'm going to do my best to go through a straight install of the cluster from my notes. I'm not really going to focus on what each item in the MongoDB cluster is, or attempt to explain how things work. These are just detailed notes on how to get a cluster up and running. I encourage you to check out the MongoDB website for information on MongoDB and each component in the cluster.

PowerShell Scripting: Low Disk Space Notification

Update 20150812 You'll see in the below comments that I left a global variable that was not required in the original script. The below post has been updated with that variable removed. Original Post So, I came across a need to have a script that checks the free space of a hard drive, calculates the percentage and send an e-mail notification of the free space is less than 10%. I figured that this could be scripted with PowerShell and run as a scheduled task in Windows. One thing I did find out is that I needed to create a service account in Active Directory with Server Admin permissions. Once you have that account in place simply copy the script below and name it "WhatYouWant.ps1" and set your Windows task accordingly. Disclaimer: I did reach out for assistance with creating this script on StackOverflow. My original script was writing the output to a text file, and copying the contents of that text file into the e-mail notification. This was not acceptable for the long

PowerShell Scripting: Get File Share Paths

Recently I was requested to locate the configured shares on the file servers and how they are mapped to their associated directories. As this information not only had to be retrieved, but also typed out to be passed along to the various managers, I decide a nice little PowerShell command would help accomplish this task in a quick fashion. What this command is set up to do is to get the file shares and organize them by the name and path, get the logical mapping of that share and finally pipe that information into a file called "outfile.txt" in the C:\temp directory. The location that the command saves to as well as the file name can be changed to whatever knocks your socks off. To get the share file paths in use by a server issue command: Get-WmiObject win32_share | ft name, path - auto | win32_logicaldisk | Out-File C:\temp\outfile.txt This command will result in the outfile.txt and you can then copy and paste that information into whatever documentation you would like