Subscribe

Volume\qtree full notification

Hello,

Does netapp provide automated email notification facility either via filer or DFM or scripts to notify owners of volumes when the share or volume\qtree are near full, can you explain how this can be acomplished and what is needed.

We are on FAS3050 , ontap 7.2.4 P8 and use basic DFM.

examples or scripts are welcome.

Thanks

Re: Volume\qtree full notification

You can achieve this with DFM, but you may need to create notification groups within Operations Manager for people that you would like to get notified. Then you can attach a volume usage event (with 2 or 3 thresholds if you like) to the required volume / qtree.

Out of the box, I don't believe you can do this directly with qtree owners. The problems comes down to how do you define a qtree owner, you can't do it on windows ownership as this often changes during a recovery, and having named owners requires some sort of API. Operations Manager will get you close to this, otherwise you may want to look at a 3rd party quota tool that plugs into the fpolicy functionality of the filer, (something like NTP QFS, or Northern Storage Suite).

Re: Volume\qtree full notification

You can use the following thresholds in DFM to get notifications when a qtree/volume is close to getting full:

[root@trinity perfdata]# dfm option list | grep -i threshold

... output skipped for brevity ...

qtreeFullThreshold                    90

qtreeNearlyFullThreshold              80

volFullThreshold                      90

volNearlyFullThreshold                80

... output skipped for brevity ...

The values listed are the defaults.

You can then configure alarms to send an email to specific users whenever the thresholds are breached, as follows:

For volumes:

dfm alarm create -E <comma-separated-list-of-email-ids> -C df.kbytes -v warning

For qtrees:

dfm alarm create -E <comma-separated-list-of-email-ids> -C qtree.kbytes -v warning

Regards,

Hari

Re: Volume\qtree full notification

There is no need for creating new alarms, because you can set an owner and email address for specific volumes and qtrees. When the threhsolds are met, they will receive an email.

The option to set an owner is availabe in the "edit quota settings"  which can found on bottom left after selecting the volume/qtree.

Re: Volume\qtree full notification

What if you can't use DFM on a certain filer cluster?  We have a cluster in AU that is only on a private network so we cannot see it via DFM.  It can send emails but that's it.  Is there a way to set a vol threshold for an autosupport warning/error email to be sent by the filer itself?

Re: Volume\qtree full notification

Not out of the box on the NetApp, no. The filer will happily send AutoSupports, but this wouldn't be classed as a support request. It will send an AutoSupport when you fail to take a snapshot because of a volume full though.

You could do this with something custom either using the ManageOnTap SDK or using some RSH / SSH scripts.

Re: Volume\qtree full notification

We achieve this by having an alarm trigger on "qree full" and "qtree almost full" that calls an external script to generate an email message. We found that the message automatically generated by DFM is really intended for a storage adminstrator rather than an end user, and we wanted to be able to notify end users in our case.

The script is simple PERL that generates a "user friendly" email message warning about the qtree getting close to capacity. Because of the consistent volume and qtree naming that we use, the script can identify a unique email address per qtree and then our email system forwards the message to the appropriate person. It may be possible to use the "owner email" field in DFM to specify an address but I'm not sure if that value gets passed to an alarm script or not.

It would be nice if DFM had in-built support for this kind of notification like it has for user quotas!

Cheers,

Richard

Re: Volume\qtree full notification

Hi Richard!

I just wanted to ask if there is a chance that you provide the basic script here in the community (without your special and private logic). This would be a great help.

Thanks in advance,

Christoph

Re: Volume\qtree full notification

Sure. It is very straight-forward. I was originally just going to do it in shell script (my PERL is not that great) but the amount of string manipulation makes it tedious. You should note there is little to no error checking going on here.

You can tell Ops Manager/DFM to trigger the script by using something like 'dfm alarm modify -u <user> -s "/usr/bin/perl <full path to script>" <alarmid>'. You have to do this using the CLI.

#!/usr/bin/perl


use strict;


# DFM variables are passed in the environment, but have lengthy names
my $used = $ENV{"DFM_QTREE_KB_USED"};
my $limit = $ENV{"DFM_QTREE_KB_LIMIT"};
my $event = $ENV{"DFM_EVENT_NAME_CLI"};
my $source = $ENV{"DFM_SOURCE_NAME"};
my $pctused = $ENV{"DFM_QTREE_KB_PERCENT"};



# sanity check to make sure this is one of the two events we're expecting
my $threshold;


if ($event eq "qtree-full") {
        $threshold=1;
} elsif ($event eq "qtree-almost-full") {
        $threshold=0;
} else {
        exit 0;
}


# "source" is in the format "filer:/volume/qtree" so separate them out:
my ($filer,$volume,$qtree) = split('/',$source);
chop($filer);

# translate the quota values into sensible units
my @units = ('kB','MB','GB','TB');
my $unit=shift(@units);

while ($used > 1024 and @units) {
        $unit=shift(@units);
        $used /= 1024;
        $limit /= 1024;
}

# two decimal places should be accurate enough...

$used = sprintf("%.2f",$used);
$limit = sprintf("%.2f",$limit);
$pctused = sprintf("%.2f",$pctused);

# do whatever logic you need to do here to form an email address from the filer, volume and qtrees

# my $email = ......


# construct the email message to send using whatever logic you need....

# my $message = <<EOT

# ...

# ...

# EOT


# send the message thru sendmail:

open MAIL, '|/usr/sbin/sendmail $email';
print MAIL $message;
close MAIL;

# log it, just in case

open LOG, '>>/var/log/quota-alert.log';
print LOG "Alert sent to $email about $source: $used $unit of $limit $unit ($pctused %)\n";
close LOG;

Re: Volume\qtree full notification

Uh, be careful with this as the script is being word-wrapped. Not sure how to prevent that...