check_netsaint for database support (postgresql)

"Jason Truong" <[email protected]>
Newsgroups gmane.network.netsaint.user
Message-ID <[email protected]>
Just wondering if anyone out there has written a check_netsaint script that works to with a netsaint install under postgresql.  Since I included database support, there no longer exists a status.log.  When I try to implement my new check_netsaint script in the nscgi.cfg file, it does not work displaying an error.  Here is my check_netsaint2 script which I believe only has to return a OK, WARNING or CRITICAL repsonse right?  Any help is appreciated.  The original check_netsaint script works with the netsaint.log half the time.

thank you.

Jason T.

script below (very basic) where $2 is 'netsaint'

#! /bin/sh
PROGNAME=`basename $0`
PROGPATH=`echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,'`

. $PROGPATH/utils.sh

print_usage() {
  echo "Usage:"
  echo "  $PROGNAME -C Command to search for in process table"
  echo
}

case "$1" in
1)
    cmd='-C'
    ;;
*)
    cmd="$1"
    ;;
esac

case "$cmd" in
-C)
        /bin/ps -aux | grep $2 > netsaintrun.temp
        check1=$(/bin/cat ./netsaintrun.temp | grep -c netsaint)
        if [ ${check1} -gt 0 ]; then
        echo "OK - Service is alive"
        exit ${STATE_OK}
    else
        echo "Service is stopped on $2"
	  exit $STATE_CRITICAL
    fi
    ;;
*)
    print_usage
                exit $STATE_UNKNOWN
esac

                     


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.