How do I get additional parameters into a Linux Script / PowerShell Discovery?

Hi all,
I'm trying to do a Linux Shell / PowerShell discovery as described in
http://operatingquadrant.com/2013/07/30/unixlinux-mp-authoring-discovering-and-monitoring-failover-clusters/ but for the
complex logic I need the GUID of the target object and the GUID of the discovery itself ($MPElement$ and $Target/Id$) as additional arguments to either of the scripts.
I tried to insert them into the "ScriptArguments" tag - but they don't show up in either of the scripts.
I tried to edit the code in VSAE, but it complains: "Could not find schema information for the element 'Scheduler'."
I added the (SCSM) "Management Pack Schema Version 1.1 XSD" as described in the blog
VSAE - Could not find schema information, but this also does not help.
Any ideas?
Thanks, Holger
Holger alias "Marvin", the InternetSmurf, Munich, Germany // Where can I edit / remove this signature line? Please do not say "in your profile" - I searched all the profiles I found ...

Hi Bob or Vladimir,
here comes the code - I shortened it, I hope, everything necessary is contained:
<TypeDefinitions>
<ModuleTypes>
<DataSourceModuleType ID="MyMP.Linux.XYZ.ServerDiscoveryDataSource" Accessibility="Internal" Batching="false">
<Configuration>
<IncludeSchemaTypes>
<SchemaType>System!System.Discovery.MapperSchema</SchemaType>
<SchemaType>System!System.ExpressionEvaluatorSchema</SchemaType>
</IncludeSchemaTypes>
<xsd:element name="Interval" type="xsd:integer" minOccurs="1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
<xsd:element name="TargetSystem" type="xsd:string" minOccurs="1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
<xsd:element name="ShellCommand" type="xsd:string" minOccurs="1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
<xsd:element name="ScriptArguments" type="xsd:string" minOccurs="1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
<xsd:element name="Timeout" type="xsd:integer" minOccurs="1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
<xsd:element name="UserName" type="xsd:string" minOccurs="1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
<xsd:element name="Password" type="xsd:string" minOccurs="1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
<xsd:element name="PSScriptName" type="xsd:string" minOccurs="1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
<xsd:element name="PSScriptBody" type="xsd:string" minOccurs="1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
<xsd:element name="FilterExpression" type="ExpressionType" minOccurs="1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
<xsd:element name="ClassId" type="xsd:string" minOccurs="1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
<xsd:element name="InstanceSettings" type="SettingsType" minOccurs="1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="Interval" Selector="$Config/Interval$" ParameterType="int" />
<OverrideableParameter ID="Timeout" Selector="$Config/Timeout$" ParameterType="int" />
</OverrideableParameters>
<ModuleImplementation Isolation="Any">
<Composite>
<MemberModules>
<DataSource ID="Scheduler" TypeID="System!System.Discovery.Scheduler">
<Scheduler>
<SimpleReccuringSchedule>
<Interval>$Config/Interval$</Interval>
<SyncTime />
</SimpleReccuringSchedule>
<ExcludeDates />
</Scheduler>
</DataSource>
<ProbeAction ID="InvokeProbe" TypeID="Unix.Authoring.ShellCommand.PropertyBag.ProbeAction">
<TargetSystem>$Config/TargetSystem$</TargetSystem>
<ShellCommand>$Config/ShellCommand$</ShellCommand>
<ScriptArguments>$Config/ScriptArguments$</ScriptArguments>
<Timeout>$Config/Timeout$</Timeout>
<UserName>$Config/UserName$</UserName>
<Password>$Config/Password$</Password>
<PSScriptName>$Config/PSScriptName$</PSScriptName>
<PSScriptBody>$Config/PSScriptBody$</PSScriptBody>
</ProbeAction>
<ConditionDetection ID="Filter" TypeID="System!System.ExpressionFilter">
<Expression>$Config/FilterExpression$</Expression>
</ConditionDetection>
<ConditionDetection ID="Mapper" TypeID="System!System.Discovery.ClassSnapshotDataMapper">
<ClassId>$Config/ClassId$</ClassId>
<InstanceSettings>$Config/InstanceSettings$</InstanceSettings>
</ConditionDetection>
</MemberModules>
<Composition>
<Node ID="Mapper">
<Node ID="Filter">
<Node ID="InvokeProbe">
<Node ID="Scheduler" />
</Node>
</Node>
</Node>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>System!System.Discovery.Data</OutputType>
</DataSourceModuleType>
</ModuleTypes>
</TypeDefinitions>
<!-- ********** Monitoring ********** -->
<Monitoring>
<Discoveries>
<!-- ***** XYZ Linux Server Discovery ***** -->
<Discovery ID="MyMP.Linux.XYZ.ServerDiscoveryRule" Enabled="true" Target="Unix!Microsoft.Unix.Computer" ConfirmDelivery="false" Remotable="true" Priority="Normal">
<Category>Discovery</Category>
<DiscoveryTypes>
<DiscoveryClass TypeID="MyMP.Linux.XYZ.Server">
<Property TypeID="MyMP.Linux.Server" PropertyID="NetworkName" />
<Property TypeID="MyMP.Linux.Server" PropertyID="Manufacturer" />
<Property TypeID="MyMP.Linux.Server" PropertyID="Model" />
</DiscoveryClass>
</DiscoveryTypes>
<DataSource ID="DS" TypeID="MyMP.Linux.XYZ.ServerDiscoveryDataSource">
<Interval>600</Interval>
<TargetSystem>$Target/Property[Type="Unix!Microsoft.Unix.Computer"]/NetworkName$</TargetSystem>
<ShellCommand>
<![CDATA[
logfile="/tmp/scom.ServerDiscovery.log"
echo "--------------------------------------" >> $logfile
echo `date` >> $logfile
echo Arguments: $* >> $logfile
echo Arguments: .$1. .$2. .$3. .$4. .$5. >> $logfile
export returnstring=""
export systemmanufacturer=`dmidecode -s system-manufacturer | sed -e 's/^ *//' -e 's/ *$//'`
echo "systemmanufacturer=$systemmanufacturer" >> $logfile
returnstring="$returnstring#systemmanufacturer=$systemmanufacturer"
export systemproductname=`dmidecode -s system-product-name | sed -e 's/^ *//' -e 's/ *$//'`
echo "systemproductname=$systemproductname" >> $logfile
returnstring="$returnstring#systemproductname=$systemproductname"
echo "Done." >> $logfile
echo "--------------------------------------" >> $logfile
echo "$returnstring" >> $logfile
echo "======================================" >> $logfile
echo "$returnstring"
#echo "ServerDiscovery=Done"
]]></ShellCommand>
<ScriptArguments>$MPElement$ $Target/Id$ $Target/Property[Type="Unix!Microsoft.Unix.Computer"]/NetworkName$ $MPElement$ $Target/Id$</ScriptArguments>
<Timeout>300</Timeout>
<UserName>$RunAs[Name="Unix!Microsoft.Unix.PrivilegedAccount"]/UserName$</UserName>
<Password>$RunAs[Name="Unix!Microsoft.Unix.PrivilegedAccount"]/Password$</Password>
<PSScriptName>ServerDiscovery.ps1</PSScriptName>
<PSScriptBody>
<![CDATA[
# Copyright (C) MyCompany 2014
# ServerDiscovery.ps1
# Summary:
# Discover XYZ Linux Server.
Param (
[string]$StdOut,
[string]$StdErr,
[string]$ReturnCode,
[string]$param4,
[string]$param5
$LogFile = "C:\scom\ServerDiscovery.log"
$SplitChar = "#"
function Main
Param (
[string]$StdOut,
[string]$StdErr,
[string]$ReturnCode,
[string]$param4,
[string]$param5
DebugOut "-------------------------------------------------"
DebugOut "Starting ServerDiscovery.ps1"
DebugOut "$(Get-Date -Format F)"
DebugOut "1 StdOut: $StdOut"
DebugOut "2 StdErr: $StdErr"
DebugOut "3 ReturnCode: $ReturnCode"
DebugOut "4 param4: $param4"
DebugOut "5 param5: $param5"
if ($ReturnCode -eq "0")
$serverProperties = $StdOut.split($SplitChar)
foreach ($obj in $serverProperties)
if ($obj -ne $null)
$property = $obj.split("=")[0]
$value = $obj.split("=")[1]
switch ($property)
"sourceid" { $SourceId = $value }
"managedentityid" { $ManagedEntityId = $value }
"hostname" { $PrincipalName = $value
$TargetComputer = $value }
"systemmanufacturer" { $Manufacturer = $value }
"systemproductname" { $ModelName = $value }
default { DebugOut "unknown Property/Value-Pair: $obj" }
DebugOut "PrincipalName: [$PrincipalName]"
DebugOut "TargetComputer: [$TargetComputer]"
DebugOut "Manufacturer: [$Manufacturer]"
DebugOut "ModelName: [$ModelName]"
$oAPI = New-Object -ComObject "MOM.ScriptAPI"
$oDiscoveryData = $oAPI.CreateDiscoveryData($SourceType, "{$SourceId}", "{$ManagedEntityId}")
$oInst = $oDiscoveryData.CreateClassInstance("$MPElement[Name='MyMP.Linux.XYZ.XYZServer']$")
$oInst.AddProperty("$MPElement[Name='Unix!Microsoft.Unix.Computer']/PrincipalName$", $PrincipalName)
$oInst.AddProperty("$MPElement[Name='System!System.Entity']/DisplayName$", $TargetComputer)
$oInst.AddProperty("$MPElement[Name='MyMP.Linux.Server']/NetworkName$", $TargetComputer)
$oInst.AddProperty("$MPElement[Name='MyMP.Linux.Server']/Model$", $ModelName)
$oInst.AddProperty("$MPElement[Name='MyMP.Linux.Server']/Manufacturer$", $Manufacturer)
#*** Send the data to OpsMgr
DebugOut "***** Return oDiscoveryData to OM; Normal exit *****"
$oAPI.Return($oDiscoveryData) # Submit the data
DebugOut ""
DebugOut "***** Normal end of script. *****"
Exit 0
else
DebugOut "No SourceId, no DiscoveryData ..."
DebugOut "***** Bad ReturnCode $ReturnCode. End of script. *****"
Exit $ReturnCode
} # End of Main
function DebugOut([string]$Text, [int]$dbg)
Write-Host $Text
echo $Text >> $LogFile
Main $StdOut $StdErr $ReturnCode $param4 $param5
]]></PSScriptBody>
<FilterExpression />
<ClassId>$MPElement[Name="MyMP.Linux.Server"]$</ClassId>
<InstanceSettings>
<Settings>
<Setting>
<Name>$MPElement[Name='Unix!Microsoft.Unix.Computer']/PrincipalName$</Name>
<Value>$Target/Property[Type="Unix!Microsoft.Unix.Computer"]/PrincipalName$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name='MyMP.Linux.Server']/NetworkName$</Name>
<Value>$Data/Property[@Name='NetworkName']$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name='System!System.Entity']/DisplayName$</Name>
<Value>NetworkName: $Data/Property[@Name='NetworkName']$</Value>
</Setting>
</Settings>
</InstanceSettings>
</DataSource>
</Discovery>
</Discoveries>
</Monitoring>
Thanks, Holger.
Holger alias InternetSmurf, Munich, Germany

Similar Messages

  • How do I insert additional clips into my video timeline in Elements 13?  When clicking 'add media' it added the clips at end of video rather than in their appropriate position.  Could not 'cut and paste'.

    How do I insert additional clips into my video timeline in Elements 13?  When clicking 'add media' it added the clips at end of video rather than in their appropriate position.  Could not 'cut and paste'.

    bhsleadership
    I am in the process of preparing to test a sample from your brand and model camera in my Premiere Elements 8.0/8.0.1 on Windows 7 64 bit. I will have the results probably tomorrow morning.
    For now I just want to put you through the drill that I do for anyone who says he/she is using Premiere Elements 8.0/8.0.1.
    1. Are you working from the 8.0/8.0.1 Update of the program?
    http://www.adobe.com/support/downloads/detail.jsp?ftpID=4653
    2. Do you have the automatic Background Rendering and AutoAnalyzer features turned OFF.
    For Background Rendering option. See Edit Menu/Preferences/General.
    For AutoAnalyzer option. Click on Organizer in the row below the blue active Organize header in order to open the Elements Organizer. In the Elements Organizer workspace, go to Edit Menu/Preferences/AutoAnalyzer Options and disable all the AutoAnalzyer options. To return to the Premiere Elements workspace from the Elements Organizer workspace, in the Elements Organizer workspace, go to File Menu/Exit.
    Is your computer optimized in spite of the fact that  you have a high end laptop? I presumed so but always go to verify, no pile ups of preview files, conformed video and audio files et al.
    Looking at the properties of your source media, I see:
    video compression = MPEG1
    audio compression = MPEG-Layer1 (.mp2)
    Frame Size = 640 x 480 (4:3)
    Pixel Aspect Ratio = 1.0
    Frame Rate = 30 progressive frames per second
    With properties like those you are sure to get a red line over that content since there is no project preset with that description.
    But, your choice of the default NTSC DV Standard would have been mine also.
    I am heading to try to get a quick look at the behavior of the sample video here in my Premiere Elements 8.0/8.0.1.
    To be continued.
    ATR

  • I have alot of loose photos at home (old) and I would love to make a bunch of iphoto books and make the pages like whole page collages?  How do I get my photos into iphoto in order to do this?  Can I make a DVD at the drugstore and add them to iphoto?

    I have alot of loose photos at home (old) and I would love to make a bunch of iphoto books and make the pages like whole page collages?  How do I get my photos into iphoto in order to do this?  Can I make a DVD at the drugstore and add them to iphoto?

    You can make the collages easily if you have iWork.  Just open a letter sized page in landscape mode and drag the photos onto the page, rotate and postiion as necessary.  Then do a Print ➙ PDF ➙ Save PDF to iPhoto to get a 200 dpi jpeg version of the Pages page into iPhoto.  From there you can add it to your book and use a blank page with the option to have an image as the backbround. 
    If you have a 3rd party image editor that supports layers you can create the collage with it. 
    OT

  • HT1848 I purchased alert tones in itunes and updated my itunes.  Now my alert tones do not show up, although if I were to go re-purchased those items, it says I already purchased them.  Where do I find those tones and how do I get them back into my phone?

    I purchased many alert tones in itunes and then updated my itunes.  Now my alert tones do not show up, although if I were to go re-purchase those items, itunes says I already purchased them.  Where do I find those tones and how do I get them back into my phone without having to repurchase????  This is so frustrating!  Please Help!

    1. iTunes won't offer cloud downloads for songs that it "thinks" are in your library, even if it "knows" the files are missing. If you've exhaustively searched for the missing files and there is no prospect of repair by restoring to them to their original locations, or connecting to new ones, then delete that tracks that display both the missing exclamation mark and are of media kind Purchased/Protected AAC audio file. Don't hide from iTunes in the cloud when asked, close iTunes, then reopen. You can download from the cloud links or iTunes Store > Quicklinks > Purchased > Music > Not on this computer > All songs > Download all.
    2. Why? Not sure, perhaps 3rd party tools or accidental key presses combined with previously hidden warning messages when trying to organize the library. There is a hint that using the feature to downsample media as it is synced to a device may also be involved, though I've not replicated it. Whatever the reason a backup would protect your media.
    tt2

  • My computer has been wiped but I still have the songs on my ipod how can i get them back into my newly downloaded itunes?

    My computer has been wiped and I've lost everything including itunes.  I have the songs on my ipod how do i get them back into my newly downloaded itunes?

    Please see the Knowledge Base from turingtest2 below
    https://discussions.apple.com/docs/DOC-3991

  • How do you get your contacts into groups?

    how do you get your contacts into groups?

    When you ask a question, please include the version of Mac OS X on your computer. iOS is not a Mac operating system.
    Assuming you are running OS 10.9.1:
    Open Contacts. Click File in the menu bar and select New Group. Enter the name of the group in Contacts on the left.
    Go back to All Contacts (on the left) then drag and drop the names you want in that group on to the folder you just named.
    Repeat as necessary for other groups.
    Note that the names remain, as they should, in All Contacts, even after you have added them to a group.. You can delete a group if you want. The names will still remain in All Contacts.

  • I have downloaded itunes onto my newly restored laptop and now the songs that are on my ipod arnt in my itunes library how do i get them back into my itunes library?

    my computer had to be restored and i lost everything on my computer and i had to redownload everything including itunes and now the songs that were on my ipod arnt in my itunes library i need to know how i can get them back into my library or if i even can

    Download Past Purchases
    http://support.apple.com/kb/HT2519
    Log into iTunes using the account the Purchase was made with... Click on Buy... and a notice will come up saying you already have it... do you wish to download it again... Click Yes...

  • I downloaded iOS 7 and now in my music library all my songs are not in the order of the original albums. How do I get them back into order?

    I downloaded iOS 7 and now in my music library all my songs are not in the order of the original albums. How do I get them back into order?

    go to settings>general>reset>reset home screen layout and see if they appear.

  • When I copy and paste a chapter from MS Word into Pages my tables and equations are trashed.  But importing them results in no control over my template How do I get my chapter into my template without copying

    When I copy and paste a chapter from MS Word into Pages my tables and equations are trashed.  But importing them results in no control over my template How do I get my chapter into my template without copying?

    Try just Opening the Word .doc from within Pages and see if that gets closer to what you want, then copy the chapter you want from the Pages version.
    Peter

  • TS3999 How do you get info entered into iCal and Contacts on an equipped iPhone to push back to an equipped MacPro? so far it's only a one way street Macpro to phone, and that's not what I was told it would be.

    Hi, all.
    How do you get information entered into iCal and Contacts on an equipped iPhone to push to an equipped MacPro? So far it's been a one way street Macpro to phone, and that's not what I was told it would be. I've been through all settings on both devices and see no way to do this. Help! If I synch the old fashioned way, what's going to happen?

    First check that all your settings are correct, that contact syncing is checked on all devices (system preferences > iCloud on a mac and settings > iCloud on a iPhone, iPad or iPod).
    Make sure the contacts you are adding are added to your 'iCloud' group and not an 'On My Mac', 'On My Phone' or other non iCloud group (you can do this by checking in groups), non iCloud contacts will not sync.
    If you are sure that everything is set up correctly and your contacts are in the iCloud group, you might try unchecking contact syncing in the iCloud settings, restarting your device and then re-enabling contact syncing.
    First check that all your settings are correct, that calendar syncing is checked on all devices (system preferences > iCloud on a mac and settings > iCloud on a iPhone, iPad or iPod).
    Make sure the calendars you are using are in your 'iCloud' account and not an 'On My Mac', 'On My Phone' or other non iCloud account (you can do this by clicking/tapping the calendar button in the top left corner of the application ), non iCloud calendars will not sync.
    If you are sure that everything is set up correctly and your calendars are in the iCloud account, you might try unchecking calendar syncing in the iCloud settings, restarting your device and then re-enabling calendar syncing settings.

  • HT1473 When downloading a CD album, if it contains different artists, the album is split up into separate albums/icons. How do I get all songs into one album (just like the original CD)?

    When downloading a CD album, if it contains different artists, the album is split up into separate albums/icons. How do I get all songs into one album (just like the original CD)?

    Generally, in iTunes, all you need to do is fill in an appropriate Album Artist to keep things together. For older iPods each track from the same album should have the same artist, or be marked as a compilation where appropriate. For iOS devices you may need to go to Settings > Music > Group By Album Artist > On.
    For more details see my article on Grouping Tracks Into Albums, in particular the topic One album, too many covers.
    tt2

  • Hi, I accidentally deleted a project in trash. How do I get it back into final cut pro X. It is still sitting in trash,

    Hi, I accidentally deleted a project in trash. How do I get it back into final cut pro X. It is still sitting in trash.

    If your working on an external hard drive, just drag/drop back in the Final Cut Projects folder, and re-open FCPX

  • Working alternating with iPhoto and FCE tgrying to import pictures from iPhoto into FCE suddenly all my 22300 pictures disappeared leaving empty frames. Does somebody know where the pictures could have gone and how can I get them back into iPhoto? Lothar

    Working alternating with iPhoto and FCE tgrying to import pictures from iPhoto into FCE suddenly all my 22300 pictures disappeared leaving empty frames. Does somebody know where the pictures could have gone and how can I get them back into iPhoto? Lothar

    The ! turns up when iPhoto loses the connection between the thumbnail in the iPhoto Window and the file it represents.
    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Rebuild iPhoto Library Database from automatic backup.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one. .
    Regards
    TD

  • How do I get my file into the time line in Premiere Pro CC?

    How do I get my file into the time line in Premiere Pro CC? I am use to Premier Pro CS6 and unfortunately my labtop took a crash and I lost all of my adobe products. I wanted to check out a trial version and I cannot seem to find one for CS6! Please Help Me! My project is due tonight!!!!!

    Hi Aneumann,
    Welcome to the Forums.
    You have to just right click on the clip imported, in the project panel and select new sequence from clip. You can also go to file menu>new>sequence and create a sequence and then drag the clips after importing them , into the timeline.
    Regards,
    Vinay

  • If I buy music from my iPOD touch, how do I get the music into iTunes also for backup on CD?

    If I buy music from iTunes using my ipod touch instead of the computer, how do I get the music into iTunes also so that I can back it up on CD?

    File>Transfer Purchases

Maybe you are looking for