Simple Script

Post Reply
3padm
Posts: 44
Joined: Fri Aug 09, 2013 5:51 am

Simple Script

Post by 3padm »

Hi,

I suspect this is a very simple task but thought I'd ask the experts rather than experiment on live array!

All I need to do is have a script execute and return some stats off the 3par, say showpd and dump it in a txt file on a windows box. What I am after are the end to end steps. i.e.
-create bat file
-place creds in such n such manner
-run cli showpd
-dump file here C:\someDir\

This would be much appreciated !
Cheers
3padm
Posts: 44
Joined: Fri Aug 09, 2013 5:51 am

Re: Simple Script

Post by 3padm »

Hi,

Appreciate this is very simple stuff to most but could someone comment on the above ?

Thanks
JohnMH
Posts: 505
Joined: Wed Nov 19, 2014 5:14 am

Re: Simple Script

Post by JohnMH »

There's lots of ways to achieve this, you could do something simple with 'PLINK' which is part of putty with something as simple as below.

plink -ssh -l USERID -pw PASSWORD IPADDRESS showpd >>>output.txt

Have a look at some plink examples and also some of the more complex scripts hdtvguy has uploaded.
https://www.google.com/?gws_rd=ssl#q=script+redirect+output+site:3parug.com
3padm
Posts: 44
Joined: Fri Aug 09, 2013 5:51 am

Re: Simple Script

Post by 3padm »

thanks that was very useful! The text comes out quite unformulated but this is a great start.

Cheers
User avatar
Richard Siemers
Site Admin
Posts: 1333
Joined: Tue Aug 18, 2009 10:35 pm
Location: Dallas, Texas

Re: Simple Script

Post by Richard Siemers »

To fix improve formatting, try using the CLI instead of plink/ssh, and set the variable to force csv output. the CLI doc should be your bible on such things... even scripts you pull from these forums you should vet line by line with official docs to be certain, since you don't have a dev/test box.
Richard Siemers
The views and opinions expressed are my own and do not necessarily reflect those of my employer.
3padm
Posts: 44
Joined: Fri Aug 09, 2013 5:51 am

Re: Simple Script

Post by 3padm »

Hi Richard,

Thanks for your suggestion. I guess I would have to ask the same question again :)
So how would one achieve this via the cli?

-create bat file
-place creds
-run cli showpd
-dump file here C:\someDir\

Again apologiesfor the noddy questions, hopefully there are other people out there who can benefit from knowing this!

Cheers
User avatar
Richard Siemers
Site Admin
Posts: 1333
Joined: Tue Aug 18, 2009 10:35 pm
Location: Dallas, Texas

Re: Simple Script

Post by Richard Siemers »

3padm wrote:-create bat file
-place creds
-run cli showpd
-dump file here C:\someDir\


I would start off with these steps first:

-Google/download/print 3PAR InForm OS CLI Administrator’s Manual (for your Inserv OS version)
-Install CLI on a desktop/server where you want your scripts to managed/run from.
-Read manual section covering "Global Options and Environment Variables"
-Read up on showpd and statpd commands

That should give you a good start on what you are asking.
Richard Siemers
The views and opinions expressed are my own and do not necessarily reflect those of my employer.
JohnMH
Posts: 505
Joined: Wed Nov 19, 2014 5:14 am

Re: Simple Script

Post by JohnMH »

{cli% set clienv csvtable 1} should help.
Post Reply