Re: gnugk watcher/wrapper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I wrote this bash script to check my gnugk

#!/bin/bash
date=`date`
declare -i flag=0
if [ -e "/var/run/gnugk/gnugk.pid" ]; then
        echo $date "GK pid exists." >> /var/log/gnugk/checkgk.log
else
        let flag=1
        error="$date -  gnugk pid not found"
        echo "$date -  gnugk pid not found" >> /var/log/gnugk/checkgk.log
fi
ps aux | grep gnugk.ini | grep -v grep > /dev/null
if [ $? -gt 0 ]; then
        let flag=1
        error="$date - gnugk process not found in grep"
        echo "$date - gnugk process not found in grep" >> /var/log/gnugk/checkgk.log
        ps aux | grep gnugk.ini >> /var/log/gnugk/checkgk.log
        netstat -an | grep 7000 >> /var/log/gnugk/checkgk.log
        netstat -an | grep 1720 | grep EST >> /var/log/gnugk/checkgk.log
else
        echo $date "GK process found OK" >> /var/log/gnugk/checkgk.log
fi
if [ $flag -gt 0 ]; then
        echo "$date - Bad Flag - Restarting GK" >> /var/log/gnugk/checkgk.log
        /etc/init.d/gnugkd restart >> /var/log/gnugk/checkgk.log
        ps aux | grep gnugk.ini >> /var/log/gnugk/checkgk.log
        netstat -an | grep 7000 >> /var/log/gnugk/checkgk.log
        /usr/bin/email -q -s "GK Alert $HOST" your.email@xxxxxxxxxx < /var/log/gnugk/checkgk.log | grep $date
fi




David Winter Senior Network Engineer Planet-Telecom, Inc. Tampa FL (813)864-3161 Office (813)864-3162 Direct (813)817-4204 Mobile (813)881-9762 Fax ------------------------------------------ AIM: mobofool ICQ: 3563403 MSN: dwinter@xxxxxx Y!: vt_fool


Shashi Dahal wrote:
Hi,

From time to time, my gnugk dies with the error:

Assertion fail: Function pthread_create failed, file tlibthrd.cxx,
line 747, Error=12

I assume it has something to do with kernel compile.

my system is a p4 3.2 ghz hyperthread with 1gb ram running redhat enterprize 3.

Till the time that I land into a solution for solving this, is there
some kind of script available that will watch the gnugk and in case it
dies or give errors, it restarts it automatically?


Thanks,


------------------------------------------------------- This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8

_______________________________________________________

List: Openh323gk-users@xxxxxxxxxxxxxxxxxxxxx
Archive: http://sourceforge.net/mailarchive/forum.php?forum_id=8549
Homepage: http://www.gnugk.org/


-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8

_______________________________________________________

List: Openh323gk-users@xxxxxxxxxxxxxxxxxxxxx
Archive: http://sourceforge.net/mailarchive/forum.php?forum_id=8549
Homepage: http://www.gnugk.org/

[Index of Archives]     [SIP]     [Open H.323]     [Gnu Gatekeeper]     [Asterisk PBX]     [ISDN Cause Codes]     [Yosemite News]

  Powered by Linux