Invoking Methods on the Xplat agent with WINRM

October 26th, 2009 by Daniele Muscetta

So I was testing other stuff tonight, to be honest, but I got pinged on Instant Messenger by my geek friend and colleague Stefan Stranger who pointed me at his request for help here http://friendfeed.com/sstranger/4571f39b/help-needed-on-winrs-or-winrm-and-openwsman-to

He wanted to use WINRM or any other command line utility to interact with the Xplat agent, and call methods on the Unix machine from windows. This could be very useful to – for example – restart a service (in fact it is what the RECOVERY actions in the Xplat Management Packs do, btw).

At first I told him I had only tested enumerations – such as on this other post http://www.muscetta.com/2009/06/01/using-the-scx-agent-with-wsman-from-powershell-v2/ … but the question intrigued me, so I check out the help for winrm’s INVOKE verb:

clip_image002

Which told me that you can pass in the parameters for the method to be called/invoked either as an hashtable @{KEY=”value”;KEY2=”value”}, or as an input XML file. I first tried the XML file but I could not get its format right.

After a few more minutes of trying, I figured out the right syntax.

This one works, for example:

winrm invoke ExecuteCommand http://schemas.microsoft.com/wbem/wscim/1/cim-schema/2/SCX_OperatingSystem?__cimnamespace=root/scx @{command="ps";timeout="60"} -username:root -password:password -auth:basic -r:https://virtubuntu.huis.dom:1270/wsman -skipCACheck -encoding:UTF-8

clip_image004

Happy remote management of your unix systems from Windows :-)

Sara's

October 13th, 2009 by Daniele Muscetta

Sara's

Sara, my granny, is very old, and very sick.
I was afraid she wouldn't even have lived long enough to meet Sara, my daughter.

She has Alzheimer, Osteoporosis, and a million other diseases; She had a heart attack two months ago, then another one, and also a stroke. She can't walk anymore, she can't see much anymore, her whole body is giving up. The doctors now say that she probably won't live much more than another month.

But she made it to meet newborn Sara, even if the encounter has been somewhat different than I might have hoped earlier on.

"what a cute baby! is he a boy?"
"no, granny, this is Sara, your grand-grand-daughter, and she's called Sara, just like you…"
"Oh, how nice! This is a honor for me… you called her like me? how sweet of you!"

Of course we had told her this earlier, but she forgets things.
In a way it is nice to make her happy and give her this honor multiple times, but at the same time it isn't.

She does not understand what surrounds her anymore and most of the time she is in a dream-like state. Some old people have this, but their dreams are good, and they become just like young kids with visions that make them even happy at times.
But those dreams she's having are obviously bad ones, as she sighs and puffs and seems to be having a very hard time. And a lot of fear.
She is too afraid of letting go: after she dreamed a couple of times of my granddad and her mum (in the dream they were calling her to come and join with him in heaven), she is even afraid of falling asleep. And with little sleep she gets even more confused and depressed. And fearful. In a vicious circle.

She does have some moments of lucidity, and you can have short conversations with her, even if these moments tend to be shorter and shorter. And when they happen they even frighten her – I suppose because she realizes how she is the rest of the time.

But inevitably, five minutes later she will ask you again the same question:

"who is that cute baby I see over there?"
"dear granny, this is Sara, your grand-grand-daughter; she's called just like you"
"Oh how nice. This is a honor for me…."

She has lived so long, has had bad and good times, and done many good things, as well as many mistakes just like anyone does a lifetime.
Seeing her suffer is heart-breaking for us all.
I hope her suffering stops and her fears abandon her and that she might find her well deserved peace.

Amen.