The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WatchMySQL Users... New Version.

Discussion in 'General Discussion' started by shaun, Aug 25, 2003.

  1. shaun

    shaun Well-Known Member

    Joined:
    Nov 9, 2001
    Messages:
    698
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    San Clemente, Ca
    I have released a new version of WatchMySQL. WatchMySQL is a script that runs in the background and watch's the amount of users logged into mysql. If a user exceeds their limit it will notify you and/or kill the user's connections if you tell it to.


    Additions/Fixs
    *fixed problem where script would die when mysql was restarted. watchmysql now checks the mysql connection on each pass and ensures it is connected.
    *removed the option to restart mysql
    *added the option to kill the abusing users


    Users can download the new version at the following locations.
    http://www.ndchost.com/solutions/licensing/cp/cpextras.php
    http://www.cplicensing.net/extras/scripts.php

    cPanel.net Support Ticket Number:
     
  2. casey

    casey Well-Known Member

    Joined:
    Jan 17, 2003
    Messages:
    2,303
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    If there is trouble, it will find me
    Okay, time for a stupid question. Can this be installed on top of the current install, or does something extra need to be done?

    cPanel.net Support Ticket Number:
     
  3. shaun

    shaun Well-Known Member

    Joined:
    Nov 9, 2001
    Messages:
    698
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    San Clemente, Ca
    sure, just replace the old version, just make sure you edit/configure it again.

    cPanel.net Support Ticket Number:
     
  4. toma1708

    toma1708 Active Member

    Joined:
    Aug 30, 2001
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    6
    Dumb question

    Hi,

    Your script looks great. Have you posted somewhere installation instructions ?

    Thanks.

    Catalin

    cPanel.net Support Ticket Number:
     
  5. Doctor

    Doctor Well-Known Member

    Joined:
    Apr 26, 2003
    Messages:
    180
    Likes Received:
    0
    Trophy Points:
    16
    How to run a background script?

    Shaun, it is very generous of you to share such great script. If you could pepper your generosity with a step-by-step instruction on how to run it in the background, it would help a lot of newbies like me. :)

    cPanel.net Support Ticket Number:
     
  6. Doctor

    Doctor Well-Known Member

    Joined:
    Apr 26, 2003
    Messages:
    180
    Likes Received:
    0
    Trophy Points:
    16
    To make watchmysql runs in the background, should I first rename the file to watchmysql.pl? Then should I run it once only perl watchmysql.pl? Or should I set a cronjob to run it every 10 minutes?

    cPanel.net Support Ticket Number:
     
  7. NeutralGold

    NeutralGold Well-Known Member

    Joined:
    Jun 5, 2002
    Messages:
    233
    Likes Received:
    0
    Trophy Points:
    16
    su - to root
    nohup ./watchmysql &
    or
    ./watchmysql &

    cPanel.net Support Ticket Number:
     
  8. Doctor

    Doctor Well-Known Member

    Joined:
    Apr 26, 2003
    Messages:
    180
    Likes Received:
    0
    Trophy Points:
    16


    Thanks for the tip! If I logout from shell, will it still run in the background? What if I want to stop it from running in the background?

    cPanel.net Support Ticket Number:
     
  9. Doctor

    Doctor Well-Known Member

    Joined:
    Apr 26, 2003
    Messages:
    180
    Likes Received:
    0
    Trophy Points:
    16
    Below is the screen output:

    $ nohup ./watchmysql &
    [1] 21776
    $ nohup: appending output to `nohup.out'
    [1]+ Exit 126 nohup ./watchmysql

    Does this mean watchmysql is now running or exited? I type $ jobs but nothing came up. How do I check if it is running? And how do I kill it? Should I type $ kill %1?

    cPanel.net Support Ticket Number:
     
  10. Doctor

    Doctor Well-Known Member

    Joined:
    Apr 26, 2003
    Messages:
    180
    Likes Received:
    0
    Trophy Points:
    16
    I CHMOD the file to 755 and try run it again with "nohup ./watchmysql &" and this time it works. But as soon as I logout and re-login again, it doesn't display when I type "jobs". So how do I know if it actually is running and how do I kill it?

    If I reboot the server, will it still run in the background?
     
  11. Finkinstein

    Finkinstein Well-Known Member

    Joined:
    Mar 21, 2003
    Messages:
    131
    Likes Received:
    0
    Trophy Points:
    16
    Just type "ps" to see if it's running.

    To kill it type "kill pid" The pid is the first number given from ps on the watchmysql row.

    If your server reboots you have to start it again unless you set it to load on start up.. I think.

    Edit:
    Only just realised how old this thread was... oh well, its still reference. :)
     
  12. shaun

    shaun Well-Known Member

    Joined:
    Nov 9, 2001
    Messages:
    698
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    San Clemente, Ca
    Sorry for not responding, the forum just told me about a reply.

    to see if it's running type ps aux|grep watchmysql

    or you can type ps auxf and just look for it.
     
  13. Solokron

    Solokron Well-Known Member

    Joined:
    Aug 8, 2003
    Messages:
    849
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Seattle
    cPanel Access Level:
    DataCenter Provider
    Old thread but I am finding the need to use watchmysql.pl

    Is placing a reference in /etc/rc.d/rc.local fine?
     
  14. bhanuprasad1981

    bhanuprasad1981 Well-Known Member

    Joined:
    Aug 5, 2008
    Messages:
    222
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    i just installed it yesterday , but today found that script is not running , dont know why it stopped, any idea how can we add this script to be monitored ?
     
Loading...

Share This Page