From 76608725f708938c0159cbb464b28e413d76dceb Mon Sep 17 00:00:00 2001 From: rettenbe Date: Mon, 22 Sep 2008 12:04:22 +0000 Subject: [PATCH] add mysql db check scripts git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12529 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-si/tests/db-check-clients.pl | 46 ++++++++++++++++++++++ gosa-si/tests/db-check-fai-release.pl | 44 +++++++++++++++++++++ gosa-si/tests/db-check-fai-server.pl | 44 +++++++++++++++++++++ gosa-si/tests/db-check-foreign-clients.pl | 46 ++++++++++++++++++++++ gosa-si/tests/db-check-incoming.pl | 46 ++++++++++++++++++++++ gosa-si/tests/db-check-jobs.pl | 46 ++++++++++++++++++++++ gosa-si/tests/db-check-messaging.pl | 44 +++++++++++++++++++++ gosa-si/tests/db-check-packages-list.pl | 46 ++++++++++++++++++++++ gosa-si/tests/db-check-server.pl | 45 +++++++++++++++++++++ gosa-si/tests/db-check-users.pl | 48 +++++++++++++++++++++++ 10 files changed, 455 insertions(+) create mode 100755 gosa-si/tests/db-check-clients.pl create mode 100755 gosa-si/tests/db-check-fai-release.pl create mode 100755 gosa-si/tests/db-check-fai-server.pl create mode 100755 gosa-si/tests/db-check-foreign-clients.pl create mode 100755 gosa-si/tests/db-check-incoming.pl create mode 100755 gosa-si/tests/db-check-jobs.pl create mode 100755 gosa-si/tests/db-check-messaging.pl create mode 100755 gosa-si/tests/db-check-packages-list.pl create mode 100755 gosa-si/tests/db-check-server.pl create mode 100755 gosa-si/tests/db-check-users.pl diff --git a/gosa-si/tests/db-check-clients.pl b/gosa-si/tests/db-check-clients.pl new file mode 100755 index 000000000..1b197ba14 --- /dev/null +++ b/gosa-si/tests/db-check-clients.pl @@ -0,0 +1,46 @@ +#!/usr/bin/perl +#=============================================================================== +# +# FILE: DBD-SQlite.pl +# +# USAGE: ./DBD-SQlite.pl +# +# DESCRIPTION: +# +# OPTIONS: --- +# REQUIREMENTS: --- +# BUGS: --- +# NOTES: --- +# AUTHOR: (), <> +# COMPANY: +# VERSION: 1.0 +# CREATED: 20.12.2007 08:54:52 CET +# REVISION: --- +#=============================================================================== + +use strict; +use warnings; +use GOSA::DBsqlite; +use Data::Dumper; + +print "START\n"; +my $res; +my $db_name; + + +$db_name = "/var/lib/gosa-si/clients.db"; +if (-e $db_name) { + print "\n############################################################\n"; + my $table_name = "known_clients"; + print "$db_name\n"; + print "$table_name\n"; + + my $sqlite = GOSA::DBsqlite->new($db_name); + my $col_names = $sqlite->get_table_columns($table_name); + print join(', ', @{ $col_names } )."\n" ; + my $answer = $sqlite->show_table($table_name); + print $answer."\n"; +} + + +print "\nFINISH\n"; diff --git a/gosa-si/tests/db-check-fai-release.pl b/gosa-si/tests/db-check-fai-release.pl new file mode 100755 index 000000000..efb73d61a --- /dev/null +++ b/gosa-si/tests/db-check-fai-release.pl @@ -0,0 +1,44 @@ +#!/usr/bin/perl +#=============================================================================== +# +# FILE: DBD-SQlite.pl +# +# USAGE: ./DBD-SQlite.pl +# +# DESCRIPTION: +# +# OPTIONS: --- +# REQUIREMENTS: --- +# BUGS: --- +# NOTES: --- +# AUTHOR: (), <> +# COMPANY: +# VERSION: 1.0 +# CREATED: 20.12.2007 08:54:52 CET +# REVISION: --- +#=============================================================================== + +use strict; +use warnings; +use GOSA::DBsqlite; +use Data::Dumper; + +print "START\n"; +my $res; +my $db_name; + +$db_name = "/var/lib/gosa-si/fai_release.db"; +if (-e $db_name) { + print "\n############################################################\n"; + my $table_name = "fai_release"; + print "$db_name\n"; + print "$table_name\n"; + + my $sqlite = GOSA::DBsqlite->new($db_name); + my $col_names = $sqlite->get_table_columns($table_name); + print join(', ', @{ $col_names } )."\n" ; + my $answer = $sqlite->show_table($table_name); + print $answer."\n"; +} + +print "\nFINISH\n"; diff --git a/gosa-si/tests/db-check-fai-server.pl b/gosa-si/tests/db-check-fai-server.pl new file mode 100755 index 000000000..1d237e824 --- /dev/null +++ b/gosa-si/tests/db-check-fai-server.pl @@ -0,0 +1,44 @@ +#!/usr/bin/perl +#=============================================================================== +# +# FILE: DBD-SQlite.pl +# +# USAGE: ./DBD-SQlite.pl +# +# DESCRIPTION: +# +# OPTIONS: --- +# REQUIREMENTS: --- +# BUGS: --- +# NOTES: --- +# AUTHOR: (), <> +# COMPANY: +# VERSION: 1.0 +# CREATED: 20.12.2007 08:54:52 CET +# REVISION: --- +#=============================================================================== + +use strict; +use warnings; +use GOSA::DBsqlite; +use Data::Dumper; + +print "START\n"; +my $res; +my $db_name; + +$db_name = "/var/lib/gosa-si/fai_server.db"; +if (-e $db_name) { + print "\n############################################################\n"; + my $table_name = "fai_server"; + print "$db_name\n"; + print "$table_name\n"; + + my $sqlite = GOSA::DBsqlite->new($db_name); + my $col_names = $sqlite->get_table_columns($table_name); + print join(', ', @{ $col_names } )."\n" ; + my $answer = $sqlite->show_table($table_name); + print $answer."\n"; +} + +print "\nFINISH\n"; diff --git a/gosa-si/tests/db-check-foreign-clients.pl b/gosa-si/tests/db-check-foreign-clients.pl new file mode 100755 index 000000000..e3ebba80e --- /dev/null +++ b/gosa-si/tests/db-check-foreign-clients.pl @@ -0,0 +1,46 @@ +#!/usr/bin/perl +#=============================================================================== +# +# FILE: DBD-SQlite.pl +# +# USAGE: ./DBD-SQlite.pl +# +# DESCRIPTION: +# +# OPTIONS: --- +# REQUIREMENTS: --- +# BUGS: --- +# NOTES: --- +# AUTHOR: (), <> +# COMPANY: +# VERSION: 1.0 +# CREATED: 20.12.2007 08:54:52 CET +# REVISION: --- +#=============================================================================== + +use strict; +use warnings; +use GOSA::DBsqlite; +use Data::Dumper; + +print "START\n"; +my $res; +my $db_name; + + +$db_name = "/var/lib/gosa-si/foreign_clients.db"; +if (-e $db_name) { + print "\n############################################################\n"; + my $table_name = "foreign_clients"; + print "$db_name\n"; + print "$table_name\n"; + + my $sqlite = GOSA::DBsqlite->new($db_name); + my $col_names = $sqlite->get_table_columns($table_name); + print join(', ', @{ $col_names } )."\n" ; + my $answer = $sqlite->show_table($table_name); + print $answer."\n"; +} + + +print "\nFINISH\n"; diff --git a/gosa-si/tests/db-check-incoming.pl b/gosa-si/tests/db-check-incoming.pl new file mode 100755 index 000000000..03a40e12d --- /dev/null +++ b/gosa-si/tests/db-check-incoming.pl @@ -0,0 +1,46 @@ +#!/usr/bin/perl +#=============================================================================== +# +# FILE: DBD-SQlite.pl +# +# USAGE: ./DBD-SQlite.pl +# +# DESCRIPTION: +# +# OPTIONS: --- +# REQUIREMENTS: --- +# BUGS: --- +# NOTES: --- +# AUTHOR: (), <> +# COMPANY: +# VERSION: 1.0 +# CREATED: 20.12.2007 08:54:52 CET +# REVISION: --- +#=============================================================================== + +use strict; +use warnings; +use GOSA::DBsqlite; +use Data::Dumper; + +print "START\n"; +my $res; +my $db_name; + + +$db_name = "/var/lib/gosa-si/incoming.db"; +if (-e $db_name) { + print "\n############################################################\n"; + my $table_name = "incoming"; + print "$db_name\n"; + print "$table_name\n"; + my $sqlite = GOSA::DBsqlite->new($db_name); + my $col_names = $sqlite->get_table_columns($table_name); + + print join(', ', @{ $col_names } )."\n" ; + my $answer = $sqlite->show_table($table_name); + print $answer."\n"; +} + + +print "\nFINISH\n"; diff --git a/gosa-si/tests/db-check-jobs.pl b/gosa-si/tests/db-check-jobs.pl new file mode 100755 index 000000000..b80039b62 --- /dev/null +++ b/gosa-si/tests/db-check-jobs.pl @@ -0,0 +1,46 @@ +#!/usr/bin/perl +#=============================================================================== +# +# FILE: DBD-SQlite.pl +# +# USAGE: ./DBD-SQlite.pl +# +# DESCRIPTION: +# +# OPTIONS: --- +# REQUIREMENTS: --- +# BUGS: --- +# NOTES: --- +# AUTHOR: (), <> +# COMPANY: +# VERSION: 1.0 +# CREATED: 20.12.2007 08:54:52 CET +# REVISION: --- +#=============================================================================== + +use strict; +use warnings; +use GOSA::DBsqlite; +use Data::Dumper; + +print "START\n"; +my $res; +my $db_name; + + +$db_name = "/var/lib/gosa-si/jobs.db"; +if (-e $db_name) { + print "\n############################################################\n"; + my $table_name = "jobs"; + print "$db_name\n"; + print "$table_name\n"; + my $sqlite = GOSA::DBsqlite->new($db_name); + my $col_names = $sqlite->get_table_columns($table_name); + + print join(', ', @{ $col_names } )."\n" ; + my $answer = $sqlite->show_table($table_name); + print $answer."\n"; +} + + +print "\nFINISH\n"; diff --git a/gosa-si/tests/db-check-messaging.pl b/gosa-si/tests/db-check-messaging.pl new file mode 100755 index 000000000..f7244ad8c --- /dev/null +++ b/gosa-si/tests/db-check-messaging.pl @@ -0,0 +1,44 @@ +#!/usr/bin/perl +#=============================================================================== +# +# FILE: DBD-SQlite.pl +# +# USAGE: ./DBD-SQlite.pl +# +# DESCRIPTION: +# +# OPTIONS: --- +# REQUIREMENTS: --- +# BUGS: --- +# NOTES: --- +# AUTHOR: (), <> +# COMPANY: +# VERSION: 1.0 +# CREATED: 20.12.2007 08:54:52 CET +# REVISION: --- +#=============================================================================== + +use strict; +use warnings; +use GOSA::DBsqlite; + + +print "START\n"; +my $res; +my $db_name; + + +$db_name = "/var/lib/gosa-si/messaging.db"; +if (-e $db_name) { + print "\n############################################################\n"; + my $table_name = "messaging"; + print "$db_name\n"; + print "$table_name\n"; + my $sqlite = GOSA::DBsqlite->new($db_name); + my $col_names = $sqlite->get_table_columns($table_name); + print join(', ', @{ $col_names } )."\n" ; + my $answer = $sqlite->show_table($table_name); + print $answer."\n"; +} + +print "\nFINISH\n"; diff --git a/gosa-si/tests/db-check-packages-list.pl b/gosa-si/tests/db-check-packages-list.pl new file mode 100755 index 000000000..d01644e19 --- /dev/null +++ b/gosa-si/tests/db-check-packages-list.pl @@ -0,0 +1,46 @@ +#!/usr/bin/perl +#=============================================================================== +# +# FILE: sqlite_check_packages_list.pl +# +# USAGE: ./sqlite_check_packages_list.pl +# +# DESCRIPTION: +# +# OPTIONS: --- +# REQUIREMENTS: --- +# BUGS: --- +# NOTES: --- +# AUTHOR: (), <> +# COMPANY: +# VERSION: 1.0 +# CREATED: 28.02.2008 11:09:15 CET +# REVISION: --- +#=============================================================================== + +use strict; +use warnings; +use GOSA::DBsqlite; +use Data::Dumper; + +print "START\n"; +my $res; +my $db_name; + + +$db_name = "/var/lib/gosa-si/packages.db"; +if (-e $db_name) { + print "\n############################################################\n"; + my $table_name = "packages_list"; + print "$db_name\n"; + print "$table_name\n"; + + my $sqlite = GOSA::DBsqlite->new($db_name); + my $col_names = $sqlite->get_table_columns($table_name); + print join(', ', @{ $col_names } )."\n" ; + my $answer = $sqlite->show_table($table_name); + print $answer."\n"; +} + + +print "\nFINISH\n"; diff --git a/gosa-si/tests/db-check-server.pl b/gosa-si/tests/db-check-server.pl new file mode 100755 index 000000000..18f59d7b5 --- /dev/null +++ b/gosa-si/tests/db-check-server.pl @@ -0,0 +1,45 @@ +#!/usr/bin/perl +#=============================================================================== +# +# FILE: DBD-SQlite.pl +# +# USAGE: ./DBD-SQlite.pl +# +# DESCRIPTION: +# +# OPTIONS: --- +# REQUIREMENTS: --- +# BUGS: --- +# NOTES: --- +# AUTHOR: (), <> +# COMPANY: +# VERSION: 1.0 +# CREATED: 20.12.2007 08:54:52 CET +# REVISION: --- +#=============================================================================== + +use strict; +use warnings; +use GOSA::DBsqlite; +use Data::Dumper; + +print "START\n"; +my $res; +my $db_name; + + +$db_name = "/var/lib/gosa-si/servers.db"; +if (-e $db_name) { + print "\n############################################################\n"; + my $table_name = "known_server"; + print "$db_name\n"; + print "$table_name\n"; + + my $sqlite = GOSA::DBsqlite->new($db_name); + my $col_names = $sqlite->get_table_columns($table_name); + print join(', ', @{ $col_names } )."\n" ; + my $answer = $sqlite->show_table($table_name); + print $answer."\n"; +} + +print "\nFINISH\n"; diff --git a/gosa-si/tests/db-check-users.pl b/gosa-si/tests/db-check-users.pl new file mode 100755 index 000000000..1f49f8cc5 --- /dev/null +++ b/gosa-si/tests/db-check-users.pl @@ -0,0 +1,48 @@ +#!/usr/bin/perl +#=============================================================================== +# +# FILE: DBD-SQlite.pl +# +# USAGE: ./DBD-SQlite.pl +# +# DESCRIPTION: +# +# OPTIONS: --- +# REQUIREMENTS: --- +# BUGS: --- +# NOTES: --- +# AUTHOR: (), <> +# COMPANY: +# VERSION: 1.0 +# CREATED: 20.12.2007 08:54:52 CET +# REVISION: --- +#=============================================================================== + +use strict; +use warnings; +use GOSA::DBsqlite; +use Data::Dumper; + +print "START\n"; +my $res; +my $db_name; + + + + +$db_name = "/var/lib/gosa-si/users.db"; +if (-e $db_name) { + print "\n############################################################\n"; + my $table_name = "login_users"; + print "$db_name\n"; + print "$table_name\n"; + + my $sqlite = GOSA::DBsqlite->new($db_name); + my $col_names = $sqlite->get_table_columns($table_name); + print join(', ', @{ $col_names } )."\n" ; + my $answer = $sqlite->show_table($table_name); + print $answer."\n"; +} + + +print "\nFINISH\n"; -- 2.30.2