Command line is your friend when the SCOM Agent auto deploy functionality does not work for some reason. Because some firewall rules are disabled or something like that.
Or if you need to create a SCCM Package.
Unattended installation with system account:
1 |
msiexec.exe /i "\\CONTOSO001\c$\install\MOMAgent.msi" USE_SETTINGS_FROM_AD=0 MANAGEMENT_GROUP=SCOMOM01 MANAGEMENT_SERVER_DNS=CONTOSO001.contoso.com ACTIONS_USE_COMPUTER_ACCOUNT=1 USE_MANUALLY_SPECIFIED_SETTINGS=1 AcceptEndUserLicenseAgreement=1 /qn /l*v c:\install\MOMAgent_install.log |
Unattended installation with SCOM Action account:
1 |
msiexec.exe /i "\\CONTOSO001\c$\install\MOMAgent.msi" USE_SETTINGS_FROM_AD=0 MANAGEMENT_GROUP=SCOMOM01 MANAGEMENT_SERVER_DNS=CONTOSO001.contoso.com ACTIONS_USE_COMPUTER_ACCOUNT=0 USE_MANUALLY_SPECIFIED_SETTINGS=1 ACTIONSUSER=ACTION@scom ACTIONSDOMAIN=contoso ACTIONSPASSWORD=pwd@contoso AcceptEndUserLicenseAgreement=1 /qn /l*v c:\install\MOMAgent_install.log |
During the deployment of a new resource or adding a new resource there is a possibility that you can face the following error:
An internal error has occurred trying to contact the ” server: NO_PARAM: NO_PARAM.
WinRM: URL: [http://:5985], Verb: [INVOKE], Method: [GetError], Resource: [http://schemas.microsoft.com/wbem/wsman/1/wmi/root/microsoft/bits/BitsClientJob?JobId={1FAA84D0-C551-4410-AB54-0DE094840D37}]
Service unavailable (503) (0x801901F7)
Recommended Action
Check that WS-Management service is installed and running on server ”. For more information use the command “winrm helpmsg hresult”. If ” is a host/library/update server or a PXE server role then ensure that VMM agent is installed and running. Refer to http://support.microsoft.com/kb/2742275 for more details.
After some investigation this can happen due two circumstances:
If the certificate is expired, create a new one:
1 2 3 |
$computername = "Monkey01.contoso.com" $credential = get-credential Get-VMMManagedComputer -ComputerName $Computername | Register-SCVMMManagedComputer -Credential $credential |
Then, refresh all VMM Infrastructure servers (including VMHosts) so they get the new certificate.
After installing the newest product from Microsoft “Admin Center” on our Library server we faced the same issue.
To solve this: Go to the library server -> Open regedit -> Search for “BITSTcpPort” -> Change the value to an unused Port like (8500).
Restart the SCVMM Agent and refresh your Library share in SCVMM.
In some situations (hardware failures etc.) it’s not possible to remove the Hyper-v cluster node nicely out of SCVMM. When removing the Hyper-v node from VMM it will throw an Error (25333) in SCVMM. This is because the server is down and it’s not possible to remove the SCVMM Host agent.
To solve this you can use the following PowerShell command:
1 2 |
import-module virtualmachinemanager remove-vmhost hostname –force |
With the release of SCOM (System Center Operations Manager) 2016 Microsoft released a new version of SCOM. The look and feel of SCOM is almost the same as the 2012 version. Of course Microsoft add a couple of new features which are very useful. Microsoft has listened to the feature requests of the SCOM Community. I will describe the new features.
SCOM Management packs can be obtained from the Microsoft website, or other third party websites which has developed their own Management packs for custom applications. In SCOM 2016 you be able to view the current status of the management pack. When a management pack is older than the one in the Microsoft catalog the status will be changed to “update available”. The new tab is placed in the management packs folder under the Administration tab.
When you look into the management packs folder it have some new buttons available, with this new buttons you can find some more information, download page, install guides or other recommendations.
In SCOM 2012 it was a hard job to tune the alerts, rules and discoveries when there was something wrong. You must report these with the reporting feature and change them by hand.
SCOM 2016 facilitate alert tuning by default. This enabled you to avoid the flooding of non-essentials repeated alerts and give you the focus back. In the management pack tab there is a new window called “Tune Management packs”. With the Identify button you can set the time range to analyze the data, and set the minimum number of alerts for the management packs you want to display. In this view you see the alert count, priority, source and name. Alerts can be tuned for all objects of the target class, group, or a specific object of a class or for all objects of another class. Direct from the tune alerts tab.
SCOM 2016 make use of a new “Management Infrastructure MI” API. With this API you can monitor much more Linux agents. Supported configuration of 1000 Unix agents to one SCOM 2016 management server. The use of the new API is not enabled by default; to enable this you must create a new registry key in:
Name: UseMIAPI
Location: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft Operations Manager\3.0\Setup
SCOM 2016 comes with a new tool for creating custom management packs for network device monitoring. With the “NetMonMpGenerator.exe” tool located in the install directory on your SCOM management server you be able to create Management packs from .XML files with the well-known OIDs in it. This will spare you a lot of time.
With SCOM 2016 it is possible to schedule maintenance mode for specific objects. You can suspend the monitoring for a specific date / time. This is possible in the Maintenance mode scheduler wizard. Another nice feature is the client side maintenance mode enabler. This enables you to set the SCOM client in maintenance mode from the client side. So you don’t have to login to operations console for this action. This can be done with the following PowerShell command: Start-SCOMAgentMaintenanceMode cmdlet.
SCOM 2016 has included Nano server support. The following features are available for Nano server:
SCOM 2016 has removed the Silverlight dependency for accessing the Web Console. Silverlight is only needed for opening Dashboard views, the rest is programmed in HTML which can be accessed from multiple browsers (chrome, firefox etc.)
The SCOM 2016 console is way faster than the SCOM 2012 console. The load time of diagram and state views is reduced.
Partner program in administration console
There is a new tab available for third party Tools for creating management packs or downloading third party management packs.
With scripts you can monitor almost everything in SCOM. Out of the box SCOM uses mostly VBScript instead of PowerShell, because it works on all Windows versions. I prefer PowerShell above VBScript, so I created some PowerShell performance collection rules and PowerShell monitors.
Silect created an awesome tool called MP Author to build management packs wizard driven.
The steps:
– Create new management pack, give it a name, choose a folder, locate the references and select Empty Management pack.
– Create a custom application class. In MPAuthor this called Targets, create a new target. I used WMI to locate the custom application service (Select * From Win32_Service Where Name Like “%Service name%”). We are working with a Windows local application, with Windows Computer as target.
– Next, create a custom PowerShell performance rule or a PowerShell monitor (works the same). New “Script performance rule”. Give the script a name and paste the code in the script area. In the next page provide the parameters:
Object: Testpage.com
Counter: Pagespeed
Instance: Someinstance
Value: $Data/Property[@Name=’Pageloadtime’]$
Select the target we created the above and finish the wizard.
Example script to explain the used SCOM variables:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
#Create SCOM Script api connection $api = New-Object -comObject "MOM.ScriptAPI" #Create property bag $bag = $api.CreatePropertyBag() #Eventlog event start script $api.LogScriptEvent("YourScriptName.ps1",3280,0,"Pagespeed script is starting") #The script $webClient = new-object System.Net.WebClient $webClient.Headers.Add("user-agent", "PowerShell Script") $startTime = get-date $output = $webClient.DownloadString("http://www.google.com/") $endTime = get-date $Prefix = ($endTime – $startTime).TotalSeconds $Loadtime = [math]::round("$prefix",2) #Add values to the bag $bag.AddValue("Pageloadtime",$Loadtime) #Return the bag $bag |
It’s possible to monitor the mbeams provided by the java engines with SCOM. Out of the box SCOM Doesn’t discover these applications automatically. There are some more steps needed to complete this.
The steps I followed:
– Download and import the SCOM JEE Management packs from: Download
– Install a SCOM Monitoring agent on the application server.
– Enable agent proxy on the SCOM agent (SCOM Console -> Administration -> Agent Managed -> Right click -> Allow this agent to act as proxy).
– Open port 8080 from the SCOM Management server to the application server.
– Search for the “beanspy.war” files on the SCOM Management server. Usually located in a subfolder of: “C:\Program Files\Microsoft System Center 2012 R2\Operations Manager\Server\Health Service State\Resources”
– In my case i used an application server without authentication so i need the beanspy.notauth.war.
– Rename the beanspy.notauth.war to beanspy.war.
– Deploy beanspy.war to youre application web server, in my case tomcat-7.0.
– Restart the application web server services to load beanspy.war.
– Check if the beanspy module is loaded: browse http://URL:8080/BeanSpy/MBeans?JMXQuery=*:*
– Add the application server with the .\NewJEEAppServer.ps1 powershell script.
– .\NewJEEAppServer.ps1 -ManagementServer FQDN -JEEAppServerType Tomcat -JEEAppServerVersion 7 -Target http://FQDN:8080
– In my situation the standard query defined in the JEE Management packs discovered nothing. (http://FQDN:8080/BeanSpy/MBeans?JMXQuery=Catalina:j2eeType=WebModule,*). I changed this by overriding the default discovery settings with (*:*). And I changed the discovery interval.
– Now you can create JEE Monitors with the pre-defined Management pack templates.
Sometimes it’s unclear what the error messages are when the SCOM Agent is running an VB or PowerShell script. Or the event-log messages say nothing about the issue you actually facing. In this situation the Tracing.cmd could give you more information what is happening.
How to start the SCOM Agent Tracing:
I used SMS Trace to debug the logs.
The issue was found in the “TracingGuidsManaged.log”. Invoke-WebRequest was running under a user account witch not have runned the “IE First time run setup”. You can change a group policy for this issue or simply run the step with the actual account.
Example debug line:
[3]dd/mm/yyyy [AzureModule] [] [Error] :RunspaceController.WriteErrorLine{runspacecontroller_cs412}( 0000000000)PowerShell Script ‘ps1’ WriteErrorLine: Invoke-WebRequest : The response content cannot be parsed because the Internet
In SCVMM there is no option to send a mail when a job is completed.
This can be archived with PowerShell. Here is an simple example script to monitor the SCVMM Job status:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
import-module virtualmachinemanager $VMMJob = Get-scjob | where{$_.status -match "running"} | Select-Object -Property ID,Owner,Description,Progress IF([string]::IsNullOrEmpty($VMMJob)) { Write-Host "No runnning jobs" Exit } While((Get-SCJob -ID $VMMJob.ID).Status -eq 'Running') { Start-Sleep -Seconds 3 Write-host "VMMJob"$VMMJob.Description"" Write-Host "Progress"$VMMJob.Progress"%" Write-host "Owner"$VMMJob.Owner"" } $status = (Get-SCJob -ID $VMMJob.ID).Status if($status -notmatch "Running"){ $PSEmailServer = "mailserver01.mailserver.local" $subject = $VMMJob.Description.Name + "is " + $Status $body = $VMMJob.Description.Name + "started by " + $VMMJob.Owner + " is " + $status send-mailmessage -to "test@test.com" -from "test@test.com" -subject $subject -body $body } |
There are many ways to compact a VHDx file. It can be done using SCVMM, Hyper-V manager or even diskpart.
In my situation the compact option doesn’t reduce the size, it was even bigger than before the compact.
I’ve tried to defragment the disk, migrate it or even clean it up inside / without any result.
The only way to get this job done is writing zero’s on the empty space.
This can be done with the tool SDelete, created by Mark Russinovich. The tool zeroes the empty space within the VHDx file.
Before running the tool delete al the un-needed and temporary files.
Sam Boutros created a nice little PowerShell function to get this job done. The package with SDelete and the script can be downloaded HERE.
Example script function parameters:
1 |
Compact-VHDX -VHDXPath D:\Dynamic1.vhdx -SDelete .\sdelete.exe |
After running the tool the compact action will reduce the space.
Since Windows 2012 Microsoft has the new TRIM/UNMAP command founded, this works only when the Underlying storage supports this.
There is no standard feature in SCOM to generate a test alert, which can be needed to test a mail subscription.
For SCOM2007 there is a simple tool to generate test alerts. Too bad that this tool doesn’t support SCOM2012.
If you are using SCOM2007 you can download the tool here: http://blogs.technet.com/b/momteam/archive/2009/05/19/notifications-test-tool.aspx
For the SCOM2012 users we can generate a test alert with a Microsoft Event log event.
First we need to create an event log entry. This can be done with PowerShell or a CMD Command.
I’ve done this with the standard EventCreate command in CMD.
eventcreate /L Application /T information /ID 999 /D “This is a test event” /SO TestEvent
If you want to create a daily test event, this can be scheduled in task scheduler.
Sample parameters:
– Run whether user is logged on or not
– Run with highest privileges
– Program/script: eventcreate
– Arguments: /L Application /T information /ID 999 /D “This is a test event” /SO TestEvent
Now you can test Alerts with running the scheduled task or run the command in the DOS prompt.
Recent Comments