caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Using Ocaml as wrapper for RRD
@ 2005-04-15  8:49 Johann Spies
  2005-04-29  1:20 ` [Caml-list] " Oliver Bandel
  0 siblings, 1 reply; 4+ messages in thread
From: Johann Spies @ 2005-04-15  8:49 UTC (permalink / raw)
  To: caml-list

Are there any libraries available to enable Ocaml programs/scripts as
wrappers for RRD (like those for Python, Perl and PHP)?

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

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 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] Using Ocaml as wrapper for RRD
  2005-04-15  8:49 Using Ocaml as wrapper for RRD Johann Spies
@ 2005-04-29  1:20 ` Oliver Bandel
  2005-04-29  9:34   ` Johann Spies
  0 siblings, 1 reply; 4+ messages in thread
From: Oliver Bandel @ 2005-04-29  1:20 UTC (permalink / raw)
  To: caml-list


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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] Using Ocaml as wrapper for RRD
  2005-04-29  1:20 ` [Caml-list] " Oliver Bandel
@ 2005-04-29  9:34   ` Johann Spies
  2005-04-29 14:46     ` Oliver Bandel
  0 siblings, 1 reply; 4+ messages in thread
From: Johann Spies @ 2005-04-29  9:34 UTC (permalink / raw)
  To: caml-list, caml-list

Dear Oliver,

On Fri, Apr 29, 2005 at 03:20:05AM +0200, Oliver Bandel wrote:
> 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.
> 

In the mean time I have learnt a bit more about the RRD-libraries of
some languages and it seems to me the only addon (I might be wrong) is
that you can create rrd-graphs on the fly using a cgi.

That is not really what I need.
> 
> The program I mentioned was a sendmail-loganalyzer and it goes through
> a whole sendmail-logfile and creates outputs like these:
> 

This is about what I want to do with exim-related logs.  And it seems
that it is only necessary to create output that can be directed as
input to RRD-commands which will do the rest.
...
> 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. :)

I am a newcomer to RRD and programming is more a hobby than a career
to me.  I will enjoy looking at what you have done to learn from it
and probably use the knowledge to create custom-made tools for my
situation.

As far as the sponsoring is concerned I apologise for my lack of
resources :)

Enjoy your day.

Johann
-- 
Johann Spies          Telefoon: 021-808 4036
Informasietegnologie, Universiteit van Stellenbosch

     "And he said to them all, If any man will come after 
      me, let him deny himself, and take up his cross daily,
      and follow me."          Luke 9:23 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] Using Ocaml as wrapper for RRD
  2005-04-29  9:34   ` Johann Spies
@ 2005-04-29 14:46     ` Oliver Bandel
  0 siblings, 0 replies; 4+ messages in thread
From: Oliver Bandel @ 2005-04-29 14:46 UTC (permalink / raw)
  To: caml-list

On Fri, Apr 29, 2005 at 11:34:56AM +0200, Johann Spies wrote:
> Dear Oliver,
> 
> On Fri, Apr 29, 2005 at 03:20:05AM +0200, Oliver Bandel wrote:
> > 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.
> > 
> 
> In the mean time I have learnt a bit more about the RRD-libraries of
> some languages and it seems to me the only addon (I might be wrong) is
> that you can create rrd-graphs on the fly using a cgi.
> 
> That is not really what I need.

What do you need?


> > 
> > The program I mentioned was a sendmail-loganalyzer and it goes through
> > a whole sendmail-logfile and creates outputs like these:
> > 
> 
> This is about what I want to do with exim-related logs.  And it seems
> that it is only necessary to create output that can be directed as
> input to RRD-commands which will do the rest.

Yes, RRDtool will be used via commandline intefcace, and so it is not much effort
to write data into it. It could also be done via a call tu the function "system"
(in C or OCaml or other languages).


[...]
> > 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. :)
> 
> I am a newcomer to RRD and programming is more a hobby than a career
> to me.

Well, unfortunately that programming is a hobby for me is now the situation
I'm in... looking for a job.


>  I will enjoy looking at what you have done to learn from it
> and probably use the knowledge to create custom-made tools for my
> situation.

Well, it will need some time, because I do not always work on the program
and do a lot of different things.

> 
> As far as the sponsoring is concerned I apologise for my lack of
> resources :)

Well, that situation is the same, when looking at my ressources and
this was the reason to mention the sponsoring. ;-)



> 
> Enjoy your day.

Well, I try.

Do it better. ;-)


Ciao,
   Oliver


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-04-29 14:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-15  8:49 Using Ocaml as wrapper for RRD Johann Spies
2005-04-29  1:20 ` [Caml-list] " Oliver Bandel
2005-04-29  9:34   ` Johann Spies
2005-04-29 14:46     ` Oliver Bandel

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).