v5.3-B167 - LOGs-Is there a documentation?

Use this forum if you have installed hMailServer and want to ask a question related to a production release of hMailServer. Before posting, please read the troubleshooting guide. A large part of all reported issues are already described in detail here.
Post Reply
jr3151006
Normal user
Normal user
Posts: 31
Joined: 2011-02-03 14:57

v5.3-B167 - LOGs-Is there a documentation?

Post by jr3151006 » 2011-09-30 16:36

Hi,

we need import some LOG files to check/create statistics information about traffic/volume. I haven't found som information regard the fiels and type of contents.

Can anyone help me? As I saw all information (TCP, POP, SMTP) resides in the same file but I believe that the fields are different in some cases.

* I will ask as feature request to store the logs in separated files.

tks,

Renato P

rolaids0
Normal user
Normal user
Posts: 150
Joined: 2010-04-27 02:03
Location: Florida
Contact:

Re: v5.3-B167 - LOGs-Is there a documentation?

Post by rolaids0 » 2011-10-01 03:37

See the documentation about stats.

User avatar
mattg
Moderator
Moderator
Posts: 21113
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: v5.3-B167 - LOGs-Is there a documentation?

Post by mattg » 2011-10-02 01:57

I find Doom's log analyser invaluable for tracking specific problems >> http://log.damnation.org.uk/

I use AWStats to give the detail you are after about overall usage stats.
As Rolaids0 says
rolaids0 wrote:See the documentation about stats.
http://www.hmailserver.com/documentatio ... ce_logging
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

jr3151006
Normal user
Normal user
Posts: 31
Joined: 2011-02-03 14:57

Re: v5.3-B167 - LOGs-Is there a documentation?

Post by jr3151006 » 2011-10-02 16:26

Tks guys,

I enabled it righ now.

jr3151006
Normal user
Normal user
Posts: 31
Joined: 2011-02-03 14:57

Re: v5.3-B167 - LOGs-Is there a documentation?

Post by jr3151006 » 2011-10-02 20:37

If somebody need split the log files for review, below is the script (.VBS) that I created for that (the next step I will 'bulk' these to MS-SQL for create some reports).

##########

Code: Select all

Const ForReading=1:Const ForWriting=2:Const ForAppending=8

'Pasta para procurar LOGs
varSMTP_Log_Folder = "D:\BkpTedmail\LOGS"

'Pasta para Salvar LOGs revisados
varSMTP_LogRevisado_Folder = "D:\BkpTedmail\LOGRevisado"

'Arquivo de LOG2 revisados
varFile_LogRevisado1 = varSMTP_LogRevisado_Folder & "\" & "TCP.LOG"
varFile_LogRevisado2 = varSMTP_LogRevisado_Folder & "\" & "SMTPD.LOG"
varFile_LogRevisado3 = varSMTP_LogRevisado_Folder & "\" & "SMTPC.LOG"
varFile_LogRevisado4 = varSMTP_LogRevisado_Folder & "\" & "POP3D.LOG"

'Texto a Procurar
varKeyword1 = "TCPIP"
varKeyword2 = "SMTPD"
varKeyword3 = "SMTPC"
varKeyword4 = "POP3D"

'Dim varLOGCapturado1, varLOGCapturado2, varLOGCapturado3, varLOGCapturado4

varLOGCapturado1 = ""
varLOGCapturado2 = ""
varLOGCapturado3 = ""
varLOGCapturado4 = ""

Function Func_InputaLOG(x,y)
			'Inputa no arquivo de LOG
			Set OutPutFile = objFSO.OpenTextFile (x, ForAppending, True)
			OutPutFile.WriteLine(y)
			OutPutFile.Close
End Function

Function Func_ValidaLOGFile(x)
	'Verifica se existe o arquivo de LOG
	IF (objFSO.FileExists(x)) Then
	Else
		'Se oarquivo de LOG não existe, cria.
		Set objTextFile = objFSO.CreateTextFile(x, True)
			objTextFile.Close
	END IF
End Function 

'Listando Arquivos de Log
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objDir = objFSO.GetFolder(varSMTP_Log_Folder)	
For Each aItem In objDir.Files
	varFile = varSMTP_Log_Folder & "\" & aItem.Name
	'wscript.echo varFile
	
	Set objFile=objFSO.OpenTextFile(varFile,ForReading)
		Do Until objFile.AtEndOfStream
			strLine = replace(objFile.Readline,chr(34),"")
			strLine = replace(strLine,chr(9),";")
			
			'Verifica se a linha tem o texto procurado1
			IF instr(strLine,varKeyword1) THEN
				varLOGCapturado1 = strLine
				
				CALL Func_ValidaLOGFile(varFile_LogRevisado1)			
				CALL Func_InputaLOG(varFile_LogRevisado1,varLOGCapturado1)
				
			ELSE
			END IF
			
			'Verifica se a linha tem o texto procurado2
			IF instr(strLine,varKeyword2) THEN
				varLOGCapturado2 = strLine
				
				CALL Func_ValidaLOGFile(varFile_LogRevisado2)			
				CALL Func_InputaLOG(varFile_LogRevisado2,varLOGCapturado2)
				
			ELSE
			END IF
		
			'Verifica se a linha tem o texto procurado3
			IF instr(strLine,varKeyword3) THEN
				varLOGCapturado3 = strLine
				
				CALL Func_ValidaLOGFile(varFile_LogRevisado3)			
				CALL Func_InputaLOG(varFile_LogRevisado3,varLOGCapturado3)
				
			ELSE
			END IF
			
			'Verifica se a linha tem o texto procurado4
			IF instr(strLine,varKeyword4) THEN
				varLOGCapturado4 = strLine
				
				CALL Func_ValidaLOGFile(varFile_LogRevisado4)			
				CALL Func_InputaLOG(varFile_LogRevisado4,varLOGCapturado4)
				
			ELSE
			END IF
		Loop
	objFile.Close
	objFSO.DeleteFile(varFile)
Next
wscript.echo "Fim do Script"

User avatar
dzekas
Senior user
Senior user
Posts: 2486
Joined: 2005-10-13 21:28
Location: Lithuania

Re: v5.3-B167 - LOGs-Is there a documentation?

Post by dzekas » 2011-10-02 21:58

jr3151006 wrote:If somebody need split the log files for review, below is the script (.VBS) that I created for that (the next step I will 'bulk' these to MS-SQL for create some reports).
Are you sure that VBS does not have basic CSV parser and grep does not exist on Windows?

jr3151006
Normal user
Normal user
Posts: 31
Joined: 2011-02-03 14:57

Re: v5.3-B167 - LOGs-Is there a documentation?

Post by jr3151006 » 2011-10-12 01:10

I´m not sure. I´ll check.

jr3151006
Normal user
Normal user
Posts: 31
Joined: 2011-02-03 14:57

Re: v5.3-B167 - LOGs-Is there a documentation? (BUG???)

Post by jr3151006 » 2011-10-12 01:17

Hi Dev_Team,

I don´t know why, but I found that some error msgs are saved in "ERROR_hmailserver_2011-10-04.log" and some are save in "hmailserver_2011-09-20.log".

Can you review the code for that cases? Bellow are same samples.

ERROR_hmailserver_2011-10-04.log
#######################
"ERROR" 14592 "2011-10-04 10:19:50.806" "Severity: 2 (High), Code: HM5047, Source: File::DeleteFile, Description: Could not delete the file d:\hMailServer\Data\{44D19330-5E4A-47A1-A3B3-082777084B3C}.eml. Tried 5 times without success. Windows error code: 32 (The process cannot access the file because it is being used by another process.)"
hmailserver_2011-09-20.log
##################
ERROR;864;2011-09-24 11:08:49.346;Severity: 3 (Medium), Code: HM4382, Source: SMTPDeliverer::_ApplyForwarding, Description: Could not forward message from alex@xyztecnologia.com.br to paulo.kuhn@xyztecnologia.com.br;vladimir.dorneles@xyztecnologia.com.br;ricardo@xyztecnologia.com.br;anderson.silva@xyztecnologia.com.br. Reason: 550 Unknown user
ERROR;864;2011-09-24 15:02:48.598;Severity: 3 (Medium), Code: HM4382, Source: SMTPDeliverer::_ApplyForwarding, Description: Could not forward message from alex@xyztecnologia.com.br to paulo.kuhn@xyztecnologia.com.br;vladimir.dorneles@xyztecnologia.com.br;ricardo@xyztecnologia.com.br;anderson.silva@xyztecnologia.com.br. Reason: 550 Unknown user

User avatar
dzekas
Senior user
Senior user
Posts: 2486
Joined: 2005-10-13 21:28
Location: Lithuania

Re: v5.3-B167 - LOGs-Is there a documentation?

Post by dzekas » 2011-10-12 06:25

first one is serious application issue as some other app messes up with application data directory

second one is internal application problem caused by account misconfiguration. Somebody setup broken forwarding rule.

They can go into different logs. One indicates system error and other one is basic configuration problem.

User avatar
mattg
Moderator
Moderator
Posts: 21113
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: v5.3-B167 - LOGs-Is there a documentation? (BUG???)

Post by mattg » 2011-10-13 05:31

jr3151006 wrote:ERROR_hmailserver_2011-10-04.log
#######################
"ERROR" 14592 "2011-10-04 10:19:50.806" "Severity: 2 (High), Code: HM5047, Source: File::DeleteFile, Description: Could not delete the file d:\hMailServer\Data\{44D19330-5E4A-47A1-A3B3-082777084B3C}.eml. Tried 5 times without success. Windows error code: 32 (The process cannot access the file because it is being used by another process.)"
dzekas wrote:first one is serious application issue as some other app messes up with application data directory
As Dzekas says some other app is playing with your data.

This is likely to be AntiVirus software on your server.
Did you exclude the hMailserver data directory from AV scanning?
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

Post Reply