Blogging – the mental game

 

After my last blog, I thought it would be time for something non-technical for a change.
The reason: blogging!

I tend to have a love/hate relationship with blogs.

As a consumer of content, I think they’re awesome: an ideal form of a quick content fix along with a peak into how others approach issues, techniques, struggles etc.

As a creator of content, I tend to struggle with blogging quite a bit, getting various highs and lows on an almost steady schedule, like a sine curve.

The Lows

It has to be perfect

A big issue with me and blogs is being a perfectionist…
I feel like content should be 100% perfect, 100% of the time before I publish it, otherwise there’s no use in publishing it.

This not only holds true for my blogs [as in the text], but also the code I might want to show.
It means that in order for me to even start writing, I want my code to be working exactly as I need it to, having all the features that I have in mind.

As you can imagine, this is a pain to manage because every time I want to blog, I know it will eat up a lot of my time to do  so.

Which leads me to my second problem

Time

Since I have 2 young kids and a full time job, time is something I do not have an abundance of.

I know you need to make time for such things, as it is an investment in yourself and the most appropriate quote for me would be

If you’re not willing to invest in your career, why should anyone else?

But on the other hand it’s finding a balance combined with the extra weight of perfectionism that tends to make me think twice about blogging.

Impostor Syndrome

Until recently I was unaware of such a thing, but the moment a friend of mine suggested this, things fell in place.

While on the one hand I feel like I’m not half bad at what I do and my gained knowledge can be used to help others, I always have this nagging feeling that no matter how much effort I put into it, it’s not good enough and others can do/have done it better.

Luckily there are various articles to be found online on how to combat this and what to learn from it instead.

And while knowing is half the battle, it doesn’t mean that it I’m no longer affected by it.
I just try to follow the following advice:

No matter how good or bad you are, there are always people in front of you and people behind you. So why waste time thinking about it?

The Highs

Don’t get me wrong, it might sound as if I find blogging horrible and should just stop completely for my mental sanity.
There’s also a good side to it!

Sense of accomplishment

Whenever I’ve gotten myself to actually write a piece again, I feel happy and relieved.

I’ve managed to overcome all the negative associations and worked through them and actually created content!
Not even thinking about how it might be received, I’m just happy that I’ve managed to get it out of my head and onto the web.

Reference point for information

One of the main reasons I had created this blog was to create a sort FAQ on technical content that I had spent too much time on to find over various sites.
A single point of content to easily browse through and find whatever I had been struggling with at that time or the recent period.

Reception by others

While I write blogs as a means for me to clear my mind and to be able to  document my technical findings for future reference, it’s always nice if other people actually appreciate your work.

Basically this post is inspired by a previous blog post I had made, which I thought was so-so, to which I had received nice comments and likes by people I regard highly.

I as astonished that it was so well received while I thought this was a subject already covered many a times.

But it turns out that while there might be like 50 blog posts to be found on any matter, it doesn’t mean yours is worse than any of them and perhaps the person reading was able to find your post instead of the others..and liked it!

Sometimes it turns out I even made an error here and there, but people still thought it is good, so it’s great to help combat both Impostor Syndrome and perfectionism!

What’s next?

Well, for now I’m on the high side of things and am really hoping to be able to change the sine curve into either having smaller ups/downs or simply making the highs longer than the lows.

All in all, I hope to get more content out, making me more familiar with the process and less time spent on creating it.

That’s it for now, I hope it helps someone who has the same thought process see they’re not alone 🙂

 

 

 

 

 

Facebooktwitterredditlinkedinmail

Using Pester for Infrastructure testing

Recently the company I am working at was running into performance issues which became a pain to sort out as it was so sporadic [lasted like 5 mins max every time], but when it happened it affected the entire company.
I was asked to assist in troubleshooting and finding out exactly what was causing this within the short time frame available.

Narrowing down troubleshooting

First we had to look into what kind of issues we ran into and we quickly had a suspicion that this was caused by our Anti-Virus software throwing fits.
But how to prove this…

Seeing that we run a VMWare based shop with Citrix VDIs and mostly Windows Servers , PowerShell is of course my go-to tool.
However, firstly I’ll try and see if I can find things in for instance performance graphs/metrics during the aforementioned  time frames when people reported the issues.

This narrowed it down for us to the following questions:

  • Front end: what’s the performance of our AV scan servers for VDIs [we use host based scanning instead of agents on our clients]?
  • Front end: what’s the performance of our VMWare hosts for the VDIs?
  • Back end: what’s the performance of our AV scan servers for Servers?
  • Back end: what’s the performance of our VMWare hosts for the Servers?
  • Back end: what’s the performance of our Citrix farm’s VMs?
  • Back end: what’s the performance of our RES [now IVANTI] infrastructure VMs?

We had been able to exclude our storage system, which for me was fine as the PowerShell integration for our storage is subpar at the moment.

Can I get the information I need?

Playing around with PowerShell, I quickly noticed that all information needed was obtainable, albeit through various cmdlets.

Instead I created 2 functions that are able to get all the required information for the 2 different types of configurations [thanks to LucD‘s great posts about PowerCLI and obtaining performance statistics]:

I’ve also added a small helper function in order for me to easily connect to vCenter servers [in production I have used a ValidateSet attribute to easily switch between my available vCenter servers, as well as using saved credentials in CliXML format to speed things up].

But now what?

In comes Pester…

In case you haven’t used Pester yet, it’s awesome!

According to the creators of Pester, this is what it does:

Pester is the ubiquitous test and mock framework for PowerShell.

It provides a means for you to make tests for your code, making sure it does exactly what you need/want it to do, or tell you if it doesn’t!
At least, that’s what it was made out to be.
For a while now, people have started using Pester for infrastructure testing, to simple see if an environment is behaving as it should!

Now this post won’t get into the nitty gritty of “What’s the Pester syntax” or “Why have you used X instead of Y”, perhaps I’ll do another post on that later, it’s just to show you the possibilities and power of PowerShell when combined with something like Pester.

For example, I’ve simply used PowerShell looping techniques within Pester to loop through all the found VMs, get all of their disks and check each and every one of them if they meet the set requirements.

The power of Pester lies it’s simplicity and readability [quite similar to PowerShell itself], as well as the fact that it can harness all of the other capabilities PowerShell has.

By your powers combined…

So what we have is PowerShell functions that can obtain performance information from both VMs and VM Hosts, combined with Pester tests that check if the desired systems meet required performance needs.

And it goes a little something like this:

In total this runs approximately 450 tests in just a few seconds, depending on if I used saved credentials or if I have to manually provide them [then it takes approximately 60 seconds, give or take]

Here’s a link to the actual Pester test along with the other scripts in the same folder [required due to dot sourcing] for you to try out/look into.

Be sure to of course check and correct the machine names to look for, but you can start the Pester test by running

And the final verdict is:

For the people interested in the results:

It turned out our McAfee Anti-Virus solution had had an update and all of a sudden had stopped implementing our exclusions on all levels [Front end as well as Back end].
The test showed high CPU spikes on the AV machines at times of the reports and we were able to create a ticket in order to get it resolved.

The speed at which I was able to run and reproduce these tests meant we had ample sources of information for McAfee to use to resolve this matter and for me to prove to my colleagues they should finally make an effort into learning PowerShell!

 

I hope to have time soon to make some more Pester based blogs, perhaps I’ll be able to dive more into syntax examples for those of you that still have questions, but hopefully this shows a fun and exiting way to increase your usage of PowerShell in your environment!

Happy Scripting! 🙂

 

 

Facebooktwitterredditlinkedinmail

IPAM 2016 in PowerShell

I recently got asked to help out to get IPAM installed and configured in our environment.
Now that’s not really hard to do, but I thought I’d do it all through my favourite tool: PowerShell.

What is IPAM

Let’s go back a step quickly and answer the obvious question:

What is IPAM and why do I need it

IPAM stands for IP Address Management and it’s a built-in feature for Windows Server since 2012 and up.
To quote Microsoft:

IPAM provides highly customizable administrative and monitoring capabilities for the IP address and DNS infrastructure on an Enterprise or Cloud Service Provider (CSP) network. You can monitor, audit, and manage servers running Dynamic Host Configuration Protocol (DHCP) and Domain Name System (DNS) by using IPAM.

Now there are a plethora of IPAM installation and configuration guides, but I noticed that while some of them touch on PowerShell cmdlets available, none of them actually seem to do the installation and configuration through PowerShell itself!

Give me the good stuff!

I’ve made a script which uses all the techniques the “manual” guides say are best practice, along with the IPAM troubleshooting guide to make sure all permissions work as a charm [don’t be fooled by the beta name, this still applies to 2016 server as well].

The entire script should be run region by region on the actual IPAM to be server, assuming it is domain joined and the person installing has all the required permissions to do so [as well as simple AD query permissions].

While the latest version can be found on my GitHub repo, I’ve added a copy here so you can start playing around ASAP!

Happy Scripting! 🙂

 

Facebooktwitterredditlinkedinmail