This post is more than 5 years old
28 Posts
0
5242
August 28th, 2008 09:00
Scripting Celerra CLI?
Hi,
Are there any resources on how to script the Celerra CLI? I am a windows admin and I know Vbscript pretty well... Should I just look up ssh scripting?
What I am looking to do is to create a script I can copy and paste into putty that the celerra will run.. My first one I would like to do is to script a failover from our NS80 to our NS40.. Firstly failing over our VDM then the filesystems with it.. I understand the lines I would need the celerra to run I just dont know how to glue them together to get them to run if that makes sence..
Any websites or examples would be great! I am sure I can work out the syntax from any examples doesnt have to be about replication..
Packetboy.
Message was edited by:
packetboy
Are there any resources on how to script the Celerra CLI? I am a windows admin and I know Vbscript pretty well... Should I just look up ssh scripting?
What I am looking to do is to create a script I can copy and paste into putty that the celerra will run.. My first one I would like to do is to script a failover from our NS80 to our NS40.. Firstly failing over our VDM then the filesystems with it.. I understand the lines I would need the celerra to run I just dont know how to glue them together to get them to run if that makes sence..
Any websites or examples would be great! I am sure I can work out the syntax from any examples doesnt have to be about replication..
Packetboy.
Message was edited by:
packetboy
0 events found
No Events found!


sagle
90 Posts
0
August 29th, 2008 07:00
The top part is key, you need to set the variables to run as cron, since you will not be logged in have them set via login. The little if statement just checks to make sure you are on the primary control station, if not exit. If you run anything from outside source (linux server), then you need to declare the variables in each SSH command you issue. I have examples of that if you need. Hope this helps
#!/bin/bash
PATH=$PATH:$HOME/bin:/nas/sbin
export PATH
NAS_DB=/nas
export NAS_DB
MANPATH=/usr/share/man:/usr/man:$NAS_DB/man
export MANPATH
PATH=$PATH:$NAS_DB/bin
export PATH
SLOT=`/nasmcd/sbin/t2slot`
CS=`/nasmcd/sbin/getreason -s $SLOT`
if [ $CS -eq 11 ]
then
exit 1
fi
tar -cpf /nas/quota/slot_5/data1/backup/backup.tar /home/nasadmin/nasdb_backup.1.tar.gz /home/nasadmin/bin/* /home/nasadmin/quota/* /home/nasadmin/config/* /home/nasadmin/virus_conf_files/*
exit 1
dynamox
9 Legend
•
20.4K Posts
1
August 28th, 2008 09:00
sagle
90 Posts
0
August 28th, 2008 18:00
packetboy2
28 Posts
0
August 29th, 2008 01:00
Sagle.. would you be able to post just one of your scripts? It doesnt really matter what it does but just so I can see the syntax and the CLI commands together would be great. Just to give me an idea... As I said above my first script will be using nas_replicate to failover a vdm and its filesystems..
Thanks!
Packetboy.
Rainer_EMC
4 Operator
•
8.6K Posts
0
August 29th, 2008 06:00
could start taking a look at one of the EMC skripts like /nas/sbin/refresh_ckpt
Its probably a bit longer and more verbose than what you would write, but it shows the concepts.
It also shows how to use -query argument to get specific fields from the output of a Celerra command
Another neat trick to find out the exact syntax and args for something you want to do is to do it with
the Celerra Manager GUI and then do
tail /nas/log/cmd_log
This will show you what the GUI actually issued
dynamox
9 Legend
•
20.4K Posts
0
August 29th, 2008 07:00
doof1
45 Posts
0
August 29th, 2008 07:00
example (report of checkpoint space) :
nas_fs -query:* -format:'%q' -Fields:checkpoints -query:* -format:'%s;%s\n' -fields:name,SizeValues | sort | sed 's/,/;/g' | awk -F ';' '{printf"%s: Size=
%6d, Available= %6d, Used= %6d (%3d%) (Size in MB)\n",$1,$2,$3,$4,$5}'
All is explain in celerra documentation
++
Rainer_EMC
4 Operator
•
8.6K Posts
1
August 29th, 2008 09:00
1 Attachment
nas_query from CmdRef.pdf
packetboy2
28 Posts
0
September 4th, 2008 01:00
Will let everyone know how the script turns out..
Thanks again to everyone for being so helpful on this forum!
Rainer_EMC
4 Operator
•
8.6K Posts
0
September 4th, 2008 11:00
I wouldnt do that - these are subject to change at any time
If you need performance data take a look at the (new in DART 5.6) server_stats command
If there is something missing there we would like to get feedback
ScotN
76 Posts
0
September 4th, 2008 11:00
Has anyone looked at accessing the celerra stats by directly using the java databases in /nas/jserver/sdb/ ?
Parsing the output of some of these utilities can be tricky.
Scot
ScotN
76 Posts
0
September 4th, 2008 12:00
The goal is to expose the stats over SNMP from the control station like so...
exec .1.3.6.1.4.1.2021.50.#.#.#.# sysstat /home/nasadmin/snmp/server_snmp.sh server_3 sysstat
exec .1.3.6.1.4.1.2021.50.#.#.#.#. nfsstat /home/nasadmin/snmp/server_snmp.sh server_3 nfsstat
exec .1.3.6.1.4.1.2021.50.#.#.#.# cifsstat /home/nasadmin/snmp/server_snmp.sh server_3 cifsstat
...
I have a cron that runs every few minutes to update flat, parsed, text files. The snmp exec is just a simple grep of these files because of UCD-snmp limitations.
more server_5_cifsstat
SMBsMkdir_ncalls=0
SMBsMkdir_%totcalls=0.00
SMBsMkdir_maxTime=0.00
SMBsMkdir_ms_call=0.00
SMBsRmdir_ncalls=20843
SMBsRmdir_%totcalls=0.00
SMBsRmdir_maxTime=179.47
SMBsRmdir_ms_call=2.17
SMBsOpen_ncalls=0
SMBsOpen_%totcalls=0.00
SMBsOpen_maxTime=0.00
Would be noce if EMC installed XML perl modules as well.. Any EMC folks listening ?
Rainer_EMC
4 Operator
•
8.6K Posts
0
September 4th, 2008 13:00
It would be good if you could file a product enhancement request (PER) for that.
Can you elaborate whats wrong with server_stats ?
Do you have EMC ControlCenter by any chance ?
ScotN
76 Posts
0
September 4th, 2008 14:00
Been down the EMC road.. They want you to buy addon products. ControlCenter is the web based UI right? no good to people with a standard solution for trending and alerting usually 90% snmp.
Can't seem to reproduce it now but I was getting out of order fields when the CPU spiked to 90%. Since we fixed the application stats have retuned to the expected fields when using server_cifstats server_# -full
Anyway It would be a lot easier to read the data from a db file then stats would match celerra manager and , I think, also expose the data we see in the other summary graphs without having to calculate and merge data points taken from different time intervals.
ScotN
76 Posts
0
September 5th, 2008 10:00