C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

thoughts about how to implement my idea?

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ Language (Moderated)
View previous topic :: View next topic  
Author Message
widox
Guest





PostPosted: Wed Aug 24, 2005 8:01 am    Post subject: thoughts about how to implement my idea? Reply with quote



I am thinking of writing a program that connects to multiple servers
and pulls logs down and parses them, in addition to aggregating all the
info, most likely putting them in a database. I was just wondering
other people's thoughts about the best way to do this.. I initally
wanted it to be all web based, like PHP and Javascript. Because
ultimately I want to be able to access all parsed info from a web
interface. (but I could concievably just write static pages)

On reflection though, I think it may be better to use C++, but I'm not
exactly sure. So any thoughts/ideas whatever would be welcome!


[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Back to top
Maxim Yegorushkin
Guest





PostPosted: Wed Aug 24, 2005 9:31 am    Post subject: Re: thoughts about how to implement my idea? Reply with quote




widox wrote:
Quote:
I am thinking of writing a program that connects to multiple servers
and pulls logs down and parses them, in addition to aggregating all the
info, most likely putting them in a database. I was just wondering
other people's thoughts about the best way to do this.. I initally
wanted it to be all web based, like PHP and Javascript. Because
ultimately I want to be able to access all parsed info from a web
interface. (but I could concievably just write static pages)

On reflection though, I think it may be better to use C++, but I'm not
exactly sure. So any thoughts/ideas whatever would be welcome!

IMO, C++ is not appropriate for the task.

It is usually done using shell scripts using scp for pulling files
down, grep/awk/perl/python for parsing them, RRDtool for logging and
graphing.


[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]


Back to top
tony_in_da_uk@yahoo.co.uk
Guest





PostPosted: Wed Aug 24, 2005 12:47 pm    Post subject: Re: thoughts about how to implement my idea? Reply with quote



I can only agree with Maxim... to do this elegantly in C++ requires
good, easy to use database libraries, high-level TCP libraries, and
regexp or other parsing libraries. Such libraries are available, but
in the end if all you're doing is ferrying data between these libraries
then C++ - while not doing any real harm - isn't adding any real value.

It's easy to use standard tools: there are lots of geturl/scp command
line utilities, expect can be used to automate more primitive tools,
there's cron jobs or the Windoze scheduler etc.. Your database
probably has a graphical query tool, or the ability to publish to web
pages.

Sure, C++ code would likely be a bit more "structured" than most Perl
programmer's code, but hopefully a C++ programmer writing Perl
maintains their sense of good coding style anyway.

Cheers, Tony


[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Back to top
Carlos Moreno
Guest





PostPosted: Wed Aug 24, 2005 2:58 pm    Post subject: Re: thoughts about how to implement my idea? Reply with quote

[email]tony_in_da_uk (AT) yahoo (DOT) co.uk[/email] wrote:

Quote:
a C++ programmer writing Perl

Aren't there international laws against that?! ;-)

(if not, then what the hell is wrong with this world?! Wink)

Carlos
--

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]


Back to top
widox
Guest





PostPosted: Thu Aug 25, 2005 12:09 pm    Post subject: Re: thoughts about how to implement my idea? Reply with quote

{This thread is getting off topic for here -mod}

Maxim Yegorushkin wrote:
Quote:
widox wrote:

I am thinking of writing a program that connects to multiple servers
and pulls logs down and parses them, in addition to aggregating all the
info, most likely putting them in a database. I was just wondering
other people's thoughts about the best way to do this.. I initally
wanted it to be all web based, like PHP and Javascript. Because
ultimately I want to be able to access all parsed info from a web
interface. (but I could concievably just write static pages)

On reflection though, I think it may be better to use C++, but I'm not
exactly sure. So any thoughts/ideas whatever would be welcome!


IMO, C++ is not appropriate for the task.

It is usually done using shell scripts using scp for pulling files
down, grep/awk/perl/python for parsing them, RRDtool for logging and
graphing.



Thanks for these suggestions, and to [email]tony_in_da_uk (AT) yahoo (DOT) co.uk[/email] also.
The task I'm trying to do is actually similar to that of Webalizer. And
it is written in C, so that's where I got the idea of C++.

I never really thought/heard about the other tools that Maxim mentioned.
But Iam going to look into them. The only think I am confused about is
can this be done in all one say perl/python script that runs X times per
day; Gets all the logs, parses, puts in DB writes to HTML? I don't
really want to piece together multiple scripts, just to keep it in one
place.

Thanks.


[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]


Back to top
Tony Delroy
Guest





PostPosted: Thu Aug 25, 2005 11:16 pm    Post subject: Re: thoughts about how to implement my idea? Reply with quote

The moderator's right - 'tis getting off topic. So I'll keep this
brief, and ask that you try a perl, php or python newsgroup afterwards.

You can certainly put it all in one script, though I wouldn't
necessarily recommend it. If you want on-demand HTML pages generated
from the database, you'll probably want a CGI script. I can't see this
script sharing any significant functionality with the code retrieving
and parsing data to update the database, so I'd keep them separate.

I barely know python - having come away from a one-day evaluatation a
couple years ago feeling disappointed. I can confirm that perl is
suited to all the tasks, with the HTML writing being the only one of
these tasks that I can easily see turning into scrappy perl code. PHP
is very C like (which should suit you well), and may be better suited
for a HTML/CGI on-demand database display, though I'm not sure if PHP's
database access libraries are as well designed, portable and easy to
use as perl's. Can't imagine they'd be too bad.

Best of luck, Tony


[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ Language (Moderated) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.