9 Legend

 • 

20.4K Posts

May 1st, 2009 00:00

if you have configured control station for email notification, then you can setup some sort of perl/bash script to run "nas_pool -size" queries" and capture the fields you need and then email them to you.

57 Posts

May 1st, 2009 06:00

Hello Dynamox,

Thanks you for your response. Do you happen to have any info or examples how I can create and set this up . I have very little knowledge about perl scripting..

Thanks again.

9 Legend

 • 

20.4K Posts

May 3rd, 2009 23:00

it's not very difficult at all. Basically you will need to instruct perl to execute Celerra commands, pipe them to a file and then massage them to give you the info you are looking for. You can also do the same thing with bash but i find perl to be much more efficient at parsing text. If you can wait a week i can whip something up when i get back from my overseas trip ;)

57 Posts

May 7th, 2009 02:00

Great !... Thank you Dynamox. It would certainly be a big help .

I'll look forward for your response.

96 Posts

May 7th, 2009 11:00

I monitor this info myself via a small perl script...

#!/usr/bin/perl
 
$ENV{PATH} = "/nas/bin:/nas/sbin:".$ENV{PATH};
$ENV{NAS_DB} = "/nas";
 
print "Pool,Capacity(MB),Used(MB),Available(MB)\n";
 
@poolList = `nas_pool -l | awk '{print \$4}'`;
for ($x=1; $x<$#poolList; $x++)
{
        chop($poolList[$x]);
        print $poolList[$x].",";
 
        print `nas_pool -query:name==$poolList[$x] -fields:CapacityMB -format:'%s'`.",";
        print `nas_pool -query:name==$poolList[$x] -fields:UsedMB -format:'%s'`.",";
        print `nas_pool -query:name==$poolList[$x] -fields:AvailableMB -format:'%s'`."\n";
}

57 Posts

May 7th, 2009 19:00

Hi Pittperson,

Thank you for your response..This may seem like a stupid question but how do I run a perl script in celerra ? I have never ran a perl script in Celerra .If its not too much to ask can you provide step by step instructions how to connect celerra and run a perl script. It would certainly be appreciated,

btw. I can connect to Celerra via putty if that helps...

Thank you in advance for your help..

4 Operator

 • 

8.6K Posts

May 8th, 2009 03:00

just execute it

the magic first two #! characters in the script tell Unix to start it using perl

96 Posts

May 8th, 2009 05:00

1) Log into the control station (ssh via putty)
2) chmod +x

57 Posts

May 8th, 2009 17:00

Great !..work like a charm.. thx..

I'm almost there.. how can forward the result in email ?

Thanks again,,,

4 Operator

 • 

8.6K Posts

May 10th, 2009 15:00

*if* you have sendmail setup correctly on your control station just pipe it to Mail like this:

| /usr/bin/Mail -s

3 Posts

December 28th, 2009 08:00

Do any one know how to set a env variables from a windows box using perl script

$ENV{PATH} = "/nas/bin:/nas/sbin:".$ENV{PATH};
$ENV{NAS_DB} = "/nas";

execute_ssh("/nas/bin/./server_df ALL",$hostname,"nas_info");

4 Operator

 • 

8.6K Posts

December 28th, 2009 08:00

you're probably seeing this http://stackoverflow.com/questions/216202/why-does-an-ssh-remote-command-get-fewer-environment-variables-then-when-run-manu

I would just create a small shell skript that sets the necessary environment variables and then calls the server_ or nas_ command

Rainer

9 Legend

 • 

20.4K Posts

December 28th, 2009 09:00

i did not find any good ssh modules for Windows so i've been using plink.

my $host   = "$ARGV[0]";

my $disk_space = `plink.exe -ssh -pw nasadmin nasadmin\@$host "NAS_DB=/nas /nas/bin/server_df ALL"`

3 Posts

December 28th, 2009 09:00

i used the following and it did work

  $out=execute_ssh("NAS_DB=/nas /nas/bin/./server_df ALL",$hostname,"log");

3 Posts

December 28th, 2009 09:00

no. I am not very good at perl. But i am trying to ssh to all celera box's from a windows machine and print logs out the cmd output. Once these logs are created i can parse them.

eg:"server_df ALL" output logs created for all celera machines via ssh.

with the following in code

  $return_call=execute_ssh("/nas/bin/./server_df ALL",$hostname,"logfile");

I am getting  error:

NAS_DB environment not defined

No Events found!

Top