|
Classes | |
| class | i_LibraryAgentSCSI_i |
| class | la_SCSILibrary |
| struct | la_ManualDrive |
| class | i_LibraryAgentManual_i |
Functions | |
| void | SendEmail (string a_addr, string a_lib, string a_host, string a_what, string a_drive, string a_bc, string a_slot) |
| void | SendMsg (string a_addr, string a_lib, string a_host, string a_what, string a_drive, string a_bc, string a_slot) |
| void SendEmail | ( | string | a_addr, | |
| string | a_lib, | |||
| string | a_host, | |||
| string | a_what, | |||
| string | a_drive, | |||
| string | a_bc, | |||
| string | a_slot | |||
| ) |
Definition at line 32 of file la_manual_LNX.cpp.
References cmn_ExecCommand(), evt_ERROR, ivd_BaseException::GetFriendly(), log_FUNC_m, log_WriteEvent(), SendEmail(), and SendMsg().
Referenced by i_LibraryAgentManual_i::Reconfigure(), and SendEmail().
00034 { 00035 log_FUNC_m(SendEmail); 00036 00037 vector<string> argVec; 00038 string execThis = "/bin/sh"; 00039 00040 argVec.push_back("-c"); 00041 00042 ostringstream sstr; 00043 sstr << "echo \"IVD " << a_lib << "@" << a_host << ": drive " << a_drive 00044 << " - " << a_what << " medium " << a_bc 00045 << "\n\nUse /opt/ivd/sbin/tools/ivd_la to confirm.\" | /bin/mail -s " 00046 << "\"IVD " << a_lib << "@" << a_host << ": drive " << a_drive 00047 << " - " << a_what << " medium " << a_bc 00048 << "\" " << a_addr; 00049 argVec.push_back(sstr.str()); 00050 00051 try{ 00052 cmn_ExecCommand(execThis, argVec); 00053 } 00054 catch (ivd_Exception &ie){ 00055 ostringstream sstr; 00056 sstr << "Cannot execute: " << execThis 00057 << " (" << ie.GetFriendly() << ")."; 00058 log_WriteEvent(evt_ERROR, sstr.str()); 00059 throw; 00060 } 00061 catch (...){ 00062 ostringstream sstr; 00063 sstr << "Cannot execute: " << execThis << "."; 00064 log_WriteEvent(evt_ERROR, sstr.str()); 00065 throw; 00066 } 00067 }


| void SendMsg | ( | string | a_addr, | |
| string | a_lib, | |||
| string | a_host, | |||
| string | a_what, | |||
| string | a_drive, | |||
| string | a_bc, | |||
| string | a_slot | |||
| ) |
Definition at line 71 of file la_manual_LNX.cpp.
References cmn_ExecCommand(), evt_ERROR, ivd_BaseException::GetFriendly(), log_FUNC_m, log_WriteEvent(), and SendMsg().
Referenced by i_LibraryAgentManual_i::Reconfigure(), SendEmail(), and SendMsg().
00073 { 00074 log_FUNC_m(SendMsg); 00075 00076 vector<string> argVec; 00077 string execThis = "/bin/sh"; 00078 00079 argVec.push_back("-c"); 00080 00081 ostringstream sstr; 00082 sstr << "echo \"IVD " << a_lib << "@" << a_host << ": drive " << a_drive 00083 << " - " << a_what << " medium " << a_bc 00084 << "\n\nUse /opt/ivd/sbin/tools/ivd_la to confirm.\""; 00085 if (a_addr.empty()) { 00086 sstr << " | /usr/bin/wall"; 00087 } 00088 else { 00089 sstr << " | /usr/bin/write " << a_addr; 00090 } 00091 argVec.push_back(sstr.str()); 00092 00093 try{ 00094 cmn_ExecCommand(execThis, argVec); 00095 } 00096 catch (ivd_Exception &ie){ 00097 ostringstream sstr; 00098 sstr << "Cannot execute: " << execThis 00099 << " (" << ie.GetFriendly() << ")."; 00100 log_WriteEvent(evt_ERROR, sstr.str()); 00101 throw; 00102 } 00103 catch (...){ 00104 ostringstream sstr; 00105 sstr << "Cannot execute: " << execThis << "."; 00106 log_WriteEvent(evt_ERROR, sstr.str()); 00107 throw; 00108 } 00109 }


1.5.6