My apologies... didn't mean to come across as rude. I figured that others may have tools like Cacti along with NDOutils on the same server and thus might find that they have multiple database types as well... hence my email to the Nagios list instead of the mysql list. In my case, I learned the hard way that mysqlhotcopy doesn't backup InnoDB databases... hence my need to determine the DB type so I knew how to properly backup the various DB's.

In any case, your original reply pointed me in the right direction. I just wrote up the script below. It first shows all the databases, then determines the database type for each, making it easy to parse out:

#!/bin/bash

DATABASES=`mysql -uroot -p<password> -e "show databases;"|awk -F "|" '{print $1}'|grep -vE "Database|information_schema|test|nagdb"`

for x in $DATABASES
do
DATABASE_TYPE=`mysql -uroot -p<password> -e "show table status;" $x|awk '{print $2}'|uniq|grep -v Engine`
   echo $x:$DATABASE_TYPE
done

exit 0

Of course, I've also learned its possible to mix engines within a database, so this isn't exactly foolproof. The output looks something like this:

# /root/test.sh
cacti:MyISAM
mysql:MyISAM
nagios:InnoDB

Thanks for pointing me in the right direction...

 A. Davis
 Email:     ncc...@gmail.com

 "There is no limit to what a man can accomplish
  if he doesn't care who gets the credit." - Ronald Reagan



Marc Powell wrote:
On Aug 7, 2009, at 3:15 PM, Andrew Davis wrote:

Really? You sure about that? I'm pretty confident that mysql supports different types of databases (myISAM and InnoDB as two of them) as well as different table types within a database.

If you really wanted to be sure about that and not question the answers you receive, shouldn't you be asking on mysql-users instead of the unrelated nagios-users? That would be the forum for definitive answers about mysql database types, don't you agree?

--
Marc


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue. 
::: Messages without supporting info will risk being sent to /dev/null

Reply via email to