Here is a small one I wrote to make a backup of the custom items and files we have in nasadmin's homedir, and also the nasdb. This copies the backup tar to a filesysem that is backed up. This saved us once, when our nasdb got corrupted and we didn't notice till after the local backups were all corrupted too.
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
I suggest learning sa much as possible about shell scripting on linux and possibly perl and also CLI functions on the celerra. Then you can put the two together and create shells scripts to do lots of things. I have a lot of scripted monitoring and alerting setup in my environment. I would be happy to assist with specific tasks if you need.
Hey guys thanks for the answers.. I will pick up some korn bash scripting books off amazon..
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..
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
Thanks to everyone for the very helpful comments.. I have ordered a few bash scripting books from amazon and started checking out the query command on the nas binaries.. Its just a pity it doesnt seem the query command works on nas_replicate but that gives me the excuse to just bash script that one..
Will let everyone know how the script turns out..
Thanks again to everyone for being so helpful on this forum!
Hi;, 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.
But that's the point. I am looking for stats not to hold open but just to expose what we see in Celerra manager without having to use server_stats commands every 2-5 minutes. I have found the stats difficult to parse and some show inconsistent results with celerra manager and even missing data points on some cycles. To me it would be infinatly better to take that load off the control station and directly poll the db files for the last value. 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 ?
Yes I get Full SNMP stats trending CPU, DISK,Memory CIFS, NFS Anything I want to parse. Including sym stats using sysmstats from symcli in /opt/.
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.
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