Hi Brian,
You should have access to a global $SYSADMIN variable. This variable gets set to the value of the sysadmin= line in vcld.conf.

Keep in mind, this global variable is a remnant of the code before it was modularized and before DataStructure.pm was created. It will likely go away once the following Jira issue slated for 2.2 is complete:

It will be easy to expose it in DataStructure.pm as something like $self->data->get_sysadmin_email(). I could add this once 2.1 is released. So, you can use $SYSADMIN for now but I would plan on changing it once it's exposed via DataStructure.pm.


Brian Bouterse wrote:
When executing perl code inside a provisioning module, when I got o use the mail utility function, how can I know to $to address that the admins have configured to be the vcl administrator e-mail address?


Brian Bouterse
NEXT Services

On Oct 20, 2009, at 8:46 AM, Aaron Peeler wrote:

If you don't care about the message also going to the vcld.log file.

You can call the utils mail routine from any of the other modules.

mail($to,$subject,$mailstring, $from)

$from is optional


--On October 19, 2009 5:12:55 PM -0400 Brian Bouterse <bmbou...@gmail.com> wrote:

As esxthin.pm manages the image library hosted on a NetApp storage
system, the module monitors for important events, and would like to
notify an administrator more pro-actively then logging it as a critical.
Is there a VCL utility function, or existing example code which would be
able to send an e-mail to the VCL administrator?

This code would be a stop-gap until a more formal storage provisioning
architecture is worked out in the future.


Brian Bouterse
NEXT Services

Andy Kurth
Virtual Computing Lab
Office of Information Technology
North Carolina State University

Reply via email to