TechColumnist Storage Information Blog

16Jul/100

ISY Python Script for controlling media lights via xbmc

Here is a simple python script to use the REST code in the ISY (http://universal-devices.com) to control devices that are linked. I'm designing this script to be used inside a script for xbmc. here's the first part of it. I recommend using scenes for the devicedim, deviceoff, and deviceon array, however you can use the individual devices as well in the array.


import urllib2
import urllib
import sys

devicedim = ['41941']
deviceoff = ['48839']
deviceon = ['62270']
username = 'admin'
password = 'admin'

topurl = 'http://isy'
passman = urllib2.HTTPPasswordMgrWithDefaultRealm()
passman.add_password(None, topurl, username, password)
authhandler = urllib2.HTTPBasicAuthHandler(passman)
opener = urllib2.build_opener(authhandler)
urllib2.install_opener(opener)

if sys.argv[1] == 'playing':
	for devicex in deviceoff:
		theurl = 'http://isy/rest/nodes/' + devicex + '/cmd/DOF'
		#normalize the URL
		theurl = urllib.quote(theurl, safe="%/:=&?~#+!$,;'@()*[]")
		print (theurl)
		pagehandle = urllib2.urlopen(theurl)
	for devicex in devicedim:
		theurl = 'http://isy/rest/nodes/' + devicex + '/cmd/DON/64'
		#normalize the URL
		theurl = urllib.quote(theurl, safe="%/:=&?~#+!$,;'@()*[]")
		print (theurl)
		pagehandle = urllib2.urlopen(theurl)
elif sys.argv[1] == 'stopped':
	for devicex in deviceon:
		print (devicex)
		theurl = 'http://isy/rest/nodes/' + devicex + '/cmd/DON'
		#normalize the URL
		theurl = urllib.quote(theurl, safe="%/:=&?~#+!$,;'@()*[]")
		print (theurl)
		pagehandle = urllib2.urlopen(theurl)
else:
	print 'no state given'

Usage:

isy-medialights.py playing|stopped
Tagged as: , , No Comments
7Jul/100

Schedule a URL into Maintenance Mode

Found a nice article about how to script a URL (or web application) into maintenance mode. This was a little bit of a challenge to find so I'm reposting it to hopefully get some more attention. I've also posted the modified version of the script that allows for multiple watcher hosts.

param($rootMS,$urlName,$minutes,$comment,$reason)
Add-PSSnapin "Microsoft.EnterpriseManagement.OperationsManager.Client" -ErrorVariable errSnapin;

Set-Location "OperationsManagerMonitoring::" -ErrorVariable errSnapin;
new-managementGroupConnection -ConnectionString:$rootMS -ErrorVariable errSnapin;
set-location $rootMS -ErrorVariable errSnapin;

$URLWatcher = (Get-MonitoringClass -name Microsoft.SystemCenter.WebApplication.Perspective) | Get-MonitoringObject | where {$_.DisplayName -eq $urlName}

$startTime = [System.DateTime]::Now
$endTime = $startTime.AddMinutes($minutes)

"Putting URL into maintenance mode"
foreach ($name in $URLWatcher) {
New-MaintenanceWindow -startTime:$startTime -endTime:$endTime -monitoringObject:$name -comment:$comment -Reason:$reason }

Usage:

C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe URLMaintenanceModeV4.ps1 -rootMS: `SCOMRMS1′ -urlName: ‘MSN Website Checker’ -minutes:45 -comment: ‘My Comment’ -reason: ‘PlannedOther’

http://www.scom2k7.com/schedule-a-into-url-maintenance-mode/

Tagged as: , No Comments
4Jul/100

First iphone 4 post

Testing out the new phone. Been a while since the last post. Looks pretty neat to be able to write a post while mobile.

Tagged as: , No Comments
6Apr/100

Designing Disaster Recovery … on a budget

This article is still under construction.

There are several options for disaster recovery and high availability. There's host based solutions, array based solutions, and virtualization solutions. Which to pick? We're going through a pretty crazy test of products, but we have the same problem as everyone else, we have tons of different storage vendors. So do you pick host based replication solutions, probably not. Do you pick array based solutions, sure, those will work. What about adding another layer of complexity to the solution and add an in-band virtualization solution? Or implement something like EMC RecoverPoint and only worry about replication with one thing, and keep array based solutions for specific tasks? So many things to choose from.

Tagged as: No Comments
1Apr/100

OpsMgr 2007 – No graphs in emailed reports

Some of you may have found that there are no graphs in your emails (scheduled reports) from SCOM 2007. I posted this up on the MSMOM email distro and Kevin Holman pointed me to a KB article.

http://support.microsoft.com/kb/972821

Just add this to your ReportingServicesService.exe.config file in the \ReportServer\bin

<dependentAssembly>
<assemblyIdentity name="Microsoft.ReportingServices.ProcessingCore"publicKeyToken="89845dcd8080cc91" culture="neutral" />
<bindingRedirect oldVersion="9.0.242.0" newVersion="10.0.0.0" />
</dependentAssembly>

<dependentAssembly xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity name="Microsoft.ReportingServices.ProcessingCore"publicKeyToken="89845dcd8080cc91" culture="neutral" />
<bindingRedirect oldVersion="9.0.242.0" newVersion="10.0.0.0" />
</dependentAssembly>

Place this between the tags:

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
</assemblyBinding>
Tagged as: , No Comments
4Jan/100

OpsMgr 2007 – Author Privileges

Have you run into setting up permissions/privileges for your administrators within the scom console. This can be quite confusion. You often run into cryptic areas where certain functions don't react as they should and you run into the error "The user domain\user does not have sufficient permission to perform the operation".

Some important information here:

Tagged as: Continue reading
3Jan/100

NetApp OnTap 8.0rc2 Filerview

Take a look at filerview. Not much different here except the branding. I'll post some other screenies as I go along and explore the new version.

filerview-8.0rc2

Tagged as: No Comments
26Oct/090

Remotely reboot a server

Always a good tidbit of information to keep around:

To perform a remote shutdown:
1. Open Computer Management (Local)
2. In the console tree, right-click Computer Management (Local), and then click Connect to another computer.
3. In the Select Computer dialog box, click Another computer, type the name of the computer that you want to restart or shut down, and then click OK. You can also click Browse to search for the name of the computer.
4. In the console tree, right-click Computer Management (Remote computer name), and then click Properties.
5. On the Advanced tab, click Startup and Recovery.
6. Click Shut Down to open the Shut Down dialog box.
7. Under Action, select the actions you want to perform on the computer to which you are connected.
8. Under Force Apps Closed, select the circumstances under which you want to force applications to close when you shut down or restart the computer, and then click OK.

Filed under: Uncategorized No Comments