public override ServiceProviderItemBandwidth[] GetServiceItemsBandwidth(ServiceProviderItem[] items, DateTime since) { ServiceProviderItemBandwidth[] itemsBandwidth = new ServiceProviderItemBandwidth[items.Length]; // create parser object // and update statistics LogParser parser = new LogParser("Gene6Ftp", SiteId, GetLogsPath(), "cs-username"); parser.ParseLogs(); // update items with diskspace for (int i = 0; i < items.Length; i++) { ServiceProviderItem item = items[i]; // create new bandwidth object itemsBandwidth[i] = new ServiceProviderItemBandwidth(); itemsBandwidth[i].ItemId = item.Id; itemsBandwidth[i].Days = new DailyStatistics[0]; if (item is FtpAccount) { try { // get daily statistics itemsBandwidth[i].Days = parser.GetDailyStatistics(since, new string[] { item.Name }); } catch (Exception ex) { Log.WriteError(ex); } } } return(itemsBandwidth); }
public override ServiceProviderItemBandwidth[] GetServiceItemsBandwidth(ServiceProviderItem[] items, DateTime since) { ServiceProviderItemBandwidth[] itemsBandwidth = new ServiceProviderItemBandwidth[items.Length]; // calculate bandwidth for Default FTP Site FtpSite ftpSite = GetSite(SiteId); string siteId = String.Concat("FTPSVC", ftpSite[FtpSite.MSFTP7_SITE_ID]); string logsPath = Path.Combine(ftpSite.LogFileDirectory, siteId); // create parser object // and update statistics LogParser parser = new LogParser("Ftp", siteId, logsPath, "s-sitename", "cs-username"); // Subscribe to the events because FTP 7.0 has several differences that should be taken into account // and processed in a specific way parser.ProcessKeyFields += new ProcessKeyFieldsEventHandler(LogParser_ProcessKeyFields); parser.CalculateStatisticsLine += new CalculateStatsLineEventHandler(LogParser_CalculateStatisticsLine); // parser.ParseLogs(); // update items with diskspace for (int i = 0; i < items.Length; i++) { ServiceProviderItem item = items[i]; // create new bandwidth object itemsBandwidth[i] = new ServiceProviderItemBandwidth(); itemsBandwidth[i].ItemId = item.Id; itemsBandwidth[i].Days = new DailyStatistics[0]; if (item is FtpAccount) { try { // get daily statistics itemsBandwidth[i].Days = parser.GetDailyStatistics(since, new string[] { siteId, item.Name }); } catch (Exception ex) { Log.WriteError(ex); } } } return(itemsBandwidth); }
public override ServiceProviderItemBandwidth[] GetServiceItemsBandwidth(ServiceProviderItem[] items, DateTime since) { ServiceProviderItemBandwidth[] itemsBandwidth = new ServiceProviderItemBandwidth[items.Length]; // calculate bandwidth for Default FTP Site FtpSite fptSite = GetSite(SiteId); string siteId = SiteId.Replace("/", ""); string logsPath = Path.Combine(fptSite.LogFileDirectory, siteId); // create parser object // and update statistics LogParser parser = new LogParser("Ftp", siteId, logsPath, "s-sitename", "cs-username"); parser.ParseLogs(); // update items with diskspace for (int i = 0; i < items.Length; i++) { ServiceProviderItem item = items[i]; // create new bandwidth object itemsBandwidth[i] = new ServiceProviderItemBandwidth(); itemsBandwidth[i].ItemId = item.Id; itemsBandwidth[i].Days = new DailyStatistics[0]; if (item is FtpAccount) { try { // get daily statistics itemsBandwidth[i].Days = parser.GetDailyStatistics(since, new string[] { siteId, item.Name }); } catch (Exception ex) { Log.WriteError(ex); } } } return(itemsBandwidth); }
public override ServiceProviderItemBandwidth[] GetServiceItemsBandwidth(ServiceProviderItem[] items, DateTime since) { ServiceProviderItemBandwidth[] itemsBandwidth = new ServiceProviderItemBandwidth[items.Length]; // update items with diskspace for (int i = 0; i < items.Length; i++) { ServiceProviderItem item = items[i]; // create new bandwidth object itemsBandwidth[i] = new ServiceProviderItemBandwidth(); itemsBandwidth[i].ItemId = item.Id; itemsBandwidth[i].Days = new DailyStatistics[0]; if (item is WebSite) { try { WebSite site = GetSite(item.Name); string siteId = site[WebSite.IIS7_SITE_ID]; string logsPath = Path.Combine(site.LogsPath, siteId); if (!Directory.Exists(logsPath)) continue; // create parser object // and update statistics LogParser parser = new LogParser("Web", siteId, logsPath, "s-sitename"); parser.ParseLogs(); // get daily statistics itemsBandwidth[i].Days = parser.GetDailyStatistics(since, new string[] { siteId }); } catch (Exception ex) { Log.WriteError(ex); } } } return itemsBandwidth; }
public override ServiceProviderItemBandwidth[] GetServiceItemsBandwidth(ServiceProviderItem[] items, DateTime since) { ServiceProviderItemBandwidth[] itemsBandwidth = new ServiceProviderItemBandwidth[items.Length]; // create parser object // and update statistics LogParser parser = new LogParser("Gene6Ftp", SiteId, GetLogsPath(), "cs-username"); parser.ParseLogs(); // update items with diskspace for (int i = 0; i < items.Length; i++) { ServiceProviderItem item = items[i]; // create new bandwidth object itemsBandwidth[i] = new ServiceProviderItemBandwidth(); itemsBandwidth[i].ItemId = item.Id; itemsBandwidth[i].Days = new DailyStatistics[0]; if (item is FtpAccount) { try { // get daily statistics itemsBandwidth[i].Days = parser.GetDailyStatistics(since, new string[] { item.Name }); } catch (Exception ex) { Log.WriteError(ex); } } } return itemsBandwidth; }
public override ServiceProviderItemBandwidth[] GetServiceItemsBandwidth(ServiceProviderItem[] items, DateTime since) { ServiceProviderItemBandwidth[] itemsBandwidth = new ServiceProviderItemBandwidth[items.Length]; // calculate bandwidth for Default FTP Site FtpSite ftpSite = GetSite(SiteId); string siteId = String.Concat("FTPSVC", ftpSite[FtpSite.MSFTP7_SITE_ID]); string logsPath = Path.Combine(ftpSite.LogFileDirectory, siteId); // create parser object // and update statistics LogParser parser = new LogParser("Ftp", siteId, logsPath, "s-sitename", "cs-username"); // Subscribe to the events because FTP 7.0 has several differences that should be taken into account // and processed in a specific way parser.ProcessKeyFields += new ProcessKeyFieldsEventHandler(LogParser_ProcessKeyFields); parser.CalculateStatisticsLine += new CalculateStatsLineEventHandler(LogParser_CalculateStatisticsLine); // parser.ParseLogs(); // update items with diskspace for (int i = 0; i < items.Length; i++) { ServiceProviderItem item = items[i]; // create new bandwidth object itemsBandwidth[i] = new ServiceProviderItemBandwidth(); itemsBandwidth[i].ItemId = item.Id; itemsBandwidth[i].Days = new DailyStatistics[0]; if (item is FtpAccount) { try { // get daily statistics itemsBandwidth[i].Days = parser.GetDailyStatistics(since, new string[] { siteId, item.Name }); } catch (Exception ex) { Log.WriteError(ex); } } } return itemsBandwidth; }
public override ServiceProviderItemBandwidth[] GetServiceItemsBandwidth(ServiceProviderItem[] items, DateTime since) { ServiceProviderItemBandwidth[] itemsBandwidth = new ServiceProviderItemBandwidth[items.Length]; // calculate bandwidth for Default FTP Site FtpSite fptSite = GetSite(SiteId); string siteId = SiteId.Replace("/", ""); string logsPath = Path.Combine(fptSite.LogFileDirectory, siteId); // create parser object // and update statistics LogParser parser = new LogParser("Ftp", siteId, logsPath, "s-sitename", "cs-username"); parser.ParseLogs(); // update items with diskspace for (int i = 0; i < items.Length; i++) { ServiceProviderItem item = items[i]; // create new bandwidth object itemsBandwidth[i] = new ServiceProviderItemBandwidth(); itemsBandwidth[i].ItemId = item.Id; itemsBandwidth[i].Days = new DailyStatistics[0]; if (item is FtpAccount) { try { // get daily statistics itemsBandwidth[i].Days = parser.GetDailyStatistics(since, new string[] { siteId, item.Name }); } catch (Exception ex) { Log.WriteError(ex); } } } return itemsBandwidth; }