caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Oliver Bandel <oliver@first.in-berlin.de>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Using Ocaml as wrapper for RRD
Date: Fri, 29 Apr 2005 03:20:05 +0200	[thread overview]
Message-ID: <20050429012004.GA994@first.in-berlin.de> (raw)
In-Reply-To: <20050415084931.GA11529@sun.ac.za>


Hello,


On Fri, Apr 15, 2005 at 10:49:31AM +0200, Johann Spies wrote:
> Are there any libraries available to enable Ocaml programs/scripts as
> wrappers for RRD (like those for Python, Perl and PHP)?

Well, not a real general wrapper, but in a program that I wrote and that
I rewrite from scratch to have a more sophisticated functionality, I
also want to add code that creates RRD-tool output.
Maybe it would make sense to do it as a library. But this is not planned
now.


The program I mentioned was a sendmail-loganalyzer and it goes through
a whole sendmail-logfile and creates outputs like these:


========================================================================
SENDMAIL-Log analyzed:
Time duration of entries: Apr 27 10:20:40 -- Apr 28 10:21:22
------------------------------------------------------------------
SENT 35782
RELAYED 572
SPAM 31733
VIRUS 1367
DSN 353
DEFERRED 5
ACCESS_DENIED_RBL 2131
REJECT_BLACKLIST 1653
REJECT_OTHERS 6846
USER_UNKNOWN 534
RETURN_TO_SENDER 27
TIMEOUT 444
ERR_COLLECT 52
DISCARDED 187
INFO_ONLY 10
DID_NOT_ISSUE_MAIL 4474
ETRN 144
MESSAGE_REPEATED 1
========================================================================
SENDMAIL-Log analyzed:
Time duration of entries: Apr 20 12:41:24 -- Apr 21 11:42:35
------------------------------------------------------------------
SENT 28917
RELAYED 508
SPAM 28844
VIRUS 1010
DSN 279
DEFERRED 4
ACCESS_DENIED_RBL 1485
REJECT_BLACKLIST 1355
REJECT_OTHERS 5101
USER_UNKNOWN 1620
RETURN_TO_SENDER 56
TIMEOUT 391
ERR_COLLECT 163
DISCARDED 214
INFO_ONLY 43
DID_NOT_ISSUE_MAIL 3734
___UNKNOWN_TYPE___ : Apr 20 13:25:52 gnu mimedefang[21060]: MIMEDefang-2.48, mi_rd_cmd: read returned -1: Connection rese
t by peer 1
ETRN 138
MESSAGE_REPEATED 1
========================================================================


It is an Ocaml program with some hundreds lines of code (including
many dead code segments and a lot of comments and many empty lines)
which reads in *a complete* sendmail-logfile and throws out the above-like
stuff.

The new version (had started the project, but did not worked on it very often)
of this program will be able to read in the maillogs-files (normally two files,
which will be both read, if the logrotation has renamed the files) and
does it analyze not necessarily as a complete file.... it will be able
to read in the necessary data for time intervalls, so that one can say:
give me the maillogs-data for every 15 minutes or every hours.

And it is intended to then write the results in an rrd-like format,
or maybe even database creation and such stuff will be done by the
program.

Because of the verbose comments in the files and some dead code
eve in this version, the code base has now about 700 lines.
It's not completed, but I can throw out a lot of stuff.

I didn't included the RRD-code right now, so this is something that
will be added late on.

But the rrd-interface is already planned.


Maybe this is not what you are looking for, but you asked for RRDtool and
that is something that is at least intended to use in this sendmai-oganalyzer.


> 
> If not, what would be the recommended route using Ocaml to create
> time-related graphs.

IMHO rrdtool is cool. And if you have a patient way of living (or if
you are interested in sponsoring me ;-)) then your problem will be solved very quickly. :)

Regards,
    Oliver Bandel




> 
> Regards
> Johann
> -- 
> Johann Spies          Telefoon: 021-808 4036
> Informasietegnologie, Universiteit van Stellenbosch
> 
>      "And they questioned Him, saying "...Is it lawful for  
>       us to pay taxes to Caesar, or not? ...And He said to 
>       them "...render to Caesar the things that are  
>       Caesar's, and to God the things that are God's."      
>                       Luke 20:21,22,25 
> 
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs


  reply	other threads:[~2005-04-29  1:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-15  8:49 Johann Spies
2005-04-29  1:20 ` Oliver Bandel [this message]
2005-04-29  9:34   ` [Caml-list] " Johann Spies
2005-04-29 14:46     ` Oliver Bandel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050429012004.GA994@first.in-berlin.de \
    --to=oliver@first.in-berlin.de \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).