Monday, March 6, 2017
The SMTP server at my work has become quite unreliable. This is why I wasn't receiving email alerts from my Dell servers in my previous post. Also, in a web application that we host, students weren't getting email alerts that they should have been receiving. We changed that web application to use Office 365's SMTP server and email alerts have become reliable again. On the Dell servers, I was using an application I found called DellSMTPNotify.exe It worked great when our own SMTP server was reliable. It was time to take advantage of the more reliable SMTP server of our hosted Office 365 Exchange setup, but you have to use TLS encryption over SMTP to use Office 365. The DellSMTPNotify program does not support SSL or TLS encryption over SMTP as far as I can tell. It was time to investigate other solutions.
I found a PowerShell script called OMSA-Notify that someone had already written. You can, indeed, use PowerShell to send email over an encrypted connection. I just needed to figure out how to modify the OMSA-Notify script to suit my needs.
I got everything configured, so I thought, but the script just wasn't working. PowerShell just seemed to be sitting idle and would eventually give a timeout error. That's when I realized I was trying to connect to an SMTP server on the public internet, but I was running all of this on a server that was behind a proxy server. I thought I would just try and configure PowerShell to use the proxy server to send my SMTP commands, but that didn't work either. My research led me to the conclusion that SMTP commands can't be send over an HTTP proxy without installing some sort of relay program. I was at a dead end.
Later on, however, it hit me that I could setup a remote PowerShell session to one of our servers that is using a public IP address in front of the proxy server. My co-worker had already setup something similar in a PowerShell script that connects to our Microsoft Data Protection Manager server to setup automatic backups from individual client machines. To setup a server to accept remote PowerShell sessions, you simply need to run "enable-psremoting" from a PowerShell session running as Administrator. That should do it.
After getting remote PowerShell setup, my script was still failing. The smtp.send command wouldn't work because the mail message wasn't being passed to the remote session properly. I then had to setup the passing of parameters into the remote PowerShell session and actually construct the mail message in the remote session. You simply use the "-ArgumentList" parameter to send local variables to the remote PowerShell, as seen in the Invoke-Command line in the script.
Invoke-Command -Session $RoutableServer -ScriptBlock $ScriptBlockContent -ArgumentList $body, $AlertType, $env:COMPUTERNAMEThis was a fun project to figure out. I'm really happy to have server alerts coming to my inbox again. Here's a pastebin of the full modified OMSANotify.ps1: http://pastebin.com/wvvkNaVk
Wednesday, February 22, 2017
I just discovered at work that a drive in one of our production servers failed about a month ago. The server kept humming along like nothing was wrong at all.
I had email reporting setup to alert our team when there is a failure. Apparently it isn't working anymore. I'll have to look into the alerting system.
With this post I just want to express my gratitude that RAID exists. The acronym RAID stands for Redundant Array of Independent Disks. It allows you to essentially combine many hard disk drives into one large drive. However, that isn't all. RAID has redundancy built in, if you pick the right configuration. In a RAID array your data is spread across all of the disks, which allows for all of the disks to work together for better performance. Parity data is also written to each disk. Parity data is the critical part. This type of data is really many calculations performed and stored on each drive. Parity data allows all of the data on one drive to be reconstructed should a drive fail.
I won't go into detail on how RAID exists in this post. There's plenty of places on the web that explain RAID. It will suffice to say that we configured our RAID array in RAID level 6. This essentially creates double parity across all of the drives. Double parity allows two drives to go dead and still have intact data.
We have a replacement drive coming tomorrow. I'll get that installed and then our array will be back in an optimal state. Right now it is basically doing calculations every time data is requested.
Our users don't even have any idea that a drive in our server has been offline for over a month. I'm really glad RAID exists.
Thursday, October 20, 2016
We all know what a proxy server does, right? A proxy server acts as a sort of path to the internet on a network that is not otherwise connected to the internet. Your computer talks to the proxy server, the proxy server requests the web page you are looking for, the web server sends the page back to the proxy server, and the proxy server sends the page to you.
What if you wanted to do the opposite? What if you have web servers that are not directly connected to the internet and you want to have them serve pages to the public? A reverse proxy can do this for you.
In my case, I have a live TV server on my home network that I want to make available on the public internet. I have made a post about Emby (formerly Media Browser) before. It's a great way to stream your live TV and recordings to your various devices. However, I decided that I wanted this traffic to be encrypted and I wasn't very happy with the way Emby handles SSL on its own.
Here is where a reverse proxy comes in. A full featured web server handles SSL much better than a standalone application can. I wanted to be able to plug in the automation of Letsencrypt to be able to conveniently renew my SSL certificate. I couldn't get this working with Emby itself. So, I turned on the IIS feature on my Windows box and setup the proper domain binding on the default website. Then, I installed the Application Request Routing extension for IIS. Then I enabled the proxy feature of the extension.
Then the URL Rewrite module needed to be installed. After installing, you need to create rules to work with Application Request Routing.
It worked beautifully! I also got the added benefit of not having to specify a port number in my URL anymore. My requests to my domain are now standard port 443 https requests. The requests then get proxied to the Emby app on port 8096 running on the same machine.
I anticipate that my reverse proxy setup will also come in handy to be able to proxy SSL traffic to multiple services that I am thinking about setting up on this box. IIS will be able to handle multiple domains coming in and proxy them to other applications. It's an absolute win-win scenario.
Tuesday, June 2, 2015
The release date for Windows 10 has been announced. It is coming on July 29, 2015. The upgrade will be free for consumers that are running Windows 7 or Windows 8.1. I am not going to upgrade.
This little icon appeared in my system tray yesterday:
If you look back through my previous posts you can easily see that I am a big Windows Media Center fan. Microsoft will not be including Windows Media Center in Windows 10.
If you have Windows 7 Home Premium, Windows 7 Professional, Windows 7 Ultimate, Windows 8 Pro with Media Center, or Windows 8.1 Pro with Media Center and you install Windows 10, Windows Media Center will be removed.
I have grown quite fond of Windows Media Center ever since I abandoned the Comcast X1 platform. It has been absolutely flawless as a DVR platform for me. With the X1 DVR I was missing recordings of my favorite sports teams for no apparent reason. Windows Media Center has not missed a single recording for me.
I'm not saying that you shouldn't upgrade to Windows 10. However, if you are a Windows Media Center fan, stay far, far away.
Thursday, May 21, 2015
It's time that I post what I've been up to lately.
This past semester I took a Python and Powershell class. In all honesty, we didn't do too much with Powershell. We only spent about three weeks on it compared to nine weeks on Python. What I didn't expect from this class is that it would cause me to completely dive in to Python.
We spent two weeks on Python web frameworks and focused specifically on Django. Django has really hooked me. Once you learn how it works and learn a little Python, it is so simple to get a dynamic, powerful web page running in no time.
I think my boss might be annoyed with how much I have dived in to Django. I have now created three web pages on our intranet that have tools I have seen a need for. Two of them I created from scratch, another one is an adaptation of Django-helpdesk for our environment.
For years I have been telling myself that I am not a developer. Well, I just might have some developer blood in me. I'm going to continue learning Python and Django and see what else I can do with it. If you have any coding background at all, I highly recommend that you go through the Django tutorial. It is one of the best tutorials that I have ever been through.
Now, I'm off to create another Django powered site...
Friday, February 13, 2015
I need to post a follow up from my post almost a year ago about Windows Media Center.
In August my family resubscribed to cable. We have a college football addiction that cannot be cured with over the air TV. We got the Comcast X1 system on a promotion for two years. I was mostly satisfied with the service, but there were a few bugs with setting recordings and then having them not record. I also wasn't too happy with the picture quality on some channels. It sure seemed to become pixelated at times.
Even after getting cable, I was still using Windows Media Center to record some of the over the air programs that we enjoy. I then discovered software that plugs in to Windows Media Center to provide a web interface to stream your recorded shows and live TV over the internet. It was time to find a way to make this work with my cable!
I ordered the Silicondust HDHomeRun PRIME in December. It was a little bit of a pain to setup because you have to go to your cable provider and get a CableCARD to insert into the device. You'd think that they could activate the card at the office and then you just take it home and put it in and be off and running. The process is not that simple. You have to call in after you have the card installed and have the provider "pair" the card to the device that it is installed in. I called in and found someone who could do the pairing process. After about 30 minutes I was getting my cable channels on my Windows Media Center.
What a sight it was to see ESPN and all of the other premium cable channels on my Windows Media Center guide.
I have been blown away by the possibilities that the HDHomeRun PRIME has unlocked for me. Earlier in this post, I referred to plug-ins that can provide a web interface for streaming your content. I just recently moved from Remote Potato to Media Browser 3. These are both free plug-ins that integrate with Windows Media Center. I discovered Remote Potato first and used it for awhile to be able to remotely schedule programs to record when I am away from home and also to stream recorded content. However, it never really worked for live TV. While I was searching for a way to fix live TV on Remote Potato I discovered Media Browser 3. After installing the server program and the ServerWMC plug-in for Media Browser, live TV was streaming flawlessly in my browser!
For anyone who understands port forwarding and dynamic DNS, it is a really simple process to get all of this running over the internet. All of this can be done for the price of $10 for Windows Media Center on Windows 8 (it is free on Windows 7 Home Premium or above) and for about $100 for the HDHomeRun PRIME. Coincidentally, as I write this post, the HDHomeRun PRIME is $78 on Newegg.
If you desire to take your home entertainment and especially your recorded programs on the go with you, I highly recommend this setup with Windows Media Center and the HDHomeRun PRIME.
- December (8)
- November (2)
- October (6)
- September (2)
- August (10)
- July (5)
- June (12)
- May (14)
- April (20)
- March (29)
- February (20)
- January (23)