How to Read mod_proctitle Information

Navigation:  mod_proctitle >

How to Read mod_proctitle Information

Previous pageReturn to chapter overviewNext page

How to read information gathered by module

 

For reading information saved by module use the following script (the script is not in the package):

 

# cat proctitles_info.sh

#!/bin/bash

 

HTTPD=httpd

 

for pid in `/usr/bin/pgrep $HTTPD`; do

   for tid in `ls /proc/$pid/task`; do

       found=no

       for shm in `ls /dev/shm/apache_title_shm_${pid}_${tid}_* 2>/dev/null`; do

           found=yes

           title=`/usr/bin/tr -d '\0' < $shm`

           thread_id=`/bin/basename "${shm}" | sed "s/apache_title_shm_${pid}_${tid}_//"`

           echo "$pid.$tid - $thread_id - $title"

           break

       done

       if [ "$found" = "no" ]; then

           echo "$pid.$tid NOT FOUND"

       fi

   done

done

 

Here are the examples of saved by module:

 

# sh proctitles_info.sh

571258.571258 NOT FOUND

571300.571300 NOT FOUND

571303.571303 - 000000000000000 - 1466513333.6 test.cloudlinux.com GET /1.php HTTP/1.1

571304.571304 - 000000000000000 - 1466513335.3 test.cloudlinux.com GET /1.php HTTP/1.1

571305.571305 - 000000000000000 - httpd

571306.571306 - 000000000000000 - httpd

571307.571307 - 000000000000000 - httpd

571372.571372 - 000000000000000 - httpd

571374.571374 - 000000000000000 - httpd

 

Item info:

[pid].[tid] - [posix thread id] - [request info]

 

Request information can contain:

 

NOT FOUND - means that process of Apache doesn't handle requests.

httpd - request is active and waiting for new connection.

[seconds].[tenths of second] [host] [METHOD] [URL] [PROTOCOL]