My SCOM 2012/PRTG Maintenance Mode Scheduler application

Problem: Engineers that are working on systems don’t have the ability in SCOM to schedule maintenance modes.

 

Business case: As we use SCOM and PRTG and we needed to schedule MM not just for windows servers but for unix and for Business Critical Unix applications  known as clustered packages.

 

Research: Found the MM scheduler tool but as this was built for just windows and unix server and was built by a someone else, I need to be able to add additional features and integrate with PRTG. So either spend the time to backward engineer someone else’s solution or build it from scratch.

 

Solution:

Scripted Solution with 2 parts.

1. Back end service that stores and executes maintenance modes when needed.

2. Script shared with the business to schedule.

 

How it all works:

I outlined the workflow for how I wanted it all to work.

For V1 of my solution I’m sticking with command line. Its the fastest way for me to deliver the solution and easiest to fix any bugs.

I used Power Shell to script a service and installing it on the SCOM Management server. I packaged the Power Shell script as an executable service using a power shell command that was developed by Daniel Sorlov. You can find his module here.  Also he posted a youtube video on how to package it. Check it out here.

The service checks a file share on the SCOM management server and if any xml files exist processes them.

The XML contained details like customer, server, start date time, duration, frequency, frequency data, end date time, reason and comment.

The service checks if there are any errors in the xml, if the server is already in maintenance mode and if its a unix package. This last check is what make this different than the other SCOM maintenance mode schedulers, it intergrates also with PRTG and pauses the PRTG sensors for the specif packages. This is done by extracting the sensor ID’s for each package and placing them into a CSV where the service checks for what sensors it needs to place into maintenance mode. PRTG’s API make this easy to achieve.

The second component is the interface. So as I said earlier V1 was just a command line tool that generates the xml.

 

I found that the most difficult part of this process was getting my head around how to get the weekly and monthly frequency working. I did this by representing the frequency data for weekly as: (snip-it from my help file)

If Frequency is “Weekly” you must set the position flag to 1 for the corresponding day of the week and the 24 time

in “HH:mm” format. Format is “0000000 HH:mm”

Monday Flag    1000000 HH:mm

Tuesday Flag   0100000 HH:mm

Wednesday Flag 0010000 HH:mm

Thursday Flag  0001000 HH:mm

Friday Flag    0000100 HH:mm

Saturday Flag  0000010 HH:mm

Sunday Flag    0010001 HH:mm

Note: Combinations can also be used EG Monday and Fridays you can use 1000100

Example “1010000 HH:mm” eg Monday and Wednesday at 2pm is “1010000 14:00”

 

and for Monthly:

If Frequency is “Monthly” you must specify which week of the month (1-5), which day of the week (0-6) and what

time “HH:mm” in 24 hour time format.

Format is “Week Number” “Weekday” “Time” looks like “2 3 21:00” eg 2nd Wednesday of the Month at 21:00

 

The Week Number flag represents the week of the month:

1 – First week of Month

2 – Second week of Month

3 – Third week of Month

4 – Fourth week of Month

5 – Fifth week of Month

 

The Weekday flag represents the week day you are after:

0    Sunday

1    Monday

2    Tuesday

3    Wednesday

4    Thursday

5    Friday

6    Saturday

 

So it been running for a few weeks now and after finding a couple of small bugs, i haven’t had any issues with crashing or maintenance modes not being applied. This was an enjoyable learning curve for me as this was weeks worth of effort and I was able to deliver a solution that I was confident about.

 

Wouldn’t call myself a programmer just yet, but im liking being a script kiddy!

 

 

As this was made specifically for my employer and is customized sharing all the source code wont benefit you but on request I can help you develop or share the necessary functions to help you build your own solution.

Advertisements

Splunk > live Melbourne

A while ago a college of mine was looking around and investigating possible tools and came across Splunk, so we signed up  for an account and joined the newsletter. Last week I attended the Splunk > live Melbourne convention.  So being new to the product I attended the 101 presentations.

From first glance the product looked impressive. Its ability to consolidate multiple data sources from logs on a switch to database connections and server logs to deliver real time reports for business analysis. Splunk’s only had a footprint in Australia for the past 5 years and looks to continue to build customers as more  and more find value in its powerful reporting capabilities. Its been used by a number of fortune 500 companies and here in Australia by one of our major banks and a major online sports betting agencies.

The key to Splunk is thinking of it as a search engine. So rather then model the data then save it and then report on predefined filters, just add the data source to Splunk and then you define how and what you want to see. If you ask me what the one thing I have taken away form this was I found a new way of thinking about how reporting can be build from a search query and the “Google” way that Splunk does its magic.

 

VMware Certified Associate – Data Center Virtualization -Passed

Following to my PRTG certification I had a look around to see what else might be around that I might benefit from in my current role. I came across the VMware Certified Associate – Data Center Virtualization. After a little reading up on this I found that it is more of an introductory course with VMware products and the basics of virtualization. Having already an understanding the VMware product suite I decided to have a go.
There is a video series available for review and practice questions on the site.
The exam is an open book online exam. The only fee is the exam cost of $120. An afternoon investment in time + exam is all it takes.

Just sign up for an account here: http://mylearn.vmware.com/

If your looking fill in some spare time at work I suggest this Certification. If your looking at this helping your career, this is just an extra line on your CV. It is not a technical course and is more a sales/solution certification.

And yes I passed 😉

vmware-vca-dcv