|es|f| esniper frontend

By TwitterButtons.com

Monitor your esniper processes

For a simple status monitoring for your esniper processes you can use (and/or adapt) this simple script.

#!/bin/sh

if [ -z "$1" -o -z "$2" ]; then
  echo "usage: $0 <AccountName> <emailAdress>"
  exit 1
fi

user="$1"
email="$2"

file=/tmp/esniper.status.$user

new=$(ps ax | grep -e "[ /]esniper" | grep -e "$user$" | wc -l)

test ! -f $file && old=0 || read old < $file
echo -n $new >$file

if [ $new -lt $old ]; then
  ( ps ax | grep -e "[ /]esniper" | grep -e "$user$"
    echo -------------------------------------------------------
    tail -n 100 /var/log/syslog
  ) | mail -s "$(date +'%x - %X') : $old => $new" $email
fi

This script send a mail, if the actual esniper process count is lower than the count on last check.

The script needs 2 parameters

Just put the following into your crontab (one line) to check the processes each minute:

* * * * * /path/to/sniperstatus.sh MyAccountName MyEmail@AnyDomain.TLD

and you get an email each time, if the esniper process count decreases.