In case someone works with SCOM on this list.
Hello All,
I'm scratching my head on how to start writting SCOM MP a new request I
recieved at work.Hopefully someone could point me on the right direction or
give me some ideas how to map it out and discover it. Maybe I'm thinking
this out the wrong way.
There are virtual instances of server names (9) server01.domain.com that
point to SQL instances on enterprise cluster. We connect to these instance
by using SQL studio '*server01\db01*' FQDN can be used as well. These
virtual instances are discovered in windows.computer/sql.computer classes
We also have windows servers (full OS) and SQL servers (3) '
server09.domain.com' for the same purpose for the same purpose and connect
to the DBs by using the same method stated above. These servers are also
discovered in windows.computer/sql.computer classes
What we want to do:
We would like to discover all the sarver as part of the same class (virtual
names and OS servers) and have 2 properties 'IntanceName' and
'DatabaseName' - I'm able to discover the 3 OS instances but not the
virtual names and I'm guessing because a VBScript can't run on a 'virtual
name' instance that really only points to a database instance.
After the discovery, we want to run performance metrix populated by SQL
queries for each instance, the queries will provide number of rows being
used and track, we might be able to do this by running a powershell script
and populate the data for each myapp class discover instance. We then can
alert on the performance collection if the number higher than '300' alert
which I haven't found a way how to do this yet.
Any ideas would be greate or sample that someone might have used in the
past would be great as pointer are welcome.
Thanks,
Cesar A.
Discovery Script:
On Error Resume Next
Set oArgs = Wscript.Arguments
Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20
SourceID = oArgs(0)
ManagedEntityID = oArgs(1)
sComputerName = oArgs(2) 'computer display name
sInstanceName = oArgs(3) 'netbios name
Set oAPI = CreateObject("MOM.ScriptAPI")
Set oDiscoveryData = oAPI.CreateDiscoveryData(0, SourceID, ManagedEntityID)
Call oAPI.LogScriptEvent("myApp.vbs",101,0,"Patron Discovery script
excuted")
Set oInstance = oDiscoveryData.CreateClassInstance("$MPElement[Name='MP.
MyApp.Class']$")
oInstance.AddProperty "$MPElement[Name='Windows!Micr
osoft.Windows.Computer']/PrincipalName$", sInstanceName
oInstance.AddProperty
"$MPElement[Name='System!System.Entity']/DisplayName$",
sInstanceName
oInstance.AddProperty "$MPElement[Name='MP.MyApp.Class']/InstanceName$",
sInstanceName
oInstance.AddProperty "$MPElement[Name='MP.MyApp.Class']/DatabaseName$",
sDBname
oDiscoveryData.AddInstance(oInstance)
oAPI.Return(oDiscoveryData)