Solved

GFI Faxmaker Queue monitor

Posted on 2008-10-01
12
5,217 Views
Last Modified: 2013-11-15
We need to monitor the Fax Queue for the GFI Faxmaker product.  The vendor does not provide a way to monitor the fax queue unless we use the MMC.  This will not work for us due to the multiple fax servers we have installed.  We would want to be able to monitor the Fax Queue and report any findings to our monitoring software "Big Brother".  We know from the vendor that when a fax is sent or received it saves a file with an extension .sfm to the in or the out directory under the faxmaker directory.  Is there a way to write a script to monitor both directories and if it finds a .sfm file report it? For example if no files are found report no error if 1 or more files are found report an error.
0
Comment
Question by:trcadmin
  • 7
  • 5
12 Comments
 
LVL 2

Expert Comment

by:DSchel01
ID: 22668532
The SFM files are a legacy proprietary format from the earlier versions of FAXmaker from the 90s. Unfortunately these file formats have not yet been upgraded to modern formats such as XML and cannot be read by third party software to the best of my knowledge.

You could use the FAXmaker monitoring script (vbs) included in GFi Network Server Monitor to monitor the health of multiple FAXmaker servers. If there are more than x files in the FAXmaker\in or FAXmaker\out or FAXmaker\out\pending folders an alert can automatically be triggered. This script does not report  information about the fax (i.e. destination number etc) but rather that there were more than x faxes in the queue.
0
 

Author Comment

by:trcadmin
ID: 22670645
Thanks DSCHED01 for putting in the right path.  We are not using the GFi Network Server Monitor product.  I was able to install the evaluation copy and locate the FaxMaker.vbs file but i am not sure how to make run without using the GFi Network Server Monitor product.  The script is below i changed the strFAXmakerServer= to use our servername and uncommented the line.  When i tried to run it nothing happens.



' /////////////////////////////////////////////////////////////////////////////

' This file contains a set of VBScript functions, and can be used

' inside Monitor Rules.

' You can write your own functions and them to this file.

' Use the following guidelines when writing a new function:

'   - The routine must be a Function, not a Sub;

'   - The Function must return True (-1), False (0) or Unknown (1);

'   - Optionally, use the EXPLANATION system variable to add your own

'     explanation to the result of the function;

'   - All variables must be 'dimmed', except EXPLANATION. EXPLANATION is an

'     GFI Network Server Monitor system variable and is already dimmed

'     by the GFI Network Server Monitor service.

'

' Prototype:

'   Function MyFunc( var1, var2, ..., varn )

'       ' Own stuff

'       MyFunc = True  ' or False (0) or Unknown (1)

'       EXPLANATION = "MyFunc returns True"

'   End Function

'

' /////////////////////////////////////////////////////////////////////////////
 

Const retvalUnknown = 1
 

Function GetFAXmaker(strFAXmakerServer, strUsername, strPassword)

On Error Resume Next

 'strFAXmakerServer="FAX1"

strFAXmakerFolder = "\\" & strFAXmakerServer & "\fmserver$" 'FAXmaker path
 

intSinkDropThreshold = 5 'alert when more than x emails in sinkdrop dir.

intInDirThreshold = 4 'alert when more than 4 faxes in FAXmaker\In

intOutDirThreshold = 4 'alert when more than 4 faxes in the FAXmaker\out.

intUndeliverableThreshold = 0 'alert when more than 0 files in the FAXmaker\in\undelverable directory.
 

'no changes to variables need to be made beyond this point.
 

'check services

if (strUsername = "") then	

		'Connect to remote host on same domain using same security context

		Set objWMIService = GetObject("winmgmts:{impersonationLevel=Impersonate}!\\" & strFAXmakerServer &"\root\cimv2")

else	

		'Connect to remote host using different security context and/or different domain 

		Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")

		Set objWMIService = objSWbemLocator.ConnectServer(strFAXmakerServer, "root\cimv2", strUsername, strPassword)

		if (Err.Number <> 0) Then

			GetServicesList = retvalUnknown			

			EXPLANATION = "Unable to access '" & strFAXmakerServer & "'. Possible reasons: no WMI installed on the remote server, no rights to access remote WMI service, or remote server down"

			Exit Function

		End if

		objWMIService.Security_.ImpersonationLevel = 3

end if
 

If (Err.Number <> 0) Then

	GetFAXmaker = retvalUnknown

	EXPLANATION = "Unable to access '" & strFAXmakerServer & "'. Possible reasons: no WMI installed on the remote server, no rights to access remote WMI service, or remote server down" 	

	Exit Function

End If
 

Set colItems = objWMIService.ExecQuery("Select * from Win32_Service where name = 'smtpsvc'",,48)

bRunning = false

For Each objItem in colItems

  if objItem.State = "Running" Then

    bRunning = true

  end If

Next

if not bRunning then 

		GetFAXmaker=False

		EXPLANATION = "Simple Mail Transport Protocol (SMTP) Service is not running."

		Exit Function

end if
 

Set colItems = objWMIService.ExecQuery("Select * from Win32_Service where name = 'FAXmaker Fax Server'",,48)

bRunning = false

For Each objItem in colItems

  if objItem.State = "Running" Then

    bRunning = true

  end If

Next

If not bRunning Then

		GetFAXmaker=False

		EXPLANATION = "GFI FAXmaker Fax Server Service is not running."

		Exit Function

end If 
 

Set colItems = objWMIService.ExecQuery("Select * from Win32_Service where name = 'FAXmaker MTA Service'",,48)

bRunning = false

For Each objItem in colItems

  if objItem.State = "Running" then

    bRunning = true

  end if

Next

If not bRunning Then

		GetFAXmaker=False

		EXPLANATION = "GFI FAXmaker Message Transfer Agent Service is not running."

		Exit Function

end If 
 

'check directory counts

strFAXmakerSinkDrop = strFAXmakerFolder & "\sinkdrop"

strFAXmakerIn = strFAXmakerFolder & "\In"

strFAXmakerOut = strFAXmakerFolder & "\out"

strFAXmakerUndeliverable = strFAXmakerIn & "\undeliverable"
 

funcEcho("Servername=" & strFAXmakerServer)

funcEcho("strFAXmakerIn=" & strFAXmakerIn)

funcEcho("strFAXmakerOut=" & strFAXmakerOut)

funcEcho("strFAXmakerUndeliverable=" & strFAXmakerUndeliverable)

funcEcho("strFAXmakerSinkDrop=" & strFAXmakerSinkDrop)
 

Set objFSO = CreateObject("Scripting.FileSystemObject")

Set objFolder = objFSO.GetFolder(strFAXmakerSinkDrop)

Set colFiles = objFolder.Files
 

GetFAXmaker=False
 

If colFiles.count > intSinkDropThreshold Then

	GetFAXmaker=False

	EXPLANATION = colFiles.count & " (>" & intSinkDropThreshold & ") Files found in SinkDrop directory. Check GFI FAXmaker Message Transfer Agent status."

	Exit Function

End If
 

Set objFolder = objFSO.GetFolder(strFAXmakerIn)

Set colFiles = objFolder.Files
 

filesCount = CountSfmFiles(objFSO, colFiles)

If filesCount > intInDirThreshold Then

	GetFAXmaker = False

	EXPLANATION = filesCount & " (>" & intInDirThreshold & ") Files found in FAXmaker\In directory. Check GFI FAXmaker Message Transfer Agent status."

	Exit Function

End If
 

Set objFolder = objFSO.GetFolder(strFAXmakerOut)

Set colFiles = objFolder.Files
 

filesCount = CountSfmFiles(objFSO, colFiles)

If filesCount > intOutDirThreshold Then

	GetFAXmaker=False

	EXPLANATION = filesCount & " (>" & intOutDirThreshold & ") Files found in FAXmaker\out directory. Check GFI FAXmaker Fax Server status."

	Exit Function

End If
 

Set objFolder = objFSO.GetFolder(strFAXmakerUndeliverable)

Set colFiles = objFolder.Files
 

If colFiles.count > intUndeliverableThreshold Then

	GetFAXmaker=False

	EXPLANATION = colFiles.count & " (>" & intUndeliverableThreshold & ") Files found in FAXmaker\in\undeliverable directory. Check GFI FAXmaker Message Transfer Agent status and SMTP connectivity."

	Exit Function

End If
 

GetFAXmaker=True

EXPLANATION = "FAXmaker status is healthy."
 

End Function
 

Function funcEcho(strLog)

	blnDebug = 0 

	If blnDebug=1 Then

		EXPLANATION =  strLog

	End If

End Function
 

function CountSfmFiles(objFSO, colFiles)

	Dim file, count

	count = 0

	for each file in colFiles	  

		if lCase(objFSO.GetExtensionName(file)) = "sfm" then  

			count = count + 1

		end if

	next

	CountSfmFiles = count

end function

Open in new window

0
 
LVL 2

Expert Comment

by:DSchel01
ID: 22674165
I actually wrote the original version of the FAXmaker VBS script used by Network Server Monitor. The script returns true or false which then triggers the appropriate action in the NSM configuration.

What do you actually want to happen when a check fails?

Daniel
0
 

Author Comment

by:trcadmin
ID: 22677544
Since we are not using the NSM we need this script to work without it.  I believe that the variables are passed to the script via the NSM configuration and the results are passed back from the script to the NSM.  What we need is the full script to run without the need of the NSM.  This script looks like it does what we are looking for but we only need to monitor FAX queues since our monitoing software already monitors the services.
0
 
LVL 2

Expert Comment

by:DSchel01
ID: 22677612
I understand that you are not planning to use Network Server Monitor. I was asking about the action you were after. When the check fails do you want the script to email you, write to a text file? etc.

If you let me know I should be able to customise it quickly for you.

Daniel
0
 

Author Comment

by:trcadmin
ID: 22677810
Sorry i did not understand your question.  We would want to write to a text file to a specified location and specific file name .  Our Big Brother monitoring software would capture this file and post it to our monitoring console.
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 2

Expert Comment

by:DSchel01
ID: 22684354
Attached is an updated version of the script which will write a timestamp  and "Check passed." or "Check failed" to a text file dependant on the result.

I don't have the time at the moment to make the script run for multiple installations, or return a more detailed response, at the moment so you would need to perform further customisation of the script, or run a copy of the script for each FAXmaker server.
FAXmaker-status.txt
0
 

Author Comment

by:trcadmin
ID: 22686161
Thanks, DShel01.

The only attechment included on your response is a txt file with the following text:

10/10/2008 Check passed.
10/10/2008 1:53:10 PM Check passed.
10/10/2008 1:53:25 PM Check passed.
10/10/2008 1:54:30 PM Check passed.
10/10/2008 1:54:38 PM Check passed.
0
 
LVL 2

Accepted Solution

by:
DSchel01 earned 500 total points
ID: 22700046
Sorry, I attached the wrong file.
FAXmaker-Health-Check-to-text.txt
0
 

Author Closing Comment

by:trcadmin
ID: 31502041
Thank you so much for your help.  This was exactly what we were looking for.
0
 

Author Comment

by:trcadmin
ID: 22705204
How can we modify the code so that the log file displays the test failed.  If a test failed display the description line on the log.
0
 

Author Comment

by:trcadmin
ID: 22705228
Sorry display the EXPLANATION line on the log this way we know what failed.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A high-level exploration of how our ever-increasing access to information has changed the way we do our jobs.
In our personal lives, we have well-designed consumer apps to delight us and make even the most complex transactions simple. Many enterprise applications, however, are a bit behind the times. For an enterprise app to be successful in today's tech wo…
This video will demonstrate how to find the puppet warp tool from the edit menu and where to put the points to edit.
Using Adobe Premiere Pro, the viewer will learn how to set up a sequence with proper settings, importing pictures, rendering, and exporting the finished product.

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now