ServerStatus Remove Server

Discussion in 'Tutorials' started by Mun, Aug 9, 2014.

  1. Mun

    Mun Administrator

    So you have been running ServerStatus for awhile now and now one of your servers has been closed down to what ever reason. Let it be bad service to a termination, you still have a constant down notification on your ServerStatus page and you want it gone. Here is how to do just that.

    Requirements:
    ServerStatus installed (if you haven't here is how)
    Putty or some other SSH client
    Basic Linux knowledge.


    Step 1!
    Determine what needs to be removed! I suggest you go to your ServerStatus page and simple look at what you need and don't need.

    [​IMG]

    In my case I need to remove WC2 and LA Edge Node. I no longer use either of these servers, and they should go.

    Step 2!
    Login to your uptime server with ssh. Make sure you are at a prompt like the below.

    [​IMG]


    Step 3!
    We need to get into mysql, so lets run the command:
    Code:
    mysql -u root -p
    ... and then enter the password for our MYSQL installation. This password is the one you were prompted for when you installed MYSQL the first time.

    The prompt should look like the below.

    [​IMG]

    Step 4!
    Once you have successfully logged in you should see a prompt like the below.

    [​IMG]

    This is the MYSQL CLI. What we need to do now is run the command:

    Code:
    use databasename;
    where databasename is the name of your ServerStatus database. In my case it is uptime.

    Once you have finished you should see a little bit of code saying "Database changed".

    [​IMG]

    Step 5!
    Now lets run the code:
    Code:
    select * from servers;
    What this will do is show us all the servers in our database for ServerStatus.

    In my case I have shortened mine a little but here is the two servers:

    [​IMG]
    [​IMG]

    Step 6!
    It is now delete time.

    We need to run the command:
    Code:
    delete from servers where id='23';
    23 is the number in the ID field for the device you wish to delete. It should be the first column.

    If you did it right you should get a notice saying "Query OK, like in the below image.

    [​IMG]

    Rinse and repeat step 6 until you have all the servers you wish to have deleted.

    Step 7!
    Enter the command:
    Code:
    quit;
    [​IMG]

    Step 8!
    You should now be back at a normal bash prompt and you may close or do what ever else you feel like.

    [​IMG]

    Maybe an update and upgrade?

    Step 9!
    Check your ServerStatus page and make sure that you have all the IDs you wish you wanted deleted. This will require a reload of the page.

    You should now be all set, but if one was missed or you wish to clear out more servers, try restarting at step 1.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice