Spam Filter ISP Support Forum

  New Posts New Posts RSS Feed - mrtg + logsat
  FAQ FAQ  Forum Search   Register Register  Login Login

mrtg + logsat

 Post Reply Post Reply
Author
eric View Drop Down
Guest Group
Guest Group
Post Options Post Options   Thanks (0) Thanks(0)   Quote eric Quote  Post ReplyReply Direct Link To This Post Topic: mrtg + logsat
    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-

Back to Top
Keizersozay View Drop Down
Guest Group
Guest Group
Post Options Post Options   Thanks (0) Thanks(0)   Quote Keizersozay Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
LogSat View Drop Down
Admin Group
Admin Group
Avatar

Joined: 25 January 2005
Location: United States
Status: Offline
Points: 4106
Post Options Post Options   Thanks (0) Thanks(0)   Quote LogSat Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
eric View Drop Down
Guest Group
Guest Group
Post Options Post Options   Thanks (0) Thanks(0)   Quote eric Quote  Post ReplyReply Direct Link To This Post 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 :-)  ]
Back to Top
eric View Drop Down
Guest Group
Guest Group
Post Options Post Options   Thanks (0) Thanks(0)   Quote eric Quote  Post ReplyReply Direct Link To This Post Posted: 30 November 2003 at 10:25am

the vbscript in the asp page returns these values :

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-

 

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.238 seconds.