Announcement

Collapse
No announcement yet.

MySql monitoring script

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • wikkiss
    replied
    very nice script i must say! im using it

    Leave a comment:


  • vidom2
    replied
    It is possible to use Checksum MySQL (http:// adm-it . net/checksum-mysql)

    Leave a comment:


  • farhanzahidi
    replied
    Hi,

    This is wonderful script and good to monitor the mysql service. However, you need to make two changes in the script in order to work.

    o=$(ps cax | grep -c ' mysqld$')
    if [ $o -eq 1 ]; then

    Edit these two lines to the below.

    o=$(ps cax | grep -c ' mysqld')
    if [ $o -ge 1 ]; then

    It will work as expected.

    Farhan Zahidi
    System Engg

    Leave a comment:


  • farhanzahidi
    replied
    Hi,

    This is wonderful script and good to monitor the mysql service. However, you need to make two changes in the script in order to work.

    o=$(ps cax | grep -c ' mysqld$')
    if [ $o -eq 1 ]; then

    Edit these two lines to the below.

    o=$(ps cax | grep -c ' mysqld')
    if [ $o -ge 1 ]; then

    It will work as expected.

    Farhan Zahidi
    System Engg

    Leave a comment:


  • darrenw
    replied
    Originally posted by eukhost.com View Post
    chkservd checks status of services every minute so it will restart MySQL as soon as it goes down. There may be some other reason why MySQL fails and you need to question our support team about this problem. none of our shared, reseller, semi-dedicated or dedicated hosting customers face this problem. This seems to happen on VPS Hosting's only as VPS Hosting seem to run short of memory for MySQL intensive website hostings. question our support team and find out the reason for this problem. It is possible that chkservd is down on your VPS Hosting
    Unfortunately, MySQL Server has failed yet again for the third time in the last couple of days. The support ticket id is #DIT-48131-863

    Leave a comment:


  • eUKhost.com
    replied
    chkservd checks status of services every minute so it will restart MySQL as soon as it goes down. There may be some other reason why MySQL fails and you need to question our support team about this problem.

    none of our shared, reseller, semi-dedicated or dedicated hosting customers face this problem. This seems to happen on VPS Hosting's only as VPS Hosting seem to run short of memory for MySQL intensive website hostings. question our support team and find out the reason for this problem. It is possible that chkservd is down on your VPS Hosting

    Leave a comment:


  • darrenw
    replied
    Originally posted by eukhost.com View Post
    I dont see any reason to install service monitoring scripts on cPanel VPS Hosting. cPanel has got its inbuilt service monitoring and chkservd will automatically restart any downed service. If you need sim even after knowing this then open a ticket for our VPS Hosting support team and they will install sim on your VPS Hosting.
    Hi,

    For some reason, the MySQL service keeps intermittently failing for no apparent reason. How often does chkservd check downed services? Does it include mysql?

    Many thanks,
    Darren.

    Leave a comment:


  • eUKhost.com
    replied
    Originally posted by darrenw View Post
    I've tried to install this on my VPS Hosting, but when I follow the instructions and run setup, nothing seems to appear in the default directories.

    Is there any help available for installing this on an eUKHost VPS Hosting server?

    Many thanks,
    Darren.
    I dont see any reason to install service monitoring scripts on cPanel VPS Hosting. cPanel has got its inbuilt service monitoring and chkservd will automatically restart any downed service. If you need sim even after knowing this then open a ticket for our VPS Hosting support team and they will install sim on your VPS Hosting.

    Leave a comment:


  • darrenw
    replied
    Originally posted by eUKAlex View Post
    Guys, I will suggest you to go for "System Integrity Monitor" which is best to monitor critical services, load, network etc on the server.

    http://www.rfxnetworks.com/sim.php
    I've tried to install this on my VPS Hosting, but when I follow the instructions and run setup, nothing seems to appear in the default directories.

    Is there any help available for installing this on an eUKHost VPS Hosting server?

    Many thanks,
    Darren.

    Leave a comment:


  • Scott
    replied
    Guys, I will suggest you to go for "System Integrity Monitor" which is best to monitor critical services, load, network etc on the server.

    http://www.rfxnetworks.com/sim.php

    Leave a comment:


  • Grimmjow
    replied
    may i ask, will that SQL Server query work on a database that is hosted by trap17,or will i have to edit it in any way?

    Leave a comment:


  • daniel-s
    replied
    eUKShane can you confirm that the script really works?

    Leave a comment:


  • Access Denied
    replied
    Hi Iain,

    No, you will not receive any alert mails as the above mentioned script does.

    But, you can also check the "CPU/Memory/MySQL" Usage from the WHM >> Server Status >> CPU/Memory/MySQL Usage and apache load from WHM >> Server Status >> Apache Status.

    Leave a comment:


  • ebotunes
    replied
    Hi Shane,

    I have enabled monitoring of MySQL Server and httpd through my WHM - do you know if these will send email alerts as well, as your script seems to do?

    thanks,
    Iain

    Leave a comment:


  • eUKShane
    started a topic MySql monitoring script

    MySql monitoring script

    Hi everyone!

    Please use following script which will monitor MySQL Server service and will automatically restart it if its down.

    #!/bin/bash

    # MySQL Server root/admin username
    MUSER="root"

    # MySQL Server admin/root password
    MPASS="SET-ROOT-PASSWORD"

    # MySQL Server hostname
    MHOST="localhost"

    #Shell script to start MySQL server i.e. path to MySQL daemon start/stop script.
    MSTART="/etc/init.d/mysql start"

    # Email ID to send notification
    EMAILID="[email protected]"

    # path to mail program
    MAILCMD="$(which mail)"

    # path mysqladmin
    MADMIN="$(which mysqladmin)"

    #### DO NOT CHANGE anything BELOW ####
    MAILMESSAGE="/tmp/mysql.fail.$$"

    # see if MySQL server is alive or not
    # 2&1 could be better but i would like to keep it simple and easy to
    # understand stuff
    $MADMIN -h $MHOST -u $MUSER -p${MPASS} ping 2>/dev/null 1>/dev/null
    if [ $? -ne 0 ]; then
    echo "" >$MAILMESSAGE
    echo "Error: MySQL Server is not running/responding ping request">>$MAILMESSAGE
    echo "Hostname: $(hostname)" >>$MAILMESSAGE
    echo "Date & Time: $(date)" >>$MAILMESSAGE
    # try to start mysql
    $MSTART>/dev/null
    # see if it is started or not
    o=$(ps cax | grep -c ' mysqld$')
    if [ $o -eq 1 ]; then
    sMess="MySQL Server MySQL server successfully restarted"
    else
    sMess="MySQL server FAILED to restart"
    fi
    # Email status too
    echo "Current Status: $sMess" >>$MAILMESSAGE
    echo "" >>$MAILMESSAGE
    echo "*** This email generated by $(basename $0) shell script ***" >>$MAILMESSAGE
    echo "*** Please don't reply this email, this is just notification email ***" >>$MAILMESSAGE
    # send email
    $MAILCMD -s "MySQL server" $EMAILID < $MAILMESSAGE
    else # MySQL is running and do nothing
    :
    fi
    # remove file
    rm -f $MAILMESSAGE
    You just have to do some minor changes in this script (mysql password, email ID etc).

    Then set a cron to run according to your requirement for the above script.

    for eg.
    */15 * * * * ./(path to script) > /dev/null 2>&1
    This will run the script in every 15 mins.

    That's all !!


    Best Regards,
    eUKShane
    http://www.eukhost.com
Working...
X