NDOUtils mysql question?
Andrew Davis
nccomp at gmail.com
Fri Aug 7 23:10:23 CEST 2009
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: nccomp at 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 at 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20090807/e9445c11/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
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
-------------- next part --------------
_______________________________________________
Nagios-users mailing list
Nagios-users at 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
More information about the Users
mailing list