PRTG NetAtmo Weather Station Monitoring

A few months ago I got my hands on a NetAtmo weather station. (link) I had it setup and running for a few months now at home and its great. Both my wife an I use it constantly (especially when its really cold and really hot). I then came across a blog post from PRTG (link) where they wrote a little sensor application (PRTG NetAtmo Sensor Download) to gather NetAtmo weather stations data and record it into PRTG.

Its an easy install and setup just follow the guide and you can be up and running in 5 minutes. You can then setup custom thresholds for temperature, humidity, CO2 and levels of noise (or lack there of if things are too quite in the server room???)

What also handy is that you can add additional modules. So if your a small business or a large corporation that want to monitor physical environment of your remote offices and server room this is an easy and solution to build and then monitor.

 

Advertisements

SCOM Discovery Issue: Monitoring Cluster Shared Volumes with the Cluster NetBIOS name longer then 15 Characters doesn’t work

Recently I was asked to investigate why no alerts for a Cluster Shared Volume were received due to it filing up. The short version was that SCOM didn’t discover the CSV’s of the cluster. But other clusters configured in the exact same way on the same hardware ect had the CSV’s discovered and was monitored. Strange.

I stared of in the usual method but manually running discovery, restarting the SCOM agents, flushing the cache and checking the event logs… nothing. So I started digging into the SCOM configuration and see how does discovery work and why would it be failing.

As a cluster is Agentless Monitored I found that the clusters Virtual Server Name was incorrectly discovered. It was missing the last character.

Running: “Get-SCOMAgentlessManagedComputer” and finding the clusters details:

ManagementGroup : XXXXXXX
Computer : XXXXXXXXXSCLUSTE.connecteast.local
LastModified : 14/01/2015 1:20:52 AM
Path :
Name : XXXXXXXXXSCLUSTE.testdomain.local
DisplayName : XXXXXXXXXSCLUSTE.testdomain.local
HealthState : Uninitialized
PrincipalName : XXXXXXXXXSCLUSTE.testdomain.local
ComputerName : XXXXXXXXXSCLUSTE
Domain : testdomain
IPAddress : 10.10.1.100
ProxyAgentPrincipalName : XXXXXPRDHYP26.testdomain.local
Id : f345538e-03b8-f673-da83-2bd2f49a53a8
ManagementGroupId : f71ed7ba-0ae9-f130-8b74-11fda2c11ba1

 

Doing some more checking on the cluster I found that the Name (NetBIOS name) and DNS name didn’t match. By running this command on one of the Hyper-V servers I was able to verify this dependency:

 

Get-ClusterResource -Name “Cluster Name” | Get-ClusterParameter

Object              Name                Value               Type

——              —-                —–               —-

Cluster Name        Name                XXXXXXXXXCLUSTE     String

Cluster Name        DnsName             XXXXXXXXXCluster      String

Cluster Name        Aliases                                 String

 

Then bringing my attention to the discovery rule/scripts I found in the management pack “Microsoft.Windows.Server.ClusterSharedVolumeMonitoing” the XML’s discovery script for CSV’s . The function described in the MP where I think the relationship is breaking is:

‘****************************************************************************************************************
‘   FUNCTION:       DiscoverClusterName
‘   DESCRIPTION:    Discover instances of the relationship class
‘                   ‘Microsoft.Windows.Server.ClusterSharedVolumeMonitoring.Microsoft.Windows.Cluster.Contains.Microsoft.Windows.Cluster.VirtualServer’.
‘   PARAMETERS:     IN String strTargetComputer: principal name of the targeted ‘Microsoft.Windows.Cluster.VirtualServer’ instance.
‘                   OUT Object objDiscoveryData: initialised DiscoveryData instance
‘   RETURNS:        Boolean: True if successful
‘****************************************************************************************************************

So if the discovery of the Virtual Computer Class for the cluster is incorrect (IE “XXXXXXXXXCLUSTE”) and the cluster name used is “XXXXXXXXXCluster” it wont discover any relationship to the CSV’s as its using the incorrect name of the cluster.

The only solution I can think of is to rename the cluster so that the NetBIOS name and DNS name match or if Microsoft Update the discovery to allow for this condition when discovering.

On that Note Microsoft don’t recommend naming clusters or servers longer than 15 characters.

What we have a secondary monitoring (PRTG) system which I was able to configure the CSV’s to be monitored by (only limitation of this is that it isn’t cluster aware and monitoring from only 1 node.)

My PRTG Dashboards (aka Maps)

So a few weeks ago our operations team got some new 42’ LCD’s to be used for monitoring.

As they were just displaying the same old alert screens they sit in front of. I thought I’d give PRTG dashboards a go.

We use SCOM to monitoring PRG core server and PRTG to monitor the SCOM core infrastructure I have configured additional SQL sensors and auto ticketing notifications.

Great screen for me as I can see if there’s any functions broken quickly in our monitoring tools.

 

After I had completed this I was thinking what else could I do that’s could really pop out. So one of our clients VICSES has some interesting feeds that I can leverage from.

After a little research I found a number of sources that I could use to get some info from:

  • VICSES RSS feed – For Current Emergency Information and Warnings
  • BOM (Australian Bureau of Meteorology) – Live rain radar image feeds for all around the sate
  • Weather Widget – Provides live weather stats for Melbourne and 7 day outlook
  • Declared Operations – Where we have integration into our ticketing system and colour changes to yellow for when were in declared Operations.
  • Animated Background – Using GIF’s

 

 

Took a couple of days to get all this working and found a number of limitations to be aware of:

  • Pages are very static and rely on the PRTG refresh to be able to update
  • If you have enabled SSL on your PRTG instance you can link to unsecured sources (limitation of modern browsers rather than PRTG itself)
  • Javascript/scripts and a number of other HTML coding doesn’t load.
  • 2MB limit on a background image by default (Work around found to use custom HTML element with link to image and set it to layer 1)

 

After understanding the limitations and developing some work around you can still build some decent interactive dashboards that can impress!

 

This was the source of a bit of buzz when I loaded it onto the big screens. Overall I did learn more about HTML coding and the limitations of the PRTG dashboards and some more about PRTG in general.

 

If you would like to know more about the HTML coding or sources I have used please feel free to contact me.

 

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.

Paessler Certified Monitoring Professional – Passed

So I have been using PRTG for the past year and a college suggested a while ago to have a go at the Paessler Certified Monitoring Professional exam. Its an Online open book exam with no time limit.

I took this test last week and passed easy! Woohoo!

If your company uses PRTG I recommend completing this as it was only a 2 hour investment in time to do the exam.

Just go to the following link and sign up to apply for the test. You will get an email about 24 hours later with the link to the exam.

The only suggestion I’ll make is that if you need to search for answers just be careful your not looking at a knowledge page for a much older version of PRTG and the answer is outdated.

Image