From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 2DF84BC48 for ; Fri, 29 Apr 2005 03:34:16 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j3T1YFmF005170 for ; Fri, 29 Apr 2005 03:34:15 +0200 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id DAA18777 for ; Fri, 29 Apr 2005 03:34:15 +0200 (MET DST) Received: from first.in-berlin.de (dialin-145-254-062-188.arcor-ip.net [145.254.62.188]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j3T1YDHZ015021 for ; Fri, 29 Apr 2005 03:34:14 +0200 Received: by first.in-berlin.de (Postfix, from userid 501) id 7F74FE0329; Fri, 29 Apr 2005 03:20:05 +0200 (CEST) Date: Fri, 29 Apr 2005 03:20:05 +0200 From: Oliver Bandel To: caml-list@inria.fr Subject: Re: [Caml-list] Using Ocaml as wrapper for RRD Message-ID: <20050429012004.GA994@first.in-berlin.de> References: <20050415084931.GA11529@sun.ac.za> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050415084931.GA11529@sun.ac.za> User-Agent: Mutt/1.5.6i X-Miltered: at concorde with ID 42718F17.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 42718F15.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; oliver:01 bandel:01 oliver:01 in-berlin:01 caml-list:01 ocaml:01 spies:01 ocaml:01 wrappers:01 verbose:01 imho:01 bandel:01 spies:01 universiteit:01 stellenbosch:01 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.2 X-Spam-Level: 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