You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(19) |
Nov
(34) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(3) |
Feb
(1) |
Mar
(4) |
Apr
(31) |
May
(15) |
Jun
(33) |
Jul
(3) |
Aug
(7) |
Sep
(2) |
Oct
(7) |
Nov
(2) |
Dec
|
2005 |
Jan
|
Feb
(7) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(13) |
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(2) |
Oct
|
Nov
(3) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Friedrich L. <fr...@us...> - 2005-02-06 01:29:38
|
Update of /cvsroot/ipac-ng/ipac-ng In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21313 Modified Files: CHANGELOG Log Message: document latest changes Index: CHANGELOG =================================================================== RCS file: /cvsroot/ipac-ng/ipac-ng/CHANGELOG,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- CHANGELOG 7 Oct 2004 21:16:48 -0000 1.31 +++ CHANGELOG 6 Feb 2005 01:29:29 -0000 1.32 @@ -18,6 +18,9 @@ # Denis O.Philippov <info at linuxcenter dot ru> # Jason Hudgins <thanatos_101 at yahoo dot com> # Mark Wormgoor.com <mark at wormgoor dot com> +# xavier <list.ipac-ng-developer at natch dot dyndns dot org> +# Afanasyev Nikolay <ikto at users dot sourceforge dot net> +# Robert Evert <crimofbai at web dot de> # known problem(s): @@ -26,7 +29,13 @@ * duplicate tickmarks in generated images can happen, this is caused by rounding - no fix yet * with storage backend "gdbm" DO NOT call fetchipac twice in the - same second or you database will be destroyed - no fix yet + same second or your database will be destroyed - no fix, other than + removing support for gdbm, yet + +1.32 +- added new options "--png-sort-by-bytes" and "--png-sort-by-pkts" (friedl/xavier) +- invmatch patch added to contrib (friedl/Afanasyev Nikolay) +- addsql alpha added to contrib (friedl/Robert Evert) 1.31 - force -H/-hostname when -r/--replace is used as option to ipacsum (friedl/Mark Wormgoor) |
From: Friedrich L. <fr...@us...> - 2005-02-06 01:22:51
|
Update of /cvsroot/ipac-ng/ipac-ng/contrib/ipac-ng_addsql In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20053 Added Files: README USAGE addsql Log Message: added addsql alpha contributed by Robert Evert <crimofbai AT web DOT de> to contrib --- NEW FILE: USAGE --- How to use Robert's sqladd Script: if you are unexperienced, use a local Database and use a Default Install of MySQL with no password for root, you could simply run "./addsql --add" and the entries and config Options will be set. In such a case it could be helpful to set the "bind = localhost" directive in the mysqld section of your my.cnf. if you are more experienced and would like to specifiy things, try "./addsql --help" if you are experienced and ask yourself "why" go away :-P --- NEW FILE: addsql --- #!/bin/bash # MySQL add User & Databases for ipac-ng # created fast by robert ## Possibly its needed to modify the Path to the ipac.conf conf=/etc/ipac-ng/ipac.conf # come out mysql ;) meisql=`which mysql` while [ "$#" -gt 0 ] ; do case $1 in --add) add=0 shift ;; -p) pw=$2 shift shift ;; -u) user=$2 shift shift ;; -db) dbname=$2 shift shift ;; --mysqluser) mysqluser=$2 shift shift ;; --mysqlpw) mysqlpw=$2 shift shift ;; -R) reverse=0 shift ;; --help) echo -e "Add MySQL entries for ipac-ng 1.31 \n Usage: \n \ --help - Display this message ;) \n \ --add - Tells the Script to really Install ipac-ng with Mysql \n \ -u - the User for the DataBase \n \ -p - the Password for the User \n \ -db - the Name of the Database \n \ --mysqluser - an MySQL User that is allowed to create Users and Databases \n \ --mysqlpw - the Password for that user, a prompt is not yet supported \n \ -R - Reverse all Actions. This deletes the ipac-ng MySQL Database, User and sets the Config back to the Old. In this Version you have to use all the Options you used when creating." exit ;; *) echo "Usage: $0 (--help) (--add [IMPORTANT] ) (-u user) (-p password) (-db DBNAME) (--mysqluser MYSQLUSER) (--mysqlpw MYSQLPASSWORD) (-R)" exit ;; esac done # test some things and set them to default values if they are not present # set to ipac5 for home testing if [ ! $user ] ; then user=ipac5 fi if [ ! $dbname ] ; then dbname=ipac5 fi if [ ! $pw ] ; then pw=ipac fi if [ $mysqluser ] ; then a='-u' else a='' fi if [ $mysqlpw ] ; then b='-p' else b='' fi ################ for removing the database if [ "$reverse" = "0" ] ; then echo "You've got 10 secs to abort with ctr-c, otherwise the ipac DBs will be erased!" sleep 10 $meisql $a $mysqluser $b$mysqlpw << EOF DROP DATABASE $dbname ; use mysql; DELETE FROM user WHERE User = '$user' AND Host = 'localhost'; DELETE FROM db WHERE User = '$user' AND Host = 'localhost'; DELETE FROM tables_priv WHERE User = '$user' AND Host = 'localhost'; DELETE FROM columns_priv WHERE User = '$user' AND Host = 'localhost'; EOF mv $conf.old $conf exit 0 else ############# ADD the User and the Database! if [ "$add" = "0" ] ; then $meisql $a $mysqluser $b$mysqlpw << EOF GRANT SELECT , INSERT , UPDATE , DELETE , FILE ON $dbname . * TO "$user"@"localhost"IDENTIFIED BY "$pw"; CREATE DATABASE $dbname ; use $dbname CREATE TABLE logs ( that_time bigint(20) NOT NULL default '0', rule_name varchar(128) NOT NULL default '', bytes bigint(20) default NULL, pkts bigint(20) default NULL, hostname varchar(64) default NULL, PRIMARY KEY (that_time,rule_name) ) TYPE=MyISAM; EOF if [ ! `whoami` = root ] ; then echo "You shall be root edit the config!" else test -f $conf if [ $? -eq 0 ] ; then cp $conf $conf.old sed s/"storage =.*"/"storage = mysql"/g < $conf > $conf.temp sed s/"db name =.*"/"db name = $dbname"/g < $conf.temp > $conf sed s/"db user =.*"/"db user = $user"/g < $conf > $conf.temp sed s/"db pass =.*"/"db pass = \"$pw\""/g < $conf.temp > $conf else echo "Couldn't find ipac-ng Config File, maybe you didn't properly edited the first 3rd line of this Script or didn't used something like the Standard Config?" fi fi else echo "Usage: $0 (--help) (--add [IMPORTANT]) (-u user) (-p password) (-db DBNAME) (--mysqluser MYSQLUSER) (--mysqlpw MYSQLPASSWORD) (-R)" fi fi --- NEW FILE: README --- addmysql for ipac-ng Version Alpha 3 Germany, 24.10.2004 written by Robert This Script wants to create the neccessary MySQL entries that are needed for ipac-ng to work properly. It takes several arguments, get a full list with "addsql --help" It's a very early Version, TEST IT AT YOUR OWN RISK! I tested it with ipac-ng Version 1.31 and MySQL mysql-3.23.44, yeah it IS really old, I'll upgrade when I've got time. Features: Alpha 3: -wants to be Newbie friendly, needs no arguments to create a full functional DB -Creates a User in MySQL, a Database and a table in ipac-ng scheme -tries to set up the Config for mysql and the given User, DB and password -has a Reverse function that reverses (deletes) the given values and puts the old Config back Suggestions, Ideas, Spam? ver...@gm... ! |
From: Friedrich L. <fr...@us...> - 2005-02-06 01:21:16
|
Update of /cvsroot/ipac-ng/ipac-ng/contrib/ipac-ng_addsql In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19887/ipac-ng_addsql Log Message: Directory /cvsroot/ipac-ng/ipac-ng/contrib/ipac-ng_addsql added to the repository |
From: Friedrich L. <fr...@us...> - 2005-02-06 01:17:45
|
Update of /cvsroot/ipac-ng/ipac-ng/contrib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18923 Added Files: invmatch.diff Log Message: patch contributed by Afanasyev Nikolay <ikto AT users DOT sourceforge DOT net> not tested yet so I put it into contrib to not loose it (friedl) --- NEW FILE: invmatch.diff --- --- conffile.l Fri Nov 14 22:51:29 2003 +++ conffile.l Wed Dec 22 16:35:04 2004 @@ -21,7 +21,7 @@ <par>[ \t]+ /* Eat */ ; <par>yes|true BEGIN(0); conflval.n = 1; return BOOL; <par>no|false BEGIN(0); conflval.n = 0; return BOOL; -<par>[[:alnum:]\/\-\.]+|[ \t]*\n BEGIN(0); conflval.s = (char *) strdup(conftext); confline++; return PARAMETER; +<par>[[:alnum:]\/\-\.\!]+|[ \t]*\n BEGIN(0); conflval.s = (char *) strdup(conftext); confline++; return PARAMETER; "access"[ \t]+"agent" return ACCESS; "account"[ \t]+"agent" return ACCOUNT; "hostname" return HOSTNAME; |
From: Friedrich L. <fr...@us...> - 2005-02-06 00:35:14
|
Update of /cvsroot/ipac-ng/ipac-ng In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10230 Modified Files: ipacsum Log Message: applied ipacsum.sorting.patch by xavier <list.ipac-ng-developer AT natch DOT dyndns DOT org> BUT the option --png-sort-by-max has been dropped as it doesn't seem to work as expected Index: ipacsum =================================================================== RCS file: /cvsroot/ipac-ng/ipac-ng/ipacsum,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- ipacsum 7 Oct 2004 21:42:16 -0000 1.17 +++ ipacsum 6 Feb 2005 00:35:04 -0000 1.18 @@ -140,6 +140,8 @@ $png_normalized = 1; # normalize png: show bps (not b per # graph_interval) $png_caption_in_index = 0; # make max: and Average: in html index file +$png_sort_by_bytes = 0; # no sorting by default +$png_sort_by_pkts = 0; # no sorting by default $png_no_average = 0; # dont draw dotted horizontal line with average $png_asis = 0; # create 'asis' files (apache) $png_average_curve = 0; # create 'average on n dots around' line @@ -231,6 +233,8 @@ "png-average-curve=i" =>\$png_average_curve, "png-no-average" => \$png_no_average, "png-caption-in-index"=>\$png_caption_in_index, + "png-sort-by-bytes" => \$png_sort_by_bytes, + "png-sort-by-pkts" => \$png_sort_by_pkts, "png-height=i" => \$png_height, "png-index:s" => \$png_index, "png-normalize=i"=> \$png_normalized, @@ -436,6 +440,8 @@ &read_data; @rules_presorted = sort keys %rulenames; +@rules_presorted = sort { $bytes{$b} <=> $bytes{$a} } keys %rulenames if $png_sort_by_bytes; +@rules_presorted = sort { $pkts{$b} <=> $pkts{$a} } keys %rulenames if $png_sort_by_pkts; foreach (@rules_presorted) { if (/$rule_regex/ && !($opt_z && $bytes{$_} eq "0")) { push @rules_sorted, $_; |
From: Friedrich L. <fr...@us...> - 2005-02-06 00:24:39
|
Update of /cvsroot/ipac-ng/ipac-ng In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8043 Modified Files: .ignore Log Message: ignore one unfinished file Index: .ignore =================================================================== RCS file: /cvsroot/ipac-ng/ipac-ng/.ignore,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- .ignore 27 Jun 2004 19:46:07 -0000 1.3 +++ .ignore 6 Feb 2005 00:24:27 -0000 1.4 @@ -16,3 +16,4 @@ DEADJOE CVS out +doc/postgres.txt |
From: Friedrich L. <fr...@us...> - 2004-11-07 18:38:07
|
Update of /cvsroot/ipac-ng/ipac-ng/contrib/crunch In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24557 Added Files: collecting-data.eml crunch.pl Log Message: contribution by Matthias Lendholt <matthias dot lendholt at gmx dot de> --- NEW FILE: collecting-data.eml --- From: "Matthias Lendholt" <matthias dot lendholt at gmx dot de> To: <ipa...@li...> Subject: [Ipac-ng-common] collecting data of /var/lib/ipac Sender: ipa...@li... Errors-To: ipa...@li... Reply-To: ipa...@li... List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum=ipac-ng-common> Date: Sat, 6 Nov 2004 11:07:17 +0100 I'm using ipac without a database and it stores all the data in /var/lib/ipac. ipacsum creates one image per flow/rule and since I wanted one image with all flows included, I wrote a perl script which collects the data of /var/lib/ipac and creates a csv file. I don't know it something like that exists anywhere but if someone is interested... Matthias -- Gaéð á wyrd swá hío scel! ------------------------------------------------------- This SF.Net email is sponsored by: Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux. http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click _______________________________________________ Ipac-ng-common mailing list Ipa...@li... https://lists.sourceforge.net/lists/listinfo/ipac-ng-common --- NEW FILE: crunch.pl --- #!/usr/bin/perl ################################################## # written by Matthias Lendholt (Berlin, Germany) # last changed on 20041107 ################################################## # This script collects all data of /var/lib/ipac and creates an csv file for # further processing. I wrote it to create a diagram with all flows in one # image (ipacsum creates one image per flow). # Since I used it to measure values in a short time, this script only works # correctly if the interval between two measurments is not larger than 60s. # (You can correct this quite easily I think...) # The output is generated in a csv file (well, semicolon separated file) # named out.ccv in your actual working directory. # The script opens all files of the mentioned directory and assumes that # the order is correct. It calculates the interval from the file names # and as a result you will get kilo byte / second. If you don't want this, # just delete the "/1024" somewhere below. # Finally, the result is in XXXX,YY format not XXXXX.YY ... German format :) use strict; my @data=(); # collects all data my %columns; # collects all column names my $last=undef; my $count=0; open(OUT,">out.csv") or print "Could not open out.csv\n"; opendir(DIR,"/var/lib/ipac") or print "Can not open directory /var/lib/ipac.\n"; while (defined(my $file=readdir(DIR))){ next if $file=~/^\.\.?$/; my $check=0; my @names=(); my @values=(); my $diff=1; if (defined $last){ # just check seconds, no check if more than one minute has gone my $a=$last; my $b=$file; $a=~s/^.*?(\d\d)$/$1/; $b=~s/^.*?(\d\d)$/$1/; if ($a>$b){ $diff=60-$a+$b; }else{ $diff=$b-$a; } } open(TEMP, "</var/lib/ipac/$file") or print "Could not open $file.\n"; while (<TEMP>){ chomp; if (/^#-#-#-#-#/){ $check=1; next; } unless ($check){ $columns{$_}=1; push @names,$_; }else{ /^\d+ (\d+)$/; my $temp=$1/$diff; $temp=$temp/1024; $temp=~s/\./,/; push @values,$temp; } } for (my $j=0;$j<$diff;$j++){ for (my $i=0;$i<@names;$i++){ $data[$count]->{$names[$i]}=$values[$i]; } $count++; #print "$count \n"; } $last=$file; } closedir(DIR); my @cols=(); for my $column(keys %columns){ push @cols,$column; } open(OUT,">out.csv") or die "Could not open out.csv\n"; print OUT "TIMESTAMP"; for my $column(@cols){ print OUT ";$column"; } print OUT "\n"; for (my $row=0;$row<@data;$row++){ print OUT $row; for my $column(@cols){ if (defined $data[$row]->{$column}){ print OUT ";".$data[$row]->{$column}; }else{ print OUT ";0"; } } print OUT "\n"; } close (OUT); |
From: Friedrich L. <fr...@us...> - 2004-11-07 16:26:47
|
Update of /cvsroot/ipac-ng/ipac-ng/contrib/crunch In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28187/crunch Log Message: Directory /cvsroot/ipac-ng/ipac-ng/contrib/crunch added to the repository |
From: Friedrich L. <fr...@us...> - 2004-10-07 21:42:27
|
Update of /cvsroot/ipac-ng/ipac-ng In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7535 Modified Files: ipacsum Log Message: corrected a typo Index: ipacsum =================================================================== RCS file: /cvsroot/ipac-ng/ipac-ng/ipacsum,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- ipacsum 7 Oct 2004 21:13:59 -0000 1.16 +++ ipacsum 7 Oct 2004 21:42:16 -0000 1.17 @@ -1659,7 +1659,7 @@ # find the power of 2 which is closest to $mat. for ($x = 1; $x < $mat; $x *= 2) {}; - if ($x-$mat < $mat-($x/2))) { + if ($x-$mat < $mat-($x/2)) { $mat = $x; } else { $mat = $x/2; |
From: Friedrich L. <fr...@us...> - 2004-10-07 21:16:57
|
Update of /cvsroot/ipac-ng/ipac-ng In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv606 Modified Files: CHANGELOG Log Message: document latest changes Index: CHANGELOG =================================================================== RCS file: /cvsroot/ipac-ng/ipac-ng/CHANGELOG,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- CHANGELOG 24 Aug 2004 18:38:56 -0000 1.30 +++ CHANGELOG 7 Oct 2004 21:16:48 -0000 1.31 @@ -16,6 +16,8 @@ # Thomas Zehetbauer <thomasz at hostmaster dot org> # Simon Hausman <simon at lst dot de> # Denis O.Philippov <info at linuxcenter dot ru> +# Jason Hudgins <thanatos_101 at yahoo dot com> +# Mark Wormgoor.com <mark at wormgoor dot com> # known problem(s): @@ -25,9 +27,15 @@ is caused by rounding - no fix yet * with storage backend "gdbm" DO NOT call fetchipac twice in the same second or you database will be destroyed - no fix yet - * -r/--replace option of ipacsum needs options -H/--hostname 1.31 +- force -H/-hostname when -r/--replace is used as option to ipacsum (friedl/Mark Wormgoor) +- mysql with fixed when port not specified in ipac.conf (friedl) +- documented the fact that '_' breaks configfile parser and is therefore + not allowed in the database connection information (friedl) +- improved upgrade procedure for version<1.27 (friedl) +- mysql table definition file added to doc/ (friedl) +- added patch to fix problem in ipacsum with big numbers (friedl + Jason Hudgins) - added mysql support (friedl/Denis O.Philippov) - changed some error messages to be different when they apply in different situations |
From: Friedrich L. <fr...@us...> - 2004-10-07 21:14:12
|
Update of /cvsroot/ipac-ng/ipac-ng In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32073 Modified Files: ipacsum Log Message: force -H/--hostname when -r/--replace is specified Index: ipacsum =================================================================== RCS file: /cvsroot/ipac-ng/ipac-ng/ipacsum,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- ipacsum 7 Oct 2004 20:59:45 -0000 1.15 +++ ipacsum 7 Oct 2004 21:13:59 -0000 1.16 @@ -288,7 +288,13 @@ $exact = 1 if ($opt_x || $opt_x); -$replace = 1 if ($opt_r || $opt_r); +if ($opt_r || $opt_r) { + if (! defined($hname)) { + warn "Specifiying -r/--replace requires -H or --hostname.\n"; + &usage; + } + $replace = 1; +} $graph = 1 if ($opt_g || $opt_g); $opt_png = $opt_gif if (defined($opt_gif)); @@ -1798,6 +1804,7 @@ --help, -h Print this help --replace, -r replace all summarized accounting files by one. file name will be according to end time + Note: this option requires the --hostname option! --dir d, -d d specify directory containing the accounting data --show-run-progression while running, show number of input files + progression $image_TYPE image creation options: Type $me --help --$image_type for help. |
From: Friedrich L. <fr...@us...> - 2004-10-07 20:59:56
|
Update of /cvsroot/ipac-ng/ipac-ng In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28111 Modified Files: ipacsum Log Message: Jason Hudgins <thanatos_101 at yahoo dot com> reports: $x is an integer and left shifting it forces it to remain an integer. if $mat is a sufficiently big floating point number, then $x is NEVER goint to get bigger than $mat (because it will rollover MAXINT). Unfortunately I didn't notice this until after my server load was at 75+ because I had a bunch of cronjobs hard spinning on this single line of code. Index: ipacsum =================================================================== RCS file: /cvsroot/ipac-ng/ipac-ng/ipacsum,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- ipacsum 28 Jun 2004 15:47:24 -0000 1.14 +++ ipacsum 7 Oct 2004 20:59:45 -0000 1.15 @@ -1651,13 +1651,12 @@ return 1 if (! $max || ! $want_separators); $mat = int($max / $want_separators + 0.5); - # find the power of 2 which is most close to $mat. - for ($x = 1; $x < $mat; $x <<= 1) {}; - if ($x-$mat < $mat-($x>>1)) { + # find the power of 2 which is closest to $mat. + for ($x = 1; $x < $mat; $x *= 2) {}; + if ($x-$mat < $mat-($x/2))) { $mat = $x; - } - else { - $mat = $x >> 1; + } else { + $mat = $x/2; } $mat ? $mat : 1; } |
From: Friedrich L. <fr...@us...> - 2004-10-07 20:53:35
|
Update of /cvsroot/ipac-ng/ipac-ng/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26538 Added Files: mysql-db.sql Log Message: mysql database definition added --- NEW FILE: mysql-db.sql --- -- MySQL dump 9.11 -- -- Host: localhost Database: ipac -- ------------------------------------------------------ -- Server version 4.0.20-standard-log -- -- Table structure for table `logs` -- CREATE TABLE logs ( that_time bigint(20) NOT NULL default '0', rule_name varchar(128) NOT NULL default '', bytes bigint(20) default NULL, pkts bigint(20) default NULL, hostname varchar(64) default NULL, PRIMARY KEY (that_time,rule_name) ) TYPE=MyISAM; |
From: Friedrich L. <fr...@us...> - 2004-10-07 20:52:02
|
Update of /cvsroot/ipac-ng/ipac-ng/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25859 Modified Files: UPDATE-from-version-before-1.27 Log Message: optimized update procedure Index: UPDATE-from-version-before-1.27 =================================================================== RCS file: /cvsroot/ipac-ng/ipac-ng/doc/UPDATE-from-version-before-1.27,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- UPDATE-from-version-before-1.27 11 Apr 2004 20:50:56 -0000 1.1 +++ UPDATE-from-version-before-1.27 7 Oct 2004 20:51:52 -0000 1.2 @@ -1,14 +1,27 @@ -UPDATE from ipac-ng before version 1.27 -======================================= +UPDATING a postgres database from ipac-ng before version 1.27 +============================================================= -From version 1.27 one the postgres database structure has changed +With version 1.27 the postgres database structure has been changed a little. There is now one more field named 'hostname'. -To do the changes manually run: +To do the changes manually run the postgres interactive terminal + psql -U ipac ipac - psql ipac - alter table logs add hostname character varying(256); +There enter the following commands listed + + DROP INDEX "logs_rule"; + DROP INDEX "logs_rule_time"; + DROP INDEX "logs_time"; + alter table logs add hostname character varying(32); + update logs SET hostname = 'router'; + CREATE INDEX "logs_rule" ON "logs" ("rule_name"); + CREATE UNIQUE INDEX "logs_rule_time" ON "logs" ("rule_name", "that_time"); + CREATE INDEX "logs_time" ON "logs" ("that_time"); + +Replace 'router' with the hostname of your host. Take into account to increase +the size of the hostname field from 32 to something bigger if your host's +hostname is longer than 31 characters. Check the output of the "hostname" command. It might also be good to install phpPgAdmin - http://phppgadmin.sourceforge.net/ as it is quite a good webfrontend to your postgres database. |
From: Friedrich L. <fr...@us...> - 2004-10-07 20:48:34
|
Update of /cvsroot/ipac-ng/ipac-ng/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25132 Modified Files: tips-and-tricks Log Message: added invocation of make command Index: tips-and-tricks =================================================================== RCS file: /cvsroot/ipac-ng/ipac-ng/doc/tips-and-tricks,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- tips-and-tricks 9 May 2004 02:46:32 -0000 1.4 +++ tips-and-tricks 7 Oct 2004 20:48:25 -0000 1.5 @@ -6,6 +6,7 @@ ./configure --prefix=${PWD%/*} --sbindir='${exec_prefix}'/${PWD##*/} --with-confdir=${PWD}/ipac-ng mkdir ipac-ng + make Don't forget to put the config files in ./ipac-ng not in /etc/ipac-ng! @@ -21,6 +22,7 @@ A: Run the following configure command (add other options if needed): ./configure --prefix=${PWD%/*} --sbindir='${exec_prefix}'/${PWD##*/} + make You can now run fetchipac and ipacsum by calling them via "./fetchipac" and "./ipacsum" respectively. |
From: Friedrich L. <fr...@us...> - 2004-09-26 16:17:34
|
Update of /cvsroot/ipac-ng/ipac-ng/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22481/doc Modified Files: ipac.conf.sample Log Message: document the fact that '_' in some parameters is not allowed Index: ipac.conf.sample =================================================================== RCS file: /cvsroot/ipac-ng/ipac-ng/doc/ipac.conf.sample,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ipac.conf.sample 29 Jun 2004 23:32:40 -0000 1.2 +++ ipac.conf.sample 26 Sep 2004 16:17:19 -0000 1.3 @@ -15,10 +15,11 @@ drop zero lines = yes ## This parameters controls database location -## left blank 'db host', 'db port' for local database +## 'db host', 'db port' can be left blank for a local database ## as now, both databasess (access and storage) configured by these parameters #db host = localhost #db port = 5432 +## ATTENTION: no underscore '_' in the following parameters allowed! db name = ipac db user = ipac db pass = "XXXXXXXX" |
From: Friedrich L. <fr...@us...> - 2004-09-26 16:16:53
|
Update of /cvsroot/ipac-ng/ipac-ng/storage/mysql In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22234/storage/mysql Modified Files: mysql.c Log Message: fix segfault when "db port" was not specified in the config file Index: mysql.c =================================================================== RCS file: /cvsroot/ipac-ng/ipac-ng/storage/mysql/mysql.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- mysql.c 24 Aug 2004 18:38:57 -0000 1.3 +++ mysql.c 26 Sep 2004 16:16:30 -0000 1.4 @@ -60,6 +60,7 @@ { sql_stor_open(); mysql_init(&conn); + if (!dbport) dbport="0"; if ( !mysql_real_connect(&conn, dbhost, dbuser, dbpass, dbname, atoi(dbport), NULL, 0) ) { fprintf(stderr, "Connection to database '%s' failed.\n", dbname); |
From: Friedrich L. <fr...@us...> - 2004-08-24 18:39:09
|
Update of /cvsroot/ipac-ng/ipac-ng In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6391 Modified Files: fetchipac.c CHANGELOG configure configure.in fetchipac.8 Log Message: added mysql backend contributed by Denis O.Philippov Index: fetchipac.c =================================================================== RCS file: /cvsroot/ipac-ng/ipac-ng/fetchipac.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- fetchipac.c 27 Jun 2004 22:08:54 -0000 1.19 +++ fetchipac.c 24 Aug 2004 18:38:56 -0000 1.20 @@ -455,7 +455,10 @@ /* free memory FIXME: in the future all backends should clear it's data at store_close() time */ - if (strcmp(storage_method->name, "postgre") && strcmp(storage_method->name, "sqlite") && (n>0)) + if (strcmp(storage_method->name, "postgre") + && strcmp(storage_method->name, "sqlite") + && strcmp(storage_method->name, "mysql") + && (n>0)) /* only for storage backends that don't already do free their own data we have to do it now */ free_data_record_type_array(dr, n); Index: CHANGELOG =================================================================== RCS file: /cvsroot/ipac-ng/ipac-ng/CHANGELOG,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- CHANGELOG 24 Aug 2004 17:19:10 -0000 1.29 +++ CHANGELOG 24 Aug 2004 18:38:56 -0000 1.30 @@ -15,6 +15,7 @@ # contributors: # Thomas Zehetbauer <thomasz at hostmaster dot org> # Simon Hausman <simon at lst dot de> +# Denis O.Philippov <info at linuxcenter dot ru> # known problem(s): @@ -27,6 +28,9 @@ * -r/--replace option of ipacsum needs options -H/--hostname 1.31 +- added mysql support (friedl/Denis O.Philippov) +- changed some error messages to be different when they apply + in different situations 1.30 - fixed a bug when running "fetchipac -Svv" (friedl) Index: configure =================================================================== RCS file: /cvsroot/ipac-ng/ipac-ng/configure,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- configure 27 Jun 2004 16:13:25 -0000 1.14 +++ configure 24 Aug 2004 18:38:56 -0000 1.15 @@ -4139,6 +4139,70 @@ support for optional storage \"gdbm\" will be disabled" >&5 echo "$as_me: WARNING: gdbm library not found! support for optional storage \"gdbm\" will be disabled" >&2;} +echo "$as_me:$LINENO: checking for mysql_query in -lmysqlclient" >&5 +echo $ECHO_N "checking for mysql_query in -lmysqlclient... $ECHO_C" >&6 +if test "${ac_cv_lib_mysqlclient_mysql_query+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lmysqlclient $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char mysql_query (); +int +main () +{ +mysql_query (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_mysqlclient_mysql_query=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_mysqlclient_mysql_query=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_mysqlclient_mysql_query" >&5 +echo "${ECHO_T}$ac_cv_lib_mysqlclient_mysql_query" >&6 +if test $ac_cv_lib_mysqlclient_mysql_query = yes; then + HAVE_LIBMYSQL=yes +else + HAVE_LIBMYSQL=no +fi + + test $HAVE_LIBMYSQL = no && { echo "$as_me:$LINENO: WARNING: mysql library not found! + support for optional storage \"mysql\" will be disabled" >&5 +echo "$as_me: WARNING: mysql library not found! + support for optional storage \"mysql\" will be disabled" >&2;} echo "$as_me:$LINENO: checking for sqlite_get_table in -lsqlite" >&5 echo $ECHO_N "checking for sqlite_get_table in -lsqlite... $ECHO_C" >&6 if test "${ac_cv_lib_sqlite_sqlite_get_table+set}" = set; then @@ -4586,6 +4650,161 @@ fi fi +HAVE_MYSQL=no +if test $HAVE_LIBMYSQL = yes; then + +for ac_header in mysql/mysql.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug...@gn.... ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; + no:yes ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug...@gn.... ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + HAVE_MYSQL=yes +else + HAVE_MYSQL=no +fi + +done + + + if test $HAVE_MYSQL = no; then + { echo "$as_me:$LINENO: WARNING: mysql include file mysql.h not found! + support for storage \"mysql\" will be disabled" >&5 +echo "$as_me: WARNING: mysql include file mysql.h not found! + support for storage \"mysql\" will be disabled" >&2;} + fi +fi + HAVE_SQLITE=no if test $HAVE_LIBSQLITE = yes; then @@ -4828,6 +5047,13 @@ fi fi + if test $sm = mysql; then + if test $HAVE_MYSQL = no; then + STORAGEMETHODS=`echo $STORAGEMETHODS|sed -e 's/mysql \?//'` + continue + fi + fi + if test $sm = sqlite; then if test $HAVE_SQLITE = no; then STORAGEMETHODS=`echo $STORAGEMETHODS|sed -e 's/sqlite \?//'` Index: fetchipac.8 =================================================================== RCS file: /cvsroot/ipac-ng/ipac-ng/fetchipac.8,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- fetchipac.8 28 Jun 2004 15:47:24 -0000 1.8 +++ fetchipac.8 24 Aug 2004 18:38:56 -0000 1.9 @@ -64,7 +64,7 @@ .IR methods . The storage methods provided are: .\" =()<.I @<STORAGEMETHODS>@.>()= -.I gdbm sqlite plain-file postgre . +.I gdbm mysql sqlite plain-file postgre . The default storage method used is .\" =()<.IR @<DEFAULT_STORAGE>@.>()= .IR gdbm. Index: configure.in =================================================================== RCS file: /cvsroot/ipac-ng/ipac-ng/configure.in,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- configure.in 27 Jun 2004 16:13:26 -0000 1.14 +++ configure.in 24 Aug 2004 18:38:56 -0000 1.15 @@ -89,6 +89,9 @@ AC_CHECK_LIB(gdbm, gdbm_open, [HAVE_LIBGDBM=yes], [HAVE_LIBGDBM=no]) test $HAVE_LIBGDBM = no && AC_MSG_WARN([gdbm library not found! support for optional storage \"gdbm\" will be disabled]) +AC_CHECK_LIB(mysqlclient, mysql_query, [HAVE_LIBMYSQL=yes], [HAVE_LIBMYSQL=no]) + test $HAVE_LIBMYSQL = no && AC_MSG_WARN([mysql library not found! + support for optional storage \"mysql\" will be disabled]) AC_CHECK_LIB(sqlite, sqlite_get_table, [HAVE_LIBSQLITE=yes], [HAVE_LIBSQLITE=no]) test $HAVE_LIBSQLITE = no && AC_MSG_WARN([sqlite library not found! support for optional storage \"sqlite\" will be disabled]) @@ -122,6 +125,16 @@ fi fi +HAVE_MYSQL=no +if test $HAVE_LIBMYSQL = yes; then + AC_CHECK_HEADERS(mysql/mysql.h, [HAVE_MYSQL=yes], [HAVE_MYSQL=no]) + + if test $HAVE_MYSQL = no; then + AC_MSG_WARN([mysql include file mysql.h not found! + support for storage \"mysql\" will be disabled]) + fi +fi + HAVE_SQLITE=no if test $HAVE_LIBSQLITE = yes; then AC_CHECK_HEADERS(sqlite.h, [HAVE_SQLITE=yes], [HAVE_SQLITE=no]) @@ -213,6 +226,15 @@ fi fi + dnl test if we are trying to compile with mysql and if the library is there + if test $sm = mysql; then + if test $HAVE_MYSQL = no; then + dnl AC_MSG_WARN([MySQL library not found, omitting mysql storage]) + STORAGEMETHODS=`echo $STORAGEMETHODS|sed -e 's/mysql \?//'` + continue + fi + fi + dnl test if we are trying to compile with sqlite and if the library is there if test $sm = sqlite; then if test $HAVE_SQLITE = no; then |
From: Friedrich L. <fr...@us...> - 2004-08-24 18:39:08
|
Update of /cvsroot/ipac-ng/ipac-ng/storage/sharedsql In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6391/storage/sharedsql Modified Files: sharedsql.c Log Message: added mysql backend contributed by Denis O.Philippov Index: sharedsql.c =================================================================== RCS file: /cvsroot/ipac-ng/ipac-ng/storage/sharedsql/sharedsql.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- sharedsql.c 13 Jun 2004 01:14:30 -0000 1.1 +++ sharedsql.c 24 Aug 2004 18:38:58 -0000 1.2 @@ -181,7 +181,7 @@ timestamp_b, timestamp_e, (filter!=NULL) ? filter : "NULL"); if (timestamp_e) { - sprintf (wh_exec, "SELECT COUNT(*) FROM (SELECT DISTINCT that_time FROM logs WHERE "); + sprintf (wh_exec, "SELECT COUNT(distinct that_time) FROM logs WHERE "); if (ahost) sprintf (wh_exec+strlen (wh_exec), "hostname = '%s' AND ", ahost); sprintf (wh_exec+strlen (wh_exec), "that_time between '%lu' and '%lu'", @@ -189,7 +189,6 @@ if (filter) sprintf (wh_exec+strlen (wh_exec), " AND rule_name like '%%%s%%'", filter); - strcat (wh_exec, ")"); if (sql_execute_query (wh_exec)) { sql_close_connection (); @@ -372,12 +371,12 @@ timestamp_e = timestamp_b; if (ahost) - sprintf (wh_exec, "SELECT rule_name, sum (bytes), sum (pkts), hostname FROM logs " + sprintf (wh_exec, "SELECT rule_name, sum(bytes), sum(pkts), hostname FROM logs " "WHERE " "hostname = '%s' and that_time between '%lu' and '%lu' ", ahost, timestamp_b, timestamp_e); else - sprintf (wh_exec, "SELECT rule_name, sum (bytes), sum (pkts), hostname FROM logs " + sprintf (wh_exec, "SELECT rule_name, sum(bytes), sum(pkts), hostname FROM logs " "WHERE " "that_time between '%lu' and '%lu' ", timestamp_b, timestamp_e); |
From: Friedrich L. <fr...@us...> - 2004-08-24 18:39:08
|
Update of /cvsroot/ipac-ng/ipac-ng/storage/mysql In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6391/storage/mysql Modified Files: mysql_backend.h mysql.c Log Message: added mysql backend contributed by Denis O.Philippov Index: mysql_backend.h =================================================================== RCS file: /cvsroot/ipac-ng/ipac-ng/storage/mysql/mysql_backend.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- mysql_backend.h 13 Jul 2004 11:33:25 -0000 1.1 +++ mysql_backend.h 24 Aug 2004 18:38:57 -0000 1.2 @@ -1,13 +1,34 @@ -/* - * FIXME -- FIRST import from postgres backend, needs conversion to - * mysql functions - */ - +/* + * + * $Id$ + * + * mysql backend to ipac-ng + * Copyright (C) 2001-2003 Al Zakharov, 2003-2004 Friedrich Lobenstock, + * 2004 Simon Hausman, 2004 Denis O.Philippov + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * The author can be reached via email: kai...@ma..., or by + * fido: Al_...@p8... + * +*/ #ifndef MYSQL_BACKEND_H #define MYSQL_BACKEND_H -static int postgre_stor_open (int flag); +static int mysql_stor_open (int flag); static int sql_execute_query (const char *query); static int sql_execute_simple_query (const char *query); static void sql_clear_result(); Index: mysql.c =================================================================== RCS file: /cvsroot/ipac-ng/ipac-ng/storage/mysql/mysql.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- mysql.c 20 Jul 2004 19:02:45 -0000 1.2 +++ mysql.c 24 Aug 2004 18:38:57 -0000 1.3 @@ -3,7 +3,8 @@ * $Id$ * * mysql backend to ipac-ng - * Copyright (C) 2001-2003 Al Zakharov, 2003-2004 Friedrich Lobenstock, 2004 Simon Hausman + * Copyright (C) 2001-2003 Al Zakharov, 2003-2004 Friedrich Lobenstock, + * 2004 Simon Hausman, 2004 Denis O.Philippov * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -24,29 +25,22 @@ * */ -/* - * FIXME -- FIRST import from postgres backend, needs conversion to - * mysql functions - */ - #include "ipac.h" #include "mysql_backend.h" #include "../sharedsql/sharedsql.h" -#include <libpq-fe.h> +#include <mysql/mysql.h> -static char *pgoptions = NULL; -static char *pgtty = NULL; +static MYSQL conn; -static PGconn *conn; -static PGresult *res; +static MYSQL_RES *res = NULL; -static int postgre_stor_open (int flag); +static int mysql_stor_open (int flag); static void sql_close_connection (); static const storage_method_t interface_entry = { - "postgre", - postgre_stor_open, + "mysql", + mysql_stor_open, sql_stor_store_record, sql_stor_list_timestamps, sql_stor_get_records, @@ -62,23 +56,20 @@ /* include shared sql routines */ #include "../sharedsql/sharedsql.c" -static int postgre_stor_open (int flag) +static int mysql_stor_open (int flag) { sql_stor_open(); - - conn = PQsetdbLogin (dbhost, dbport, pgoptions, pgtty, dbname, dbuser, - dbpass); - if (PQstatus (conn) == CONNECTION_BAD) { - fprintf (stderr, "Connection to database '%s' failed.\n", dbname); - fprintf (stderr, "%s", PQerrorMessage (conn)); - - DPRINTF ("failed postgre_stor_open\n"); - - PQfinish (conn); + mysql_init(&conn); + if ( !mysql_real_connect(&conn, dbhost, dbuser, dbpass, dbname, + atoi(dbport), NULL, 0) ) { + fprintf(stderr, "Connection to database '%s' failed.\n", dbname); + fprintf(stderr, "%s\n", mysql_error(&conn)); + mysql_close(&conn); + DPRINTF ("failed mysql_stor_open\n"); return -1; } - DPRINTF ("postgre_stor_open\n"); + DPRINTF("mysql_stor_open\n"); storage_opened = 1; return 0; } @@ -86,10 +77,11 @@ static int sql_execute_query (const char *query) { DPRINTF ("%s\n", query); - res = PQexec (conn, query); - if (!res || (PQresultStatus (res) != PGRES_COMMAND_OK && PQresultStatus (res) != PGRES_TUPLES_OK)) { - fprintf (stderr, "%s : SQL command (%s) failed\nError: %s\n", me, query, PQresultErrorMessage (res)); - DPRINTF ("failed: %s\n", PQresultErrorMessage (res)); + if (mysql_query (&conn, query) || + (((res = mysql_store_result(&conn)) == NULL) && (mysql_errno(&conn) > 0 ))) { + fprintf (stderr, "%s : SQL command (%s) failed\nError: %s\n", + me, query, mysql_error(&conn)); + DPRINTF ("failed: %s\n", mysql_error(&conn)); sql_clear_result(); return -1; } @@ -108,21 +100,30 @@ static void sql_clear_result() { - PQclear (res); + if (res) { + mysql_free_result (res); + res = NULL; + } } static int sql_number_of_affected_rows () { - return PQntuples (res); + return mysql_affected_rows (&conn); } static const char *sql_result_get_value (int row, int column) { - return PQgetvalue (res, row, column); + MYSQL_ROW rw; + mysql_data_seek(res, row); + + if ((rw = mysql_fetch_row(res))) { + return rw[column]; + } + return NULL; } static void sql_close_connection() { - PQfinish (conn); + mysql_close(&conn); } |
From: Friedrich L. <fr...@us...> - 2004-08-24 17:21:25
|
Update of /cvsroot/ipac-ng/ipac-ng/access/files In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13154/access/files Modified Files: rules.y Log Message: different errors should not result in the same error messages Index: rules.y =================================================================== RCS file: /cvsroot/ipac-ng/ipac-ng/access/files/rules.y,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- rules.y 27 Jun 2004 19:23:25 -0000 1.3 +++ rules.y 24 Aug 2004 17:21:14 -0000 1.4 @@ -280,6 +280,6 @@ int ruleserror(char *s) { - fprintf(stderr, "Config parse error near line %s\n", s); + fprintf(stderr, "Error parsing rules file near line %s\n", s); return 0; } |
From: Friedrich L. <fr...@us...> - 2004-08-24 17:21:25
|
Update of /cvsroot/ipac-ng/ipac-ng In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13154 Modified Files: conffile.y Log Message: different errors should not result in the same error messages Index: conffile.y =================================================================== RCS file: /cvsroot/ipac-ng/ipac-ng/conffile.y,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- conffile.y 8 May 2004 13:23:01 -0000 1.4 +++ conffile.y 24 Aug 2004 17:21:13 -0000 1.5 @@ -232,6 +232,6 @@ int conferror(char *s) { - fprintf(stderr, "Config parse error near line %d: %s\n", confline, s); + fprintf(stderr, "Error in config file near line %d: %s\n", confline, s); exit (1); } |
From: Friedrich L. <fr...@us...> - 2004-08-24 17:19:20
|
Update of /cvsroot/ipac-ng/ipac-ng In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12358 Modified Files: CHANGELOG Log Message: document dependency of -r on -H Index: CHANGELOG =================================================================== RCS file: /cvsroot/ipac-ng/ipac-ng/CHANGELOG,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- CHANGELOG 28 Jun 2004 15:47:24 -0000 1.28 +++ CHANGELOG 24 Aug 2004 17:19:10 -0000 1.29 @@ -24,6 +24,7 @@ is caused by rounding - no fix yet * with storage backend "gdbm" DO NOT call fetchipac twice in the same second or you database will be destroyed - no fix yet + * -r/--replace option of ipacsum needs options -H/--hostname 1.31 |
From: Friedrich L. <fr...@us...> - 2004-08-13 15:20:50
|
Update of /cvsroot/ipac-ng/ipac-ng/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15577 Added Files: sqlite-howto Log Message: added a quick sqlite howto --- NEW FILE: sqlite-howto --- From: Friedrich Lobenstock <fl...@fl...> To: ipa...@li... Subject: Re: [Ipac-ng-common] sqlite How-to? Reply-To: ipa...@li... Date: Fri, 13 Aug 2004 17:09:23 +0200 Blu...@gm... wrote on 13.08.2004 16:02 MET: > > I would really like to use the newly enabled sqlite DB with ipac-ng. > However, I cannot seem to find a tutorial or how-to or any other > documentation on how to use it. I tried changing "postgre" to "sqlite" in > the config file but that did not do it. Ok, here you go: Download and install SQLite from http://sqlite.org/, eg. get an RPM from http://sqlite.org/download.html Configure, compile and install ipac-ng-1.30. The output of configure should look like this: # ./configure checking for gcc... gcc ... checking sqlite.h usability... yes checking sqlite.h presence... yes ... checking for available storage methods... gdbm mysql sqlite plain-file postgre ... In /etc/ipac.conf set storage = sqlite db name = ipac Then run fetchipac -S to set up the iptables rules and run fetchipac to fetch the data and store them in the database. The first call to fetchipac without parameters should print "ipac-ng[sqlite]: creating logs table" which basically means that the database file named ipac.db (=parameter 'db name' in ipac.conf) got created at /var/lib/ipac. To access this database use the sqlite utility like this: # sqlite /var/lib/ipac/ipac.db SQLite version 2.8.14 Enter ".help" for instructions sqlite> select * from logs; TOTAL in|0|0|1092409104|somehost TOTAL in|0|0|1092409106|somehost sqlite> delete from logs where that_time=1092409104; sqlite> select * from logs; TOTAL in|0|0|1092409106|somehost sqlite> See doc/postgres-db.sql for how the database table logs is defined. -- MfG / Regards Friedrich Lobenstock ____________________________________________________________________ Friedrich Lobenstock Linux Services Lobenstock URL: http://www.lsl.at/ Email: fl...@fl... ____________________________________________________________________ _______________________________________________ Ipac-ng-common mailing list Ipa...@li... https://lists.sourceforge.net/lists/listinfo/ipac-ng-common |
From: Friedrich L. <fr...@us...> - 2004-07-20 19:02:56
|
Update of /cvsroot/ipac-ng/ipac-ng/storage/mysql In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4216 Modified Files: mysql.c Log Message: keep comiler happy BUT the mysql module is far from complete Index: mysql.c =================================================================== RCS file: /cvsroot/ipac-ng/ipac-ng/storage/mysql/mysql.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- mysql.c 13 Jul 2004 11:33:25 -0000 1.1 +++ mysql.c 20 Jul 2004 19:02:45 -0000 1.2 @@ -55,7 +55,7 @@ sql_stor_close }; -const storage_method_t *ipac_sm_interface_postgre () { +const storage_method_t *ipac_sm_interface_mysql () { return &interface_entry; } |