All posts in Sysadmin

Weald - a Dashboard and API for Subversion RepositoriesWe wanted to take a moment to highlight one of our more recent additions to our GitHub space. It’s called Weald and it’s a dashboard and API for Subversion repositories that’s web-based and pairs with VisualSVN Server. Full disclosure – Weald is not associated with nor endorsed by VisualSVN, but as we’ve written about before, we’re big fans of their products.

As you can see in the screenshot below, Weald’s dashboard shows you some highlights of the repositories on your Subversion server, including which repository is using the most space, which has the most revisions, and the top 10 repositories by disk usage and revisions. Then below the summary charts are the details for each individual repository.

Weald also provides a REST API to give you a programmatic way of accessing the same repository details you see in the dashboard. In fact, the dashboard is “dog fooding” the Weald REST API by calling the same API to populate the grid and charts you see.

The Weald dashboard:

Weald Dashboard

Weald is implemented using ASP.NET MVC 4 and the Razor view engine, with bits of C# on the backend. Currently Weald only supports VisualSVN Server. It expects to be installed on the same host as your VisualSVN Server, and will tell you so if it doesn’t find the VisualSVN Server service. Weald expects to be installed as a standard IIS web application (with an application pool).

There’s more information available on Weald’s GitHub project page: https://github.com/devopsonwindows/Weald

Like our other projects on GitHub, Weald is released under the Apache License 2.0, so feel free to check it out and let us know if you have any feedback!

Simple Steps to Operations Team SuccessWhen you work in software operations supporting software applications, there are plenty of practices and tools you can use to be more efficient at your job: keep all of your scripts and code in source control (just like developers do!), maintain proactive monitoring, work closely with your development team on operational requirements, read DevOps on Windows (ahem.), and much more.

But even before all of that, what’s one task operators have to do frequently? Make changes to the production environment. And if you take away all the fancy tools and processes around implementing and managing these changes, there are three simple, non-technical steps you can do to help ensure successful, and hopefully panic free change implementation.

1. Plan what you’re changing upfront

This may sound obvious, but doing something as simple as putting your change steps/plan down in writing can be a huge help. Let’s say you’re responsible for moving some application from one server to another. You’ve done it a hundred times in production or otherwise, but next time before you do it, try writing it down. Your document doesn’t have to be some big bureaucratic process or huge, highly polished document. It can be as simple as a listing out of what you’re going to do to implement a given change. And it doesn’t have to be the process document for now until the end of time for all cases, just what you plan to do this time.

Of course ideally a task like moving an application isn’t a terribly complicated, multi-step, manual procedure. But either way, writing your plan down in a document (like on a wiki, some internal document management system, an issue tracking ticket, or whatever works for you) is the perfect way to organize and solidify your thoughts on the process. And it has two great side effects – it can help eliminate a little bit more of your organization’s bus factor, and it can help create or add to an internal knowledge-base if your plan document is in a location that is accessible by the whole operations team.

2. Plan for rollback

Bad ThingsTM happen, so always have a rollback plan ready ahead of time. In my experience, very few changes are completely irreversible. (And if and when changes are irreversible, you better damn well make sure that’s crystal clear to your team and all the stakeholders!) It’s only to your benefit to think about and document a rollback plan. In the heat of the moment, when something goes wrong during a change implementation, it’s nice to be able to refer to a document or procedure that clearly states your path out of the mess and at least brings the system back to the state it was in prior to the change.

And if you took the time to plan up front to begin with, odds are your rollback plan is basically already written – just reverse the steps in your original plan. Again, it doesn’t need to be a highly polished rollback procedure for all cases until the end of time, just a rollback plan for the task at hand. Of course not every change is trivial enough for a quick document, but hopefully you get the idea how planning out the change up front can guide a rollback plan.

3. Validate what you changed

In test-driven development, a common (nay required?) practice is when a production bug is discovered, the developer first creates a unit test to reproduce the issue. Of course, the test will fail against the current production version’s code base because the issue is still in the code. Then once the bug has been fixed, the developer has greater confidence that the issue is truly resolved because their unit test validated the change for them.

In software operations you can apply a similar concept to your system changes. How can you know your change was successful if you can’t validate it? Do you just hope it worked? Do you wait for a user to call and report the issue again? By asking questions of your teammates and/or system owners/subject matter experts, no matter how stupid the questions sounds you can increase your own confidence and the quality of your work simply by validating your changes.

 

Again, these steps may sounds like common sense, but a little bit of reflection on what you’re actually doing can go a long way towards increased quality when it comes to making changes to a software system.

And as an operator, always remember – your number one goal is the stability of the production environment which ensures your organization can keep doing what it needs to do, and you accomplish this goal not by blocking change to the environment, but by enabling change to the environment.

Remotely View Who Is Logged OnAs a Windows systems administrator, there are plenty of situations where you need to remotely view who is logged on to a given computer. Many times you not only need to check who is logged on interactively at the console, but also check who is connected remotely via a Remote Desktop Connection (RDP). Fortunately Windows provides a way to do this. In fact, there are at least three ways to remotely view who’s logged on.

Each of these methods for remotely viewing who is logged on to a Windows machine assumes your Windows login has sufficient permission to connect remotely to the machine. It’s also worth pointing out that each of these ways is non-invasive. This means you can use them to check on the given machine remotely without impacting any of the users currently logged on to the remote machine.

Remote Desktop Services Manager

The Remote Desktop Services Manager is part of the Remote Server Administration Tools (RSAT) suite of tools, so you’ll need to install RSAT before you can use the Remote Desktop Manager. We also touched on the Remote Desktop Services Manager in our article about how to manage remote desktop connections.

After you have RSAT installed with the “Remote Desktop Services Tools” option enabled, you’ll find the Remote Desktop Services Manager in your Start Menu, under Administrative Tools, then Remote Desktop Services:

Remote Desktop Services Manager

Once the Remote Desktop Services Manager MMC is up and running, simply right click on the “Remote Desktop Services Manager” root node in the left pane tree view:

RDP Session Remote Viewer

Then when prompted, enter the hostname of the remote computer you want to view. After the MMC connects to the remote computer, you’ll see a list of users logged on to the machine and which session they’re each using:

RDP Remote Sessions

PsLoggedOn

If you’ve read some of our previous articles you know that we’re big fans of the SysInternals suite of system utilities. Included in the PsTools set of utilities is a handy little command line app, PsLoggedOn.

As with other SysInternals tools, you’ll need to download psloggedon.exe and place it somewhere accessible on your local computer (not the remote computer), for example, in C:\PsTools.

Then, open a command prompt on your local machine and from any directory execute: C:\PsTools\psloggedon.exe \\server-a

PsLoggedOn

This of course assumes you put psloggedon.exe in C:\PsTools on your local machine, and replace “server-a” with the hostname of the computer you want to remotely view who is logged on.

Query

Last but not least, there’s the built-in Windows command, “query”, located at %SystemRoot%\system32\query.exe.

Just open a command prompt and execute: query user /server:server-a

query user

As usual, replace “server-a” with the hostname of the computer you want to remotely view who is logged on.

For more information on the query command see http://support.microsoft.com/kb/186592

As you can see there are at least three ways to get the information you need to remotely view who is logged on in a totally non-intrusive way.

DevOps on Windows ToolboxWhile we’re certainly not the first technical folks to publish a list like this, we thought we’d share our DevOps on Windows Toolbox to give you some insight into the tools we use almost everyday. Basically it’s a list of software applications and utilities that we recommend for all you DevOpelers out there. These are just day-to-day tools, not systems that are part of larger solutions, but tools that help you do your job.

Full disclosure: none of these links are affiliate links nor do we have any connection with or are being compensated by any of the vendors here. We simply think these are great tools to use.

.NET Development

  • Visual Studio – This may be obvious, but Visual Studio is a great development environment, and a must have when working with any of the .NET languages (C#, etc.).
  • JetBrains ReSharper – If you’re using Visual Studio, then it’s basically a requirement that you also use the JetBrains ReSharper extension for Visual Studio. This tool gives you a huge productivity boost with Visual Studio and provides great code analysis/inspections, refactoring tools, an interactive unit test runner, and much more.
  • VisualSVN – We’ve talked about the VisualSVN Server before for hosting Subversion, but in terms of Subversion clients, VisualSVN provides great Subversion-Visual Studio integration for interacting with source control. VisualSVN makes it easy to do all of your basic SVN operations without leaving the Visual Studio window.
  • Productivity Power Tools – The 2012 version is linked here, but this Visual Studio extension gives you lots of useful tools within Visual Studio like “Open Command Prompt”, “Edit Project File”, and much more.
  • JetBrains dotPeek – The folks at JetBrains also provide a free .NET decompiler called dotPeek. This is a great, easy to use utility for browsing assemblies for which you don’t have the source code, and if you’re a ReSharper user, it uses many of the same navigation shortcuts for fast and easy browsing.

Scripting

PowerShell

  • PowerGUI – PowerGUI gives you a handy Visual Studio-esque IDE for your PowerShell development, including a nice debugger.

Python

  • ActivePython – As blasphemous as it may be to recommend another scripting language other than PowerShell for scripting on Windows, Python is a great scripting language to have in your toolbox. Knowing how to use a cross-platform scripting language can be invaluable in a mixed platform environment (like when you have to deal with Linux machines as well as Windows machines). ActivePython provides an easy to install Python distribution for Windows.
  • JetBrains PyCharm – If you couldn’t tell by now, we’re big fans of JetBrains’ products. PyCharm is an easy to use, but powerful Python IDE that includes a debugger, intellisense, and ReSharper-like code analysis. It’s a must have, even for the simplest of your Python scripts.

System Administration

General Utilities

  • CrystalDiskInfo – While you should definitely rely on your system administrators’ expertise and any vendor-provided disk management software when troubleshooting disk hardware issues, CrystalDiskInfo gives you a clean interface for getting diagnostic info about your disk hardware.
  • HeidiSQL – If you need to interact with MySQL databases, either as an administrator or for ad-hoc SQL queries, HeidiSQL gives you a nice “SQL Server Management Studio”-like interface for MySQL.
  • Microsoft Remote Server Administration Tools – Also known as RSAT, this provides you with several utilities used for remotely administering Windows machines. We have an entire article dedicated to it!
  • WinDirStat – WinDirStat provides a great hierarchical view of disk usage along with some neat little visualizations.

SysInternals Suite

As we’ve said before in many other articles, we’re big fans of the SysInternals suite of utilities. They’re invaluable for Windows system administration. There are many tools in the SysInternals Suite, but in particular you should have:

  • PsTools – This core suite includes many miscellaneous utilities for process management, service management, SID translation, and more.
  • Process Explorer – Process Explorer is like a Task Manager on steroids.
  • Process Monitor – This is a great tool for seeing real time operations by running processes on the file system, registry, etc.
  • TcpView – TcpView gives you a nicer interface than netstat for viewing network connections in real time.

Text Editors

Which text editor you use can be a hot button issue for many technologists. While most text editors these days have comparable feature sets, we tend to rely on these:

Miscellaneous Utilities

  • 7-zip – This is purely subjective, but 7-zip “feels” like a more efficient way of creating or working with archives (ZIP files, etc.) versus the built-in Windows Explorer ZIP file support. It supports numerous compression formats and includes a command line interface.
  • Cygwin – Again, this may sound blasphemous on a site that’s supposed to be all about Windows, but one shouldn’t ignore the value one can get from Unix-like utilities, especially for quick/one-off text munging one-liners. There are other ways to get basic Unix commands on Windows, but we like the way Cygwin packages things and provides it’s own nice little terminal.
  • Hoo WinTail – It’s not perfect, but Hoo WinTail is a handy tool for tailing log files (i.e. real time log viewing) on Windows, including support for filtering (inclusion, exclusion, regexes, etc.) and highlighting keywords and/or whole lines.
  • KeePass – KeePass is a great password management tool that we’ve written about before.
  • PicPick – PicPick is a nice screen capture tool that can be configured to intercept your “print screen” button. It comes with handy shape overlays like arrows which can be useful when you need to quickly create images for documentation or communicating with developers on issues with GUI applications.
  • TortoiseSVN – This is the de facto standard Subversion client for Windows. It works as a Windows Explorer extension, giving you a nice lightweight interface, with nice visual cues via Explorer icon overlays, and intuitive dialogs. It also optionally ships with a command line Subversion client for getting down and dirty with the command line.
  • WinMerge – Diff and merge tools can spark holy wars almost as bad as text editor choices, but WinMerge has a simple interface and supports diffing both files and directories.
  • WinSCP – When you need to perform remote file copies with Unix-like systems or systems that only offer SCP or SFTP connection options, WinSCP provides an intuitive interface for doing so.
  • WireShark – WireShark is a powerful tool for doing packet captures and packet analysis. It provides a low level view of the packets going on and off the wire and includes a flexible filter syntax along with a command line interface.

Again, our DevOps on Windows Toolbox here is just a list of utilities that help you perform your day-to-day tasks. Are there any other applications and tools that you absolutely have to have installed to do your day-to-day tasks? Let us know in the comments below!