mehr Infos bei Module Error, custom mapping. Kann gerne erweitert werden
cmd -> echo %COMPUTERNAME%
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using BS.Shared.AppSender;
|
||||
using DevExpress.Mvvm.Native;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
@@ -17,6 +18,11 @@ namespace BS.Shared.Core
|
||||
private static readonly Module _GKV_Module2 = new Module("GkvTest", "GKV/EDI/EDAT");
|
||||
private static readonly Module _AI_Module = new Module("Ai", "AI");
|
||||
|
||||
private static readonly Dictionary<string, string> _serverMap = new Dictionary<string, string>()
|
||||
{
|
||||
["WIN-A27H847STS6"] = "app8.bewoplaner.de",
|
||||
};
|
||||
|
||||
public static bool SendAiModuleErrorMail(string title, string body, string tenant)
|
||||
=> SendModuleErrorMail(_AI_Module, title, body, tenant);
|
||||
|
||||
@@ -56,8 +62,12 @@ namespace BS.Shared.Core
|
||||
body += "\n" + server_str;
|
||||
|
||||
string hostname = Dns.GetHostName();
|
||||
string hostname_str = "Hostname: " + (hostname ?? "unknown");
|
||||
body += "\n" + hostname_str;
|
||||
string hostname_str = "MachineName: " + (hostname ?? "unknown");
|
||||
body += "\n\n" + hostname_str;
|
||||
|
||||
string server2 = _serverMap.GetValueOrDefault(hostname, "unknown");
|
||||
string server2_str = "ServerMap: " + (server2);
|
||||
body += "\n" + server2_str;
|
||||
|
||||
return SendEmail(subject, body, toAddress, senderName, senderEMail, smtpServer, smtpUser, smtpPassword, sendAsync);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user