

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hey folks. Not sure if this is the right sub-forum, but I've been wondering whether there's a way to run the "cleanstart" command on multiple nodes in one command. Is there a way to create a list of nodes and run the "cleanstart" (or even "status") commands on that list?
Instead of typing something like:
opcragt -cleanstart node_name1
*Wait for command to finish*
opcragt -cleanstart node_name2
*Wait for command to finish*
opcragt -cleanstart node_name2
And so on...
is there a way to type a command like:
opcragt -cleanstart node_name1,node_name2,node_name3
To run cleanstarts on multiple nodes at once? Or even to run through a list of nodes and attempt to cleanstart them one by one?
If this is a silly question, I apologize. I'm a little new at this. I suppose I could try creating a batch file to do this but I'm not sure where I'd go with that either.
Thanks!!!
Accepted Solutions


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
A really simple way to run commands to a batch of nodes is creating a text file with the list of nodes you want to process (one node name per line) and then running a one-liner using the "for" command on your Operating System command line:
For Windows:
FOR /F %variable in (FILE) DO command
example>
for /f %i in (node_list.txt) do opcragt -cleanstart %i
For Unix:
(as you type each line you'll get a secondary prompt allowing you type the next line in the script):
for i in `cat node_list.txt`
do
opcragt -cleanstart $i
done
Notice the backquotes on the `cat ....`
Hope this helps.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi Bearwhale,
Have you tried creating a tool to run the command? This way you could run it on many nodes at one time.
Say "Thanks" by clicking on Kudo's to the left 🙂


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
No, I haven't tried creating a tool. I guess that's my next step.
Do you know where I could find information about where to start with that?


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Here's a quick JScript one that I've whipped up, haven't tested it though.
Chuck the below code into a file, name it something.js
then run it like this
cscript something.js node1 node2
Edited the code slightly
/* Begin */ var wsh = new ActiveXObject("wscript.shell") if(WScript.Arguments.length > 0) { intArgLength = WScript.Arguments.length for(args = 0; args < intArgLength; args++) { wsh.run("opcragt -cleanstart "+WScript.Arguments.Item(args)) } } /* End */


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
A really simple way to run commands to a batch of nodes is creating a text file with the list of nodes you want to process (one node name per line) and then running a one-liner using the "for" command on your Operating System command line:
For Windows:
FOR /F %variable in (FILE) DO command
example>
for /f %i in (node_list.txt) do opcragt -cleanstart %i
For Unix:
(as you type each line you'll get a secondary prompt allowing you type the next line in the script):
for i in `cat node_list.txt`
do
opcragt -cleanstart $i
done
Notice the backquotes on the `cat ....`
Hope this helps.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
This gives me something to work with. I think I'll be able to make other batch commands off what you've given me.
Kudos all around!


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi Bearwhale,
I created the tool and tested it and it works correctly.
This is from the system.txt after the tool was executed
0: INF: Wed Jan 04 09:46:32 2012: coda (3212/2344): Stopping CODA
0: INF: Wed Jan 04 09:49:03 2012: ovconfd (2212/2208): (conf-393) Configuration and Deploy process 'ovconfd' stopped.
0: INF: Wed Jan 04 09:49:04 2012: ovbbccb (2724/2720): (bbc-250) OV Communication Broker stopped. Exit code (0).
0: INF: Wed Jan 04 09:49:21 2012: ovconfd (5552/58556): (conf-390) Configuration and Deploy process 'ovconfd' started.
0: INF: Wed Jan 04 09:49:22 2012: coda (2496/54012): Waiting to initialize SCOPE ...
0: INF: Wed Jan 04 09:49:29 2012: coda (2496/54012): SCOPE datasource initialization succeeded
Hope this helps 🙂
Say "Thanks" by clicking on Kudo's to the left 🙂