PageGate Log Monitor Feature

Top  Previous  Next

PageGate's log monitor feature allows the program to scan through its own log files and trigger certain behaviors based on what you're looking for.

 

Step 1: Create the LogMonitorInfo.txt file in the PageGate Database folder.

 

1)In Windows, browse in to your PageGate Database folder.

1a) To determine its location, open PG Admin and go to Program - Settings

2)Create a new Text Document and name the file: LogMonitorInfo.txt

2a) This file's name and location are very important and the file must be precisely named LogMonitorInfo.txt - make sure your text editor doesn't try to use a custom extension.

3)Open the file for editing.

 

Step 2: Determine what keywords and key phrases to scan for

 

Step 3: Determine which PageGate log(s) you need to scan

 

Step 4: Write the necessary lines in LogMonitorInfo.txt

 

This file is written in a Comma Separated Values format, which means each new line is a record and also that each object in each record will need to be separated by commas.

 

Each line of the file will reference 4 things and in this order:

 

Module,Match,Command,Continue

 

Module 

This will need to reference one of PageGate's executable names, without the extension. 

 

For example, if you want to scan the global log, you would use pagegate. If you want to scan the scheduler log, you would use pgsched.

 

Again, this field needs to reference the file name of one of PageGate's executables, without the extension, and determines which log is being scanned.

 

PGDialX can be used as a module name to apply to all Connector modules.

 

Match

This field is case sensitive and determines what text to search for in the scanned log.

 

Quotes, commas and blackslashes in search terms will need to be expressed as their ASCII value, prefixed by a backslash (\). 

 

Character

ASCII Value

Expression

\

092

\092

"

034

\034

,

044

\044

 

Command

This determines what command should be executed if a match is found and can reference anything that can be called on from a command line. You could run cmd and echo a text file to a specific location as easily as you could execute a powershell script or run a batch file. 

 

The following macros are available for use in the Command value:

%DateTime% - date and time of log message

%Module% - the PG module name

%Message% - the message being logged

 

Continue

This value can be set to True or False. 

 

If set to to True, successive lines in the file will be used. 

 

If set to False, this line will be treated as the last relevant line in the file.

 

Step 5: Cycle the PageGate service to implement new settings

 

Changes to LogMonitorInfo.txt are not recognized in real time and require a service restart of PageGate's connectors. The easiest way to do this is:

1)Open PG Admin on the PageGate server. This cannot be done from a workstation Admin.

2)Right click Connectors and select 'Stop All'.

3)Right click Connectors and select 'Start All'.

 

Examples

 

This is an example that would scan the Connector 1 log file for any failed messages and echo all failed message log lines to c:\temp\failures.txt:

"PGDial1","FAILED", "cmd /c @echo %DateTime% %Module% %Message% >> c:\092temp\092failures.txt", "True"

 

This is an example that would scan all Connector for any instance of traffic being put through PageGate's failover system and execute a batch file that could, among other things, call on a Powershell script:

"PGDialX","Carrier retry limit reached. Redirecting messages", "c:\PageGateData\Scripts\YourBatchFile.bat", "True"