Results 1 to 4 of 4
  1. #1

    Watchdog for slave

    because now under load my Slave´s not run so well anymore and yet after a few hours of crashing it would be good to have a watchdog.

    I am not the programmer or script writer.
    Maybe someone has a small script that monitors the slave process and then restarts it with port when it crashes?

    It's best to send an email so that you know about it.

  2. #2
    Senior Member
    Join Date
    Sep 2019
    Posts
    161
    On master:

    type :
    Code:
    echo "
    #!/bin/bash
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    if ps x |grep -v grep |grep -c mpegtv >/dev/null
    then
    echo "mpegtv... ok"
    else
    echo "mpegtv... restarting"
    /usr/local/bin/mpegtv &
    fi
    " >> /usr/local/bin/Mcheck
    echo "
    */1 *  * * *   root    /usr/local/bin/Mcheck > /dev/null " >>/etc/crontab
    chmod 755 /usr/local/bin/Mcheck
    On slave type But before change XXX to your slave port:
    Code:
    echo "
    #!/bin/bash
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    if ps x |grep -v grep |grep -c slave >/dev/null
    then
    echo "slave... ok"
    else
    echo "slave... restarting"
    /usr/local/bin/slave XXXX &
    fi
    " >> /usr/local/bin/Scheck
    echo "
    */1 *  * * *   root    /usr/local/bin/Scheck > /dev/null " >>/etc/crontab
    chmod 755 /usr/local/bin/Scheck

  3. #3
    @ PERFEKT!!! , many thanks!

    i will test it in the evening.

    but i will see for a email when its crash.

  4. #4
    Senior Member
    Join Date
    Sep 2019
    Posts
    161
    for email tweak it your self

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •