Ever thought about mytop ?

Work related i do a lot of things with MySQL/MariaDB. If you ever wanted to real-time monitor your system i guess you want to use mytop as well

S | Name  | Summary               | Type
--+-------+-----------------------+--------
  | mytop | A top Clone for MySQL | package

you can easily install it with

zypper in mytop

Now you can start it with

mytop -p <passord> -s 1

The option

  • -p tell it to use the password during connection
  • -s <seconds> tells the update intervall

Now you should see something like

MySQL on localhost (5.5.23-MariaDB-mariadb1~squeeze-log)   up 24+03:17:13 [11:27:05]
 Queries: 271.0   qps:    0 Slow:     0.0         Se/In/Up/De(%):    121540/00/00/00
              qps now:    2 Slow qps: 0.0  Threads:    2 (   1/  17) 00/00/00/00
 Key Efficiency: 98.8%  Bps in/out:   0.0/  0.8   Now in/out:  41.4/11.3k

        Id      User         Host/IP         DB      Time    Cmd Query or State
        --      ----         -------         --      ----    --- --------------
     47030      root       localhost                    0  Query show full processlist
     47033   froxlor localhost:47453    froxlor        57  Sleep
Posted in mariadb, openSUSE | Leave a comment

[openSUSE] Something strange…

… happens every day.

Some days ago i switched to the latest factory snapshot of openSUSE 12.2. Right after the first boot after installation my screen turns black and i cant access any console. Strange, i played around with the x11failsafe which worked, and thought the problem is maybe part of the mode selections suse does to get a beautiful screen. so i did

bootoption: nomodest

and it worked. I made an bug report and changed the default boot-loader settings to always do this nomodeset. But more strange…

On monday my boss allowed me to use SLED (SUSE Linux Enterprise Desktop) for a 60day trial first and the option to buy a license if it does the job. And i had just the same problem (on a total different hardware regarding ATINvidia, chipset, processor) nomodeset fixed it again. But it shouldn’t be made that way.

Update:
As i was told some minuits ago it is also possible to do switch NO_KMS_IN_INITRD to “yes” and a new initrd is generated, which should solve the problem also. I will test it later at home.

Posted in openSUSE, Uncategorized | Leave a comment

Remote Shell Command for XEN usage

I do not know if you use nagios, i guess most people do. There is a very nice addition to configure nagios it is called nagiosql (http://www.nagiosql.org/).

So maybe in addition to that you sometimes have an problem like i do. We use xen servers with some virtual machines. So sometimes i have an issue which belongs to every machine on an _parent_ xen server. Normally i send an ssh command to all of them. When it comes to the point where these are some hundred once it really sucks. So i wrote a script to do so, which setsup on the nagiosql structure.

What do we need:

  • Nagiosql and host with the _parent_ variable set
  • an DB user which can do select on the db_nagiosql
  • an key login via ssh on all machines
  • ruby :-)

So here is the script

#!/usr/bin/ruby -w
# ruby mysql query ssh command to all childs of parent
#
# by Jörg Stephan &lt;j AT xadmin DOT info&gt;
#
# Usage:
# -p &lt;parent&gt; # zB xenone
# -c &lt;command&gt; # zB "ls -la"
#
require 'mysql'
require 'net/ssh'

begin
parent = ""
command = ""

if ARGV.length &lt; 4
puts "Usage: rshdo.rb -p &lt;parent&gt; -c &lt;command&gt;"
exit
end
ARGV.each_with_index do |arg, index|
if arg == "-p"
parent= ARGV[index + 1]
elsif arg == "-c"
command = ARGV[index + 1]
end
end
# connect to the MySQL server
dbh = Mysql.real_connect("nagiosserver", "client", "ultrastrengthpassword", "db_nagiosql")
res = dbh.query("select host_name from tbl_host where id IN (select idMaster from tbl_lnkHostToHost where idSlave = (select id from tbl_host where host_name='" + parent + "'))")
while row = res.fetch_row do
puts row[0]
begin
Net::SSH.start(row[0], 'root' , :host_key =&gt; "ssh-rsa", :keys =&gt; ["/root/.ssh/id_dsa"] ) do |ssh|
result = ssh.exec " " + command + " "
puts result
end
rescue Net::SSH::AuthenticationFailed =&gt; e
puts row[0] + " Error while connecting " + e
end
end
rescue Mysql::Error =&gt; e
puts "Error code: #{e.errno}"
puts "Error message: #{e.error}"
puts "Error SQLSTATE: #{e.sqlstate}" if e.respond_to?("sqlstate")
ensure
# disconnect from server
dbh.close if dbh
end

now your are able to to

shell#> ruby rshdo.rb -p <parenthost> -c <shell command>

and you send the <shell command>  to every host whichs parent is <parenthost>

 

 

Posted in openSUSE, Uncategorized | Leave a comment

[OpenIndiana] On a desktop

I did a fresh install of openindiana on my Desktop. First of all it worked with no problem.

So, if you want to install it too you should download the livecd first (here). If you boot the livecd you will see the Gnome Desktop (The old Version 2) There is a little helperprogram which shows you the setup of your computer and if the components are supported

In German it is the “Gerätetreiber Dienstprogramm” never saw the english name for it, but its right on the desktop.

So if everything works you can start the installer. There are no problems, choose a disk (i have choosen my sda) and set user and admin. What really sucks (!!!) is that your root passwort is expired right after you start your pc again, so maybe choose a weak one first, you need to change it anyway.

Thats the reason why your prog manager does not start :-) The password is expired.

I would recommend to go to the console, become root (“su -”) and install a new pkg version by

  • pkg install package/pkg

and do a

  • pkg update

afterwards

Regards

Posted in openindiana | Leave a comment

[openSUSE] Upgrade to a Milestone

I just added

http://download.opensuse.org/factory-snapshot/repo/oss/

via YaST and run an upgrade to the latest snapshot of the current openSUSE 12.2 milestone.

 

Posted in openSUSE | Leave a comment