- Community Home
- >
- Servers and Operating Systems
- >
- ProLiant
- >
- Server Management - Systems Insight Manager
- >
- Custom Tool Paramenters in SIM 6.x
-
- Forums
-
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
- HPE Blog, Austria, Germany & Switzerland
- Blog HPE, France
- HPE Blog, Italy
- HPE Blog, Japan
- HPE Blog, Middle East
- HPE Blog, Latin America
- HPE Blog, Russia
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
-
Blogs
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Blog, Latin America
- HPE Blog, Middle East
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
-
Information
- Community
- Welcome
- Getting Started
- FAQ
- Ranking Overview
- Rules of Participation
- Tips and Tricks
- Resources
- Announcements
- Email us
- Feedback
- Information Libraries
- Integrated Systems
- Networking
- Servers
- Storage
- Other HPE Sites
- Support Center
- Aruba Airheads Community
- Enterprise.nxt
- HPE Dev Community
- Cloud28+ Community
- Marketplace
-
Forums
-
Blogs
-
Information
-
English
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
05-23-2011 07:43 AM
05-23-2011 07:43 AM
Custom Tool Paramenters in SIM 6.x
I want to provide the list of systems names to a script. I can see from the help that %f is how I pass a single node name to a script
For example:
script.bat %f
That works fine, but I want to pass the entire list of nodes as arguments.
For example:
script.bat node1 node2 node3 ...
Does anyone understand how to use the repetition argument %( ... %) ?
I've tried many different iterations but can't find one that works.
For example all of the below cannot be expanded by SIM (according to the error message SIM provides at run time)
script.bat %f %( %f %)
script.bat %( %f %)
script.bat %( f %)
script.bat %( %f %)
script.bat %( %%f %)
Any insight would be appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
07-22-2011 06:32 AM
07-22-2011 06:32 AM
Re: Custom Tool Paramenters in SIM 6.x
Hi
The way I usually do it when dealing with this kind of issues is to generate a list of devices and then I ran my tool against the list using a loop...
I created a batch to delete devices from the sim database that works like this:
i generate the list using mxquery command then I parse it to delete what i want...
REM Create list of systems
mxquery -e "Not Reachable for the last 30 days" |find "DeviceName" >nodes1.txt
mxquery -e "Critical Systems" |find "DeviceName" >nodes2.txt
REM Parse them to extract the proper list of system to delete : using windows grep
"C:\Program Files (x86)\GnuWin32\bin\grep.exe" -f nodes2.txt nodes1.txt >nodestodelete.txt
REM Parse them to extract the proper list of system to delete : using cygwin grep copied in Openssh folder
“C:\Program Files\HP\OpenSSH\bin\grep.exe” " -f nodes2.txt nodes1.txt >nodestodelete.txt
REM Transform lines in columns
for /f "delims=" %%a in ('type "nodestodelete.txt"') do call :commande "%%a"
goto :eof
:commande
set ligne=%1
set ligne=%ligne:"=%
@echo %ligne% >>nodestodelete2.txt
echo off
REM Delete devices now
for /F "tokens=2" %%f in (nodestodelete2.txt) do @mxnode -r %%f -x force
The custom tool is based on this batch.
hope it help
fred
Hewlett Packard Enterprise International
- Communities
- HPE Blogs and Forum
© Copyright 2021 Hewlett Packard Enterprise Development LP