[Nagios-users] NDOUtils mysql question?

2009-08-07 Thread Andrew Davis
Our Nagios server also has Cacti on it. I'm pretty sure that Cacti uses 
an InnoDB database, while NDOUtils uses myISAM. The two are backed up 
differently (example: mysqlhotcopy doesn't working on InnoDB databases). 
Does anyone know what mysql command you run to determine which type of 
DB is used for various databases, especially considering you can run 
multiple types at once? I know I can use "mysqlshow" or the "show 
databases;" options to show the databases themselves, but it doesn't 
list the DB type. Using mysqlshow with a -t and a DB name shows the 
table types, but again, not the database types. I'm sort of stuck on 
this. I want to make sure I know what DB types I'm dealing with so I can 
ensure I'm backing them up properly. Google searches aren't helping... 
the results all go back to the "mysql versus innodb" debate...


--


 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

--
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

Re: [Nagios-users] NDOUtils mysql question?

2009-08-07 Thread Marc Powell

On Aug 7, 2009, at 2:03 PM, Andrew Davis wrote:

> Our Nagios server also has Cacti on it. I'm pretty sure that Cacti  
> uses an InnoDB database, while NDOUtils uses myISAM. The two are  
> backed up differently (example: mysqlhotcopy doesn't working on  
> InnoDB databases). Does anyone know what mysql command you run to  
> determine which type of DB is used for various databases, especially  
> considering you can run multiple types at once? I know I can use  
> "mysqlshow" or the "show databases;" options to show the databases  
> themselves, but it doesn't list the DB type.

It's not a database level option. It's table level.

> Using mysqlshow with a -t and a DB name shows the table types, but  
> again, not the database types. I'm sort of stuck on this. I want to  
> make sure I know what DB types I'm dealing with so I can ensure I'm  
> backing them up properly. Google searches aren't helping... the  
> results all go back to the "mysql versus innodb" debate...

My Google-fu seems to be more powerful.

mysql -u Username -p -h database.hostname.com -e "show table status"  
databasename.

--
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


Re: [Nagios-users] NDOUtils mysql question?

2009-08-07 Thread shadih rahman
I would double check these information.  Cacti runs on rrd( round robin
database).  I have innodb for my ndoutils 1.47b.

On Fri, Aug 7, 2009 at 3:03 PM, Andrew Davis  wrote:

>  Our Nagios server also has Cacti on it. I'm pretty sure that Cacti uses an
> InnoDB database, while NDOUtils uses myISAM. The two are backed up
> differently (example: mysqlhotcopy doesn't working on InnoDB databases).
> Does anyone know what mysql command you run to determine which type of DB is
> used for various databases, especially considering you can run multiple
> types at once? I know I can use "mysqlshow" or the "show databases;" options
> to show the databases themselves, but it doesn't list the DB type. Using
> mysqlshow with a -t and a DB name shows the table types, but again, not the
> database types. I'm sort of stuck on this. I want to make sure I know what
> DB types I'm dealing with so I can ensure I'm backing them up properly.
> Google searches aren't helping... the results all go back to the "mysql
> versus innodb" debate...
>
> --
>
>
>   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
>
>
>
> --
> 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
>



-- 
Cordially,
Shadhin Rahman
--
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

Re: [Nagios-users] NDOUtils mysql question?

2009-08-07 Thread Andrew Davis
Okay, perhaps I inverted it then. My build of Cacti stores everything to 
a mysql DB, though it could admittedly be a myISAM DB with NDOutils 
being of the InnoDB type. However it works out, I'm pretty confident 
that I have two database types on one mysql server and I'm trying to 
figure out how to use a mysql command to list the database names and 
their types...


# mysql -u root -p -e "show databases;"
Enter password:
++
| Database   |
++
| information_schema |
| cacti  |
| mysql  |
| nagdb  |
| nagios |
| test   |
++

 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



shadih rahman wrote:
I would double check these information.  Cacti runs on rrd( round 
robin database).  I have innodb for my ndoutils 1.47b.


On Fri, Aug 7, 2009 at 3:03 PM, Andrew Davis > wrote:


Our Nagios server also has Cacti on it. I'm pretty sure that Cacti
uses an InnoDB database, while NDOUtils uses myISAM. The two are
backed up differently (example: mysqlhotcopy doesn't working on
InnoDB databases). Does anyone know what mysql command you run to
determine which type of DB is used for various databases,
especially considering you can run multiple types at once? I know
I can use "mysqlshow" or the "show databases;" options to show the
databases themselves, but it doesn't list the DB type. Using
mysqlshow with a -t and a DB name shows the table types, but
again, not the database types. I'm sort of stuck on this. I want
to make sure I know what DB types I'm dealing with so I can ensure
I'm backing them up properly. Google searches aren't helping...
the results all go back to the "mysql versus innodb" debate...

-- 



  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





--
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




--
Cordially,
Shadhin Rahman
--
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

Re: [Nagios-users] NDOUtils mysql question?

2009-08-07 Thread David Rosenstrauch
On 08/07/2009 03:03 PM, Andrew Davis wrote:
> Our Nagios server also has Cacti on it. I'm pretty sure that Cacti uses 
> an InnoDB database, while NDOUtils uses myISAM. The two are backed up 
> differently (example: mysqlhotcopy doesn't working on InnoDB databases). 
> Does anyone know what mysql command you run to determine which type of 
> DB is used for various databases, especially considering you can run 
> multiple types at once? I know I can use "mysqlshow" or the "show 
> databases;" options to show the databases themselves, but it doesn't 
> list the DB type. Using mysqlshow with a -t and a DB name shows the 
> table types, but again, not the database types. I'm sort of stuck on 
> this. I want to make sure I know what DB types I'm dealing with so I can 
> ensure I'm backing them up properly. Google searches aren't helping... 
> the results all go back to the "mysql versus innodb" debate...

I think the engine type is set on a table by table basis, not database-wide.

You can see this as follows:

mysql> show create table mysql.time_zone\G
*** 1. row ***
Table: time_zone
Create Table: CREATE TABLE `time_zone` (
   `Time_zone_id` int(10) unsigned NOT NULL auto_increment,
   `Use_leap_seconds` enum('Y','N') NOT NULL default 'N',
   PRIMARY KEY  (`Time_zone_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Time zones'
1 row in set (0.00 sec)


Note the "ENGINE=MyISAM" at the end.

HTH,

DR

--
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


Re: [Nagios-users] NDOUtils mysql question?

2009-08-07 Thread Andrew Davis
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. Your reply did help, though, 
as when I ran it for the default mysql DB, I was reminded of the phrase 
"engine" in the output. Thus, now I see:


mysql -u root -p -e "show table status" mysql
Enter password:
+---++-++--++-++--+---++-+-+-+-+--++---+
| Name  | Engine | Version | Row_format | Rows | 
Avg_row_length | Data_length | Max_data_length| Index_length | 
Data_free | Auto_increment | Create_time | Update_time | 
Check_time  | Collation   | Checksum | Create_options | 
Comment   |

+---++-++--++-++--+---++-+-+-+-+--++---+
| columns_priv  | MyISAM |  10 | Fixed  |0 
|  0 |   0 | 227994731135631359 | 1024 
| 0 |   NULL | 2009-02-12 10:21:04 | 2009-02-12 10:21:04 
| NULL| utf8_bin| NULL || 
Column privileges 


mysql> show engines;
++-++
| Engine | Support | 
Comment|

++-++
| MyISAM | DEFAULT | Default engine as of MySQL 3.23 with great 
performance |
| MEMORY | YES | Hash based, stored in memory, useful for 
temporary tables  |
| InnoDB | YES | Supports transactions, row-level locking, and 
foreign keys |
| BerkeleyDB | YES | Supports transactions and page-level 
locking   |
| BLACKHOLE  | NO  | /dev/null storage engine (anything you write to 
it disappears) |
| EXAMPLE| NO  | Example storage 
engine |
| ARCHIVE| NO  | Archive storage 
engine |
| CSV| NO  | CSV storage 
engine |
| ndbcluster | NO  | Clustered, fault-tolerant, memory-based 
tables |
| FEDERATED  | NO  | Federated MySQL storage 
engine |
| MRG_MYISAM | YES | Collection of identical MyISAM 
tables  |
| ISAM   | NO  | Obsolete storage 
engine|

++-++
12 rows in set (0.00 sec)

An "engine" is another way of saying "database type". This is distinct 
from a table type. Of course, the above only shows me the engines that 
are already compiled in and available for use, but hopefully I can go 
forward from here... I'm thinking I can do a "show databases;", then 
pump that into a "for x in ..." to show the engine type for each DB.


Thanks for the assist...

 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 2:03 PM, Andrew Davis wrote:

  
Our Nagios server also has Cacti on it. I'm pretty sure that Cacti  
uses an InnoDB database, while NDOUtils uses myISAM. The two are  
backed up differently (example: mysqlhotcopy doesn't working on  
InnoDB databases). Does anyone know what mysql command you run to  
determine which type of DB is used for various databases, especially  
considering you can run multiple types at once? I know I can use  
"mysqlshow" or the "show databases;" options to show the databases  
themselves, but it doesn't list the DB type.



It's not a database level option. It's table level.

  
Using mysqlshow with a -t and a DB name shows the table types, but  
again, not the database types. I'm sort of stuck on this. I want to  
make sure I know what DB types I'm dealing with so I can ensure I'm  
backing them up properly. Google searches aren't helping... the  
results all go back to the "mysql versus innodb" debate...



My Google-fu seems to be more powerful.

mysql -u Username -p -h database.hostname.com -e "show table status"  
databasename.


--
Marc


--
Let Crystal Reports handle the rep

Re: [Nagios-users] NDOUtils mysql question?

2009-08-07 Thread Marc Powell

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


Re: [Nagios-users] NDOUtils mysql question?

2009-08-07 Thread Andrew Davis
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 -e "show databases;"|awk -F "|" 
'{print $1}'|grep -vE "Database|information_schema|test|nagdb"`


for x in $DATABASES
do
   DATABASE_TYPE=`mysql -uroot -p -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