root / plugins / apache / php-cgi @ e5ce7492
Historique | Voir | Annoter | Télécharger (983 octets)
| 1 | f6fb7233 | Khalid Baheyeldin | #!/bin/sh |
|---|---|---|---|
| 2 | # -*- sh -*- |
||
| 3 | # |
||
| 4 | # Plugin to monitor the number of PHP processes on the machine. |
||
| 5 | # |
||
| 6 | # Copyright Khalid Baheyeldin 2009 http://2bits.com |
||
| 7 | # |
||
| 8 | # Parameters: |
||
| 9 | # |
||
| 10 | # config (required) |
||
| 11 | # autoconf (optional - used by munin-config) |
||
| 12 | # |
||
| 13 | # Magick markers (optional - used by munin-config and som installation |
||
| 14 | # scripts): |
||
| 15 | #%# family=manual |
||
| 16 | #%# capabilities=autoconf |
||
| 17 | |||
| 18 | if [ "$1" = "autoconf" ]; then |
||
| 19 | echo yes |
||
| 20 | exit 0 |
||
| 21 | fi |
||
| 22 | |||
| 23 | if [ "$1" = "config" ]; then |
||
| 24 | echo 'graph_title Number of php-cgi processes' |
||
| 25 | echo 'graph_args --base 1000 -l 0 ' |
||
| 26 | echo 'graph_vlabel number of php-cgi processes' |
||
| 27 | echo 'graph_category apache' |
||
| 28 | echo 'graph_info This graph shows the number of php-cgi processes in the system.' |
||
| 29 | echo 'php_processes.label php-cgi' |
||
| 30 | echo 'php_processes.draw LINE2' |
||
| 31 | echo 'php_processes.info The current number of php-cgi processes.' |
||
| 32 | exit 0 |
||
| 33 | fi |
||
| 34 | |||
| 35 | echo -n "php_processes.value " |
||
| 36 | /bin/ps ax | /usr/bin/grep -i php-cgi | /usr/bin/grep -v grep | /usr/bin/wc -l | /usr/bin/sed 's/\t +//' | /usr/bin/sed 's/ *//' |
