Unix process

[Deleted User][Deleted User]

Hi,

I have to check 5 Unix processes with the same name. I need an alert, if one process is down. How can I do that?

Thanks in advance

Henry

Comments

  • AdministratorAdministrator
    This is not possible with the current version. The process needs to have a unique name
  • [Deleted User][Deleted User]

    Try a script like this and name to for example: my_proc_check
    start it like: ./my_proc_check process_name numof_process for example:

    ./my_proc_check httpd 9 >/var/log/my_proc_check.log 2>&1 &

    Then set up serverscheck to watch for process my_proc_check instead. When one httpd process die also my_proc_check will die and you get an alert.

    Regards,
    Bert

    #!/bin/sh
    NUMOF_PROC=$2
    PROC_NAME=$1
    echo "Search for $NUMOF_PROC instance of process: $PROC_NAME."
    while [ 1==1 ]; do
    if [ "`ps -A | grep $PROC_NAME | wc | awk '{print $1}'`" != "$NUMOF_PROC" ];then
    echo "Too few processes, exit...";
    exit;
    fi
    sleep 15
    done

This discussion has been closed.