Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

process list?

  • 03-01-2002 11:06AM
    #1
    Registered Users, Registered Users 2 Posts: 6,265 ✭✭✭


    ps -ef | grep radius_listener
    ps -ef | grep smpp_gateway
    ps -ef | grep certificate_handler
    ps -ef | grep connectionless
    ps -ef | grep connection_oriented
    ps -ef | grep secure_connectionless
    ps -ef | grep secure_connection_oriented
    ps -ef | grep whttp
    ps -ef | grep apacheuser
    ps -ef | grep push_delivery_service
    ps -ef | grep charging
    ps -ef | grep stats

    that is in a script
    output:

    miepadm 17414 1 0 10:51:45 pts/8 0:00 ./radius_listener
    miepadm 18108 18106 0 11:03:58 pts/8 0:00 grep radius_listener
    miepadm 17415 1 0 10:51:45 pts/8 0:00 ./smpp_gateway
    miepadm 18110 18106 0 11:03:58 pts/8 0:00 grep smpp_gateway
    miepadm 17416 1 0 10:51:45 pts/8 0:00 ./certificate_handler
    miepadm 18112 18106 0 11:03:58 pts/8 0:00 grep certificate_handler
    miepadm 18114 18106 0 11:03:58 pts/8 0:00 grep connectionless
    miepadm 17417 1 0 10:51:45 pts/8 0:01 ./connectionless
    miepadm 18116 18106 0 11:03:58 pts/8 0:00 grep connection_oriented
    miepadm 17418 1 0 10:51:45 pts/8 0:03 ./connection_oriented
    miepadm 18118 18106 0 11:03:58 pts/8 0:00 grep secure_connectionless
    miepadm 18120 18106 0 11:03:58 pts/8 0:00 grep secure_connection_oriented
    miepadm 18122 18106 0 11:03:58 pts/8 0:00 grep whttp
    miepadm 17421 1 0 10:51:45 pts/8 0:01 ./whttp
    miepadm 18124 18106 0 11:03:58 pts/8 0:00 grep apacheuser
    miepadm 18126 18106 0 11:03:58 pts/8 0:00 grep push_delivery_service
    miepadm 17423 1 0 10:51:45 pts/8 0:00 ./push_delivery_service
    miepadm 18128 18106 0 11:03:59 pts/8 0:00 grep charging
    miepadm 17410 1 0 10:51:45 pts/8 0:00 ./charging
    miepadm 18130 18106 0 11:03:59 pts/8 0:00 grep stats
    miepadm 17411 1 0 10:51:45 pts/8 0:00 ./stats

    i want to get rid of the grep bits.
    any ideas?

    MiCr0


Comments

  • Registered Users, Registered Users 2 Posts: 1,562 ✭✭✭Snaga


    <snip silly answer>

    nm redoing that attempt :D


  • Registered Users, Registered Users 2 Posts: 1,982 ✭✭✭ObeyGiant


    (kludgy - may be a "prettier" way of doing this)
    Throw a 'grep -v grep' at the end of each of those?
    e.g.
    ps -ef | grep radius_listener | grep -v grep
    


  • Registered Users, Registered Users 2 Posts: 171 ✭✭Wookie


    try:

    ps -ef | grep radius_listener | grep -v grep
    ...
    ...


    in your script, it should give you a 'cleaner' output


  • Moderators, Social & Fun Moderators Posts: 10,501 Mod ✭✭✭✭ecksor


    ps -ef | grep '[r]adius_listener'
    ...
    ...


  • Registered Users, Registered Users 2 Posts: 171 ✭✭Wookie


    Ok Now for complete overkill :)

    Modify script as follows:

    ps -ef | grep radius_listener | grep -q -v grep
    if [ $? = 0 ]
    then
    echo 'radius_listener: Successful'
    else
    echo 'radius_listener: Unsuccessful'
    fi

    ps -ef | grep smpp_gateway | grep -q -v grep
    if [ $? = 0 ]
    then
    echo 'smpp_gateway : Successful'
    else
    echo 'smpp_gateway : Unsuccessful'
    fi

    . . .


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 6,265 ✭✭✭MiCr0


    and if u throw in a 1>/dev/null @ the end of the search line its even better.

    cheers
    //david


Advertisement