CAT | PowerShell
26
OpsMgr / SCOM & Opalis : Deploy agent to untrusted zones
No comments · Posted by Christopher Keyaert in Opalis, OpsMgr / Scom, PowerShell
When the agent is located in a domain separate from the domain where the Operations Manager management server is located, and no two-way trust exists between the two AD forests, certificates must be used so that authentication can take place between the agent and management server.
Anders Bengtsson wrote a excellent article on how to deploy SCOM to untrusted zones with Opalis
agent · deplooyment · opalis · Scom
13
SCOM : Maintenance Mode History / Report
1 Comment · Posted by Christopher Keyaert in OpsMgr / Scom, PowerShell
By powershell :
http://blogs.technet.com/b/brianwren/archive/2008/03/11/mms-command-shell-presentation.aspx
$mc = get-monitoringClass -name Microsoft.Windows.Computer
$mo = get-monitoringObject -monitoringClass $mc | where {$_.name -eq ‘srv01′}
$mo | get-maintenanceWindow -history
By SQL :
maintenance mode history is available in the OperationsManager database or DW using this query
select * from dbo.vMaintenanceModeHistory
By a specific management pack :
http://www.systemcentercentral.com/tabid/145/indexId/70867/Default.aspx
This MP includes a report that allows tracking of who is using maintenance mode to disable monitoring and reports the maintenance start, end, comment, user id and reason code.
database · maintenance mode · Object · OperationsManager · start
8
SCOM : Create a Rule and Monitor from a PowerShell Script
No comments · Posted by Christopher Keyaert in OpsMgr / Scom, PowerShell
In this video, Brian Wren demonstrates how to create a management pack containing a monitor and rule sharing a Windows PowerShell script. The demonstration includes modifying an existing script to be included in a management pack and then creating custom modules and monitor types to run the script and make its collected data available to workflows. Finally, a rule and monitor are created to collect data from the script for reporting and to set the health state of a managed object. The concept of the solution and each step are discussed prior to a detailed walkthrough of their creation and configuration.
http://technet.microsoft.com/en-us/ff723797.aspx
monitor · PowerShell · rules · Scom · state
20
PowerShell : Upload file to WebDav Server
1 Comment · Posted by Christopher Keyaert in PowerShell
The purpose of that Powershell Script is to upload a file on a webdav server. This could be useful for automatic report publishing on a portal.
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 28 29 30 31 32 33 34 35 36 37 38 | ######################################## #Webdav Access with PowerShell ######################################## #Put the complete path of the file that you want to upload $file = "D:\test.txt" #Put the url without the last "/" $url = "http://mywebSite/webdav" #Provide User and Pwd for Webdav Access $user = "user" $pass = "pwd" ######################################## #Script ####################################### #Adding the name of the file at the end of the URL $url += "/" + $file.split('\')[(($file.split("\")).count - 1)] #Connecting to WebDav Write-Host "File upload started" # Set binary file type Set-Variable -name adFileTypeBinary -value 1 -option Constant $objADOStream = New-Object -ComObject ADODB.Stream $objADOStream.Open() $objADOStream.Type = $adFileTypeBinary $objADOStream.LoadFromFile("$file") $arrbuffer = $objADOStream.Read() $objXMLHTTP = New-Object -ComObject MSXML2.ServerXMLHTTP $objXMLHTTP.Open("PUT", $url, $False, $user, $pass) $objXMLHTTP.send($arrbuffer) Write-Host "File upload finished" |
And that’s it
Christopher Keyaert
PowerShell · script · upload · webdav
20
SCOM : Not enough entropy when installed Linux Agent
No comments · Posted by Christopher Keyaert in OpsMgr / Scom, PowerShell
Hello
When you try to deploy a SCOM agent on a Linux Operating System (most of the time a Virtual Machine) is possible that you get Failed to get random data – not enough entropy error message.
The message in details :
1 2 3 4 5 6 7 8 9 | Generating certificate with hostname="xxxxxxxx" [/home/serviceb/TfsCoreWrkSpcLinux_REDHAT_5.0_x86_64/source/code/tools/scx_ssl_config/scxsslcert.cpp:198] Failed to allocate resource of type random data: Failed to get random data - not enough entropy error: %post(scx-1.0.4-248.x86_64) scriptlet failed, exit status 1 type="Microsoft.SSH.SSHCommandData" time="2009-12-03T12:08:30.6908778+01:00" sourceHealthServiceId="91A3B596-F820-6A90-305C-6974DA25966D"><SSHCommandData><stdout>Generating certificate with hostname="xxxxxxx" [/home/serviceb/TfsCoreWrkSpcLinux_REDHAT_5.0_x86_64/source/code/tools/scx_ssl_config/scxsslcert.cpp:198] Failed to allocate resource of type random data: Failed to get random data - not enough entropy error: %post(scx-1.0.4-248.x86_64) scriptlet failed, exit status 1 |
Now, fixing the issue:
- clean off the partially installed agent using the commands
- rpm -e scx
- rm -rf /etc/opt/microsoft/scx
- Regenerate the random element
- rm /dev/random
- mknod -m 644 /dev/random c 1 9
- chown root:root /dev/random
- Rediscover the server from the SCOM Console and install the Agent
- After fixing the install issue, switch the /dev/random file back to a signed random file using the commands:
- rm /dev/random
- mknod -m 644 /dev/random c 1 8
- chown root:root /dev/random
More information details on the XplatExperts Web Site.
Christopher Keyaert
Cross Platform · Linux · Scom
