Print Page | Close Window

mrtg + logsat

Printed From: LogSat Software
Category: Spam Filter ISP
Forum Name: Spam Filter ISP Support
Forum Description: General support for Spam Filter ISP
URL: https://www.logsat.com/spamfilter/forums/forum_posts.asp?TID=2470
Printed Date: 01 November 2025 at 5:41pm


Topic: mrtg + logsat
Posted By: Guests
Subject: mrtg + logsat
Date Posted: 24 November 2003 at 10:15am

i am currently trying to get mrtg to run with the spamfilter.ini,

is logsat changing the format of the files in the near feauture ?

i am half way now,

if it works (the perl script) i will post a download okay ?

-eric-




Replies:
Posted By: Guests
Date Posted: 26 November 2003 at 11:21am

That would be pretty awsome. If you get it working, please post your info.
.. Just curious, do you use 14all or routers2 to display your web pages?

Thanks



Posted By: LogSat
Date Posted: 28 November 2003 at 2:09pm

Eric,

We do not plan on changing the existing log format for existing entries any time soon. We do however add new logged items from time to time.

Roberto F.
LogSat Software



Posted By: Guests
Date Posted: 30 November 2003 at 10:10am

i am using a perl script as a target in the mrtg.cfg

Target[spamfilter.yourserver.local]: `c:\perl\bin\perl.exe d:\mrtg\logsat.pl`

is processes the spamfilter ini the same way to return values as the

stats asp file from dan.

i am stealing dan`s code, because the values mrtg uses are the same,

rx bytes -> value can be messages forwarded

tx bytes -> value can be messages blocked

that makes it possible...

 

 

the vb code so far : (must follow the perl script mrtg target)

<%
'============================================================
'Functions to parse out a section of the spamfilter.ini file
'============================================================

Function ReadFromIniFile(strFileName,strSection, strKey)

 Dim blnSectionFound: blnSectionFound = False

 Dim blnKeyFound: blnKeyFound = False

 Dim objFSO: Set objFSO = Server.CreateObject ("Scripting.FileSystemObject")

 Dim objTextStream: Set objTextStream = objFSO.OpenTextFile(strFileName)

 Dim strLine
 Dim astrTemp

 Do While Not objTextStream.AtEndOfStream And Not blnSectionFound
   strLine = objTextStream.ReadLine
   If InStr (strLine,"[" & strSection & "]") > 0 Then
     blnSectionFound = True
   End If
 Loop

 Do While Not objTextStream.AtEndOfStream And Not blnKeyFound And blnSectionFound
   strLine = objTextStream.ReadLine
   If Not strLine = vbNullString Then
     If Not InStr (strLine,"[") > 0 And Not InStrRev (strLine,"]") > 0 Then
       astrTemp = Split(strLine,"=")
       If IsArray(astrTemp) Then
         If trim(astrTemp(LBound(astrTemp))) = strKey Then
           blnKeyFound = True
         End If
       End If
     Else
       blnSectionFound = True
      End If
   End If
 Loop

 If blnKeyFound Then
   strValue = astrTemp(UBound(astrTemp))
 End If

 ReadFromIniFile = strValue
End Function

'============================================================

%>

<%Response.Write ReadFromIniFile("SpamFilter.ini","stats","EMailsForwarded:")

<%Response.Write ReadFromIniFile("SpamFilter.ini","stats","EMailsBlocked")

 

i am currently using the net::telnet module but was not yet succesfull with it,

(telnetting to my windows server into the path where spamfilter resides.)

maybe it`s better to pipe the vbscript as a target, in mrtg...on the local server..

thats the current status.

-eric-

 

[ sysadmin / not a programmer :-)  ]


Posted By: Guests
Date Posted: 30 November 2003 at 10:25am

the vbscript in the asp page returns these values :

http://webmail.aquasense.nl/spamstats.asp" CLASS="ASPForums" TITLE="WARNING: URL created by poster. - http://webmail.aquasense.nl/spamstats.asp" CLASS="ASPForums" TITLE="WARNING: URL created by poster. - http://webmail.aquasense.nl/spamstats.asp

these values can be run as a target in mrtg directly so far,

no result yet.

dan : do you want the code first if it works, or am i free to use your code,

and post the howto-mrtg with it ?

-eric-

 




Print Page | Close Window