Menu

show active connections

2003-05-18
2003-05-22
  • Scott Britton

    Scott Britton - 2003-05-18

    Hi there.  Great app.  I was looking for a way to show how many active connections were open to the webcam_server module, and came up with a bash script to do it.  I am pretty sure that showing active/open connections isn't a native function to camsource, right? 

    connections come into my server on rtsp port 554
    here is my script.  All it does is netstat and count how many connections to rtsp are seen.

    conn=$(netstat -ta | grep -c mandrake.brittonfa:rtsp)
    if [ "$conn" = "1" ]; then
            echo " $conn connection           $(date) "
    else
            echo " $conn connections          $(date) "
    fi

    I call the bash script from the text module with

    <cmd>/etc/camtext.sh</cmd>

    and the output of the script is put on each frame from the webcam_server module.  A lot of overhead I'm sure.  I can usually figure out how to get something done but rarely is it the most optimized way so I thought I would ask here if anyone has a better way to do this.

     
    • Richard Fuchs

      Richard Fuchs - 2003-05-22

      i know there should be a built-in method for getting the current connections (not only for showing it in the webcam picture, but also as an administrative interface or something). the modular/threaded design of camsource doesnt make this easier though. i'll try to think something up for the next release anyway.

       

Log in to post a comment.

MongoDB Logo MongoDB