[CONTRIB] hMailServer Provider DiskSpace/Bandwidth Calculation
-
lunedì 18 luglio 2011 21:22
Please include this in the next version on WesitePanel:
I got it working with WebsitePanel 1.2 & hMailServer 5.3 (even without source codes, BTW why can't I download the full project from Codeplex?):
hMailServer.vb:
Public Overrides Function GetServiceItemsDiskSpace(ByVal items() As ServiceProviderItem) As ServiceProviderItemDiskSpace() Dim itemsDiskspace As List(Of ServiceProviderItemDiskSpace) = New List(Of ServiceProviderItemDiskSpace) ' update items with diskspace Dim item As ServiceProviderItem For Each item In items If TypeOf item Is MailAccount Then Try Dim name As String = item.Name Dim domainName As String = name.Substring((name.IndexOf("@") + 1)) Dim objDomain As Service = GetDomainObject(domainName) Dim objAccount = objDomain.ComObject.Accounts.ItemByAddress(name) Dim objAccountSize As Long = objAccount.Size() * 1048576 ' calculate disk space Dim diskspace As New ServiceProviderItemDiskSpace() diskspace.ItemId = item.Id diskspace.DiskSpace = objAccountSize itemsDiskspace.Add(diskspace) Catch ex As Exception Log.WriteError("Error calculating disk space for mail account: " + item.Name, ex) End Try End If Next item Return itemsDiskspace.ToArray() End Function
Now for the Bandwidth I think parsing the AWStats file would work.. but not sure how to use the LogParser..
Tutte le risposte
-
venerdì 13 gennaio 2012 15:46
How do i make mine working...??? I have Win2008 with hmailserver, IIS7.
My Website panel does not calculate any diskspace and bandwidth for Mail...
Only thing it can calculate is the diskspace used by the folder of the domain in hostingspace..
Please help..
-
domenica 15 gennaio 2012 14:15
Please include this in the next version on WesitePanel:
I got it working with WebsitePanel 1.2 & hMailServer 5.3 (even without source codes, BTW why can't I download the full project from Codeplex?):
hMailServer.vb:
Public Overrides Function GetServiceItemsDiskSpace(ByVal items() As ServiceProviderItem) As ServiceProviderItemDiskSpace() Dim itemsDiskspace As List(Of ServiceProviderItemDiskSpace) = New List(Of ServiceProviderItemDiskSpace) ' update items with diskspace Dim item As ServiceProviderItem For Each item In items If TypeOf item Is MailAccount Then Try Dim name As String = item.Name Dim domainName As String = name.Substring((name.IndexOf("@") + 1)) Dim objDomain As Service = GetDomainObject(domainName) Dim objAccount = objDomain.ComObject.Accounts.ItemByAddress(name) Dim objAccountSize As Long = objAccount.Size() * 1048576 ' calculate disk space Dim diskspace As New ServiceProviderItemDiskSpace() diskspace.ItemId = item.Id diskspace.DiskSpace = objAccountSize itemsDiskspace.Add(diskspace) Catch ex As Exception Log.WriteError("Error calculating disk space for mail account: " + item.Name, ex) End Try End If Next item Return itemsDiskspace.ToArray() End Function
Now for the Bandwidth I think parsing the AWStats file would work.. but not sure how to use the LogParser..
When will you reply...??? Mine is not working .. Tell me how to use this script.. and where.. whats..??
Bhargav L Pandya -
domenica 29 gennaio 2012 10:57
Please include this in the next version on WesitePanel:
I got it working with WebsitePanel 1.2 & hMailServer 5.3 (even without source codes, BTW why can't I download the full project from Codeplex?):
hMailServer.vb:
Public Overrides Function GetServiceItemsDiskSpace(ByVal items() As ServiceProviderItem) As ServiceProviderItemDiskSpace() Dim itemsDiskspace As List(Of ServiceProviderItemDiskSpace) = New List(Of ServiceProviderItemDiskSpace) ' update items with diskspace Dim item As ServiceProviderItem For Each item In items If TypeOf item Is MailAccount Then Try Dim name As String = item.Name Dim domainName As String = name.Substring((name.IndexOf("@") + 1)) Dim objDomain As Service = GetDomainObject(domainName) Dim objAccount = objDomain.ComObject.Accounts.ItemByAddress(name) Dim objAccountSize As Long = objAccount.Size() * 1048576 ' calculate disk space Dim diskspace As New ServiceProviderItemDiskSpace() diskspace.ItemId = item.Id diskspace.DiskSpace = objAccountSize itemsDiskspace.Add(diskspace) Catch ex As Exception Log.WriteError("Error calculating disk space for mail account: " + item.Name, ex) End Try End If Next item Return itemsDiskspace.ToArray() End Function
Now for the Bandwidth I think parsing the AWStats file would work.. but not sure how to use the LogParser..
When will you reply...??? Mine is not working .. Tell me how to use this script.. and where.. whats..??
Bhargav L PandyaWe did the change in the hMailServer.vb and it works fine, thanks Dan.
Pandya, is this the respectable way to ask others help and support ?!
-
venerdì 3 febbraio 2012 03:51
Ya, I understand that is not the way.. but I am really tired of waiting for someone to reply.. I dont have that file in my installation. anywhere..
Regards
Bhargav L Pandya -
venerdì 3 febbraio 2012 03:57
Ya, I understand that is not the way.. but I am really tired of waiting for someone to reply.. I dont have that file in my installation. anywhere.. Also I got the data from codeplex.. and got the file there.. but I dont know how to use it.. or how to build the same..
Regards
Bhargav L Pandya
Bhargav L Pandya -
venerdì 3 febbraio 2012 05:13DAn,,, Pelase help.. NEed this working... this is not working but worrying.. Please tell what is to be done with this script.. If you want i will give you my server on teamviewer.. but please get this working..
Bhargav L Pandya

