how to check mysql services?

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
ivia
Posts: 10
Joined: Fri Aug 11, 2006 4:29 am

how to check mysql services?

Post by ivia »

Any idea how to check mysql services in CACTi?
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

Hi

if you want to graph MySQL usage, nice templates are available here : http://forums.cacti.net/viewtopic.php?t=11010
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
ivia
Posts: 10
Joined: Fri Aug 11, 2006 4:29 am

Post by ivia »

fmangeant wrote:Hi

if you want to graph MySQL usage, nice templates are available here : http://forums.cacti.net/viewtopic.php?t=11010
I need to know if mysql is still running or not cos rrd stopped updating even though its still polling periodically.

issue indicated at http://forums.cacti.net/viewtopic.php?t=15379
Matt`G
Posts: 11
Joined: Wed May 17, 2006 10:26 am
Location: Michigan, USA

Post by Matt`G »

Depends on your distribution of linux. Most have init scripts that allow you to check the status of a running service with:

Code: Select all

/etc/init.d/mysql status
Or, you could always check manually for a running process:

Code: Select all

ps auxw | grep mysql
Finally, you could always try to manually connect to your mysql server from your localhost using the user/pw you created when you set up cacti:

Code: Select all

mysql -u youruser -p
Matt`G
Posts: 11
Joined: Wed May 17, 2006 10:26 am
Location: Michigan, USA

Post by Matt`G »

As a matter of fact, if the problem is that the graphs have stopped graphing... you may want to get into the local mysql console and run this query:

Code: Select all

select count(*) from poller_output;
If it's some huge number, you can run the following query to try to get it working again:

Code: Select all

truncate table poller_output;
Note that the truncate command is dumping everything in that table, and I believe that you'll be losing data for your graphs... so if it starts graphing again you'll have a blank spot in the graph. However, I've had good luck getting my graphs to start again by doing this. So, yeah, use at your own risk.. but if your cacti server is in development anyway, no harm no foul right? ;)
Last edited by Matt`G on Wed Aug 23, 2006 9:53 am, edited 1 time in total.
ivia
Posts: 10
Joined: Fri Aug 11, 2006 4:29 am

Post by ivia »

Matt`G wrote:As a matter of fact, if the problem is that the graphs have stopped graphing... you may want to get into the local mysql console and run this query:

Code: Select all

select count(*) from poller_output;
If it's some huge number, you can run the following query to try to get it working again:

Code: Select all

truncate table poller_output
Note that the truncate command is dumping everything in that table, and I believe that you'll be losing data for your graphs... so if it starts graphing again you'll have a blank spot in the graph. However, I've had good luck getting my graphs to start again by doing this. So, yeah, use at your own risk.. but if your cacti server is in development anyway, no harm no foul right? ;)
How to start CACTI db if its not running?
Matt`G
Posts: 11
Joined: Wed May 17, 2006 10:26 am
Location: Michigan, USA

Post by Matt`G »

ivia wrote:How to start CACTI db if its not running?
If mysql is running, the cacti DB is running. If mysql is not running, try starting it with:

Code: Select all

/etc/init.d/mysql start
This should work on most linux distributions.

BTW, I should have been more specific in my last post... Once you log into MySQL console as suggested a couple posts up, you need to issue this command:

Code: Select all

use cacti;
That will allow you to work right with the cacti database. After this, then you can do the other commands I suggested. Also, I forgot the semicolon at the end of the truncate line... I'll edit the post and put it in.
ivia
Posts: 10
Joined: Fri Aug 11, 2006 4:29 am

Post by ivia »

Matt`G wrote:As a matter of fact, if the problem is that the graphs have stopped graphing... you may want to get into the local mysql console and run this query:

Code: Select all

select count(*) from poller_output;
If it's some huge number, you can run the following query to try to get it working again:

Code: Select all

truncate table poller_output;
Note that the truncate command is dumping everything in that table, and I believe that you'll be losing data for your graphs... so if it starts graphing again you'll have a blank spot in the graph. However, I've had good luck getting my graphs to start again by doing this. So, yeah, use at your own risk.. but if your cacti server is in development anyway, no harm no foul right? ;)
Thanks to all, cacti is working now by 'truncate table poller_output'
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests