installing & using mtop

nobaloney

NoBaloney Internet Svcs - In Memoriam †
Joined
Jun 16, 2003
Messages
25,333
Location
California
It took me a while but I finally got mtop installed on a CentOS 5 distribution.

Now I can't figure out how to use it.

Anyone use it?

Here's what mtop --help says:
Code:
  --version                  Show version number and exit
  --help                     Show this screen and exit
  --host={mysql_host}        Connect to the MySQL server on {mysql_host}
  --dbuser={mysql_user}      Connect to the MySQL server as {mysql_user}
  --password={mysqluser_pw}  Use {mysqluser_pw} when connecting
  --seconds={refresh}        Refresh the screen each {refresh} seconds
  --[no]idle                 Display/don't display idle threads
  --filter-user={regex}      Filter display based on user regular expression
  --filter-host={regex}      Filter display based on host regular expression
  --filter-db={regex}        Filter display based on db regular expression
  --filter-command={regex}   Filter display based on command regular expression
  --filter-state={regex}     Filter display based on state regular expression
  --filter-info={regex}      Filter display based on info regular expression
  --user={user}              Display threads for only {user}
  --manualrefresh            Wait for user input between refreshes
With that in mind, I used this command:
Code:
mtop --host=localhost --dbuser=da_admin --password=xxxxxxxx
but i get an almost empty screen on a busy server:
Code:
localhost  mysqld 5.0.67-community-log up 0 day(s),  2:16 hrs
1 threads: 1 running, 7 cached. Queries/slow: 729.0K/0 Cache Hit: 99.93%
Opened tables: 0  RRN: 700  TLW: 15  SFJ: 0  SMP: 0  QPS: 61

ID       USER     HOST             DB           TIME   COMMAND STATE        INFO
4395     da_admin localhost                            Query                show full processlist
---
Am I missing something? What I want to see is any slow queries from all the databases.

Jeff
 
Side point: Is mtop really that much better than mytop?
 
No idea. I won't know until/unless I get it working to the point that I know it's working. I suppose I can install mytop as well.

Jeff
 
It seems you are requesting the processes da_admin is using. Probably your query is the only process da_admin is using atm? The rest of the processes have different users.
 
It took me a while but I finally got mtop installed on a CentOS 5 distribution.
It looks like its not easy to install 'mtop' at CentOS 5.x.

Maybe you can write a little how-to, so more people can try this and maybe someone find out how it works.
 
It looks like its not easy to install 'mtop' at CentOS 5.x.

Maybe you can write a little how-to, so more people can try this and maybe someone find out how it works.

How about:

Code:
echo "[dag]" > /etc/yum.repos.d/dag.repo
echo "name=Dag RPM Repository for Red Hat Enterprise Linux" >> /etc/yum.repos.d/dag.repo
echo "baseurl=http://apt.sw.be/redhat/el\$releasever/en/\$basearch/dag" >> /etc/yum.repos.d/dag.repo
echo "gpgcheck=0" >> /etc/yum.repos.d/dag.repo
echo "enabled=1" >> /etc/yum.repos.d/dag.repo
yum install mtop
 
How about:

Code:
echo "[dag]" > /etc/yum.repos.d/dag.repo
echo "name=Dag RPM Repository for Red Hat Enterprise Linux" >> /etc/yum.repos.d/dag.repo
echo "baseurl=http://apt.sw.be/redhat/el\$releasever/en/\$basearch/dag" >> /etc/yum.repos.d/dag.repo
echo "gpgcheck=0" >> /etc/yum.repos.d/dag.repo
echo "enabled=1" >> /etc/yum.repos.d/dag.repo
yum install mtop
Didn't tried YUM with dag, if that worked.

Thanks :)

Here a short one
wget http://dave.t0xic.nl/yum/dag.repo -O/etc/yum.repos.d/dag.repo
yum install mtop --enablerepo=dag

Anyways, here is mtop working perfectly, without special changes.
 
Last edited:
It seems you are requesting the processes da_admin is using. Probably your query is the only process da_admin is using atm? The rest of the processes have different users.

He did not use:
Code:
--user={user}              Display threads for only {user}
 
What I want to see is any slow queries from all the databases.

Maybe you don't have any slow queries. With my test I added:
Code:
--seconds=1

It of course sped up the refresh time so I saw more transactions.
 
I think, Floyd, that I was accessing all databases, because I believe that with the DirectAdmin username/password I'm getting all the databases. Is that right?

I like your idea and I'll try 9it with --seconds= when I have an opportunity.

I didn't install dag repositories on a client server because I'm not sure if it can override any main respositories. Do you know?

Jeff
 
I think, Floyd, that I was accessing all databases, because I believe that with the DirectAdmin username/password I'm getting all the databases. Is that right?

Yes. I was able to see database queries from other users.
--user= would give you results for a specific user.

I didn't install dag repositories on a client server because I'm not sure if it can override any main respositories. Do you know?

I have not had any problems using it but if you are wary of it then you can enable it, install both mytop and mtop, then disable it.
 
Thanks, all.

This is what appears to work for us:
Code:
mtop --host=localhost --dbuser=da_admin --password=PASSWORD --seconds=1
Jeff
 
You can also do it like we are doing: just install the dag.repo and set 'enabled=0', so if you need anything you can install it by adding '--enablerepo=dag'.
 
In previous post:
Code:
echo "enabled=1" >> /etc/yum.repos.d/dag.repo

Use 0 instead if you don't want it enabled all the time.
 
Thanks, Floyd. I'll try it when I install mtop on the rest of my systems.

Jeff
 
excuse me i need to run sql-bench script tests some topics in this forum pointed me to here but this mtop is not included sql-bench am i right or not if not how can i use mtop to run tests that sql-bench
"http://dev.mysql.com/doc/refman/5.0/en/mysql-benchmarks.html"
if it does can you help me how i should do it?
 
Back
Top