73 lines (68 with data), 4.7 kB
#!/usr/bin/php5
<?
/*
VMLMAT: VM Linux Management and Archival Tool.
Copyright (c) 2007, Ronnie Michael, BMC Software Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of the BMC Software Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#
# Routine to mail user notifcation of status
#
$email = $argv[2];
$host = $argv[1];
$mn = $argv[3];
$omail = $argv[4];
#
# get parmfile variables needed
include 'bkinc.php';
#
#
$subject = "VMLMAT request for System $host";
if ($mn == "0") exit;
if ($mn == "1") $message = "System under Test. You are currently not authorized, please contact support";
if ($mn == "2") $message = "Unable to bring device online of target system, please contact support";
if ($mn == "3") $message = "Unable to format target system, please contact support";
if ($mn == "4") $message = "Unable to fdasd target system, please contact support";
if ($mn == "5") $message = "Unable to mkfs target system, please contact support";
if ($mn == "6") $message = "Unable to mount target system, please contact support";
if ($mn == "7") $message = "Tar copy failed, please contact support";
if ($mn == "8") $message = "The system has been restored.";
if ($mn == "9") $message = "The system has been copied to archive.";
if ($mn == "10") $message = "The system has been shutdown and is logged off VM";
if ($mn == "11") $message = "The system is now up and running.";
if ($mn == "12") $message = "Malformed request, please contact support";
if ($mn == "13") $message = "Tar restore failed. Your volume may be too small or the tarfile is missing, please contact support";
if ($mn == "14") $message = "The system will be brought down and restored from a backup by owner: " . $omail;
if ($mn == "15") $message = "The system will be brought down and copied to archive by owner: " . $omail;
if ($mn == "16") $message = "The system will be brought down by owner: " . $omail;
if ($mn == "17") $message = "The system will be brought up by owner: " . $omail;
if ($mn == "18") $message = "A co-owner was added. The new owner email: " . $omail;
if ($mn == "19") $message = "A co-owner was deleted. The deleted owner email: " . $omail;
if ($mn == "20") $message = "An autobackup was added or updated by owner: " . $omail;
if ($mn == "21") $message = "An autobackup was deleted by owner: " . $omail;
if ($mn == "22") $message = "An autobackup was started for this system and it will be brought down. " . $omail;
if ($mn == "23") $message = "An autobackup has finished for this system and it will be brought up. " . $omail;
if ($mn == "24") $message = "A multi-volume backup was attempted but FSTAB could not be read correctly. Only 1 volume was backed up but may not restore.";
if ($mn == "25") $message = "The system was user non-backup processed as a Re-IP task";
if ($mn == "26") $message = "The system was restore processed as a Re-IP task. The system should now be re-ip.";
if ($mn == "27") $message = "The CMS Control VM has not responded to status. The CMS Control VM should now be re-IPL.";
if ($mn == "28") $message = "The system was requested to be shutdown. However, it has not been shutdown correctly";
if ($mn == "29") $message = "The system was requested to be brought up. However, it is not up and running.";
if ($mn == "30") $message = "The system queue processing failed. Request is skipped to continue queue.";
mail( $email, $subject, $message, "From: $sender" );
?>