-
Notifications
You must be signed in to change notification settings - Fork 4
/
phpfpm_status.sh
43 lines (42 loc) · 1.27 KB
/
phpfpm_status.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
# Monitor phpfpm by zabbix
#
response="curl -s http://127.0.0.1/phpfpm_status"
case $1 in
startSince)
$response | awk '/^start since:/{print $NF}'
;;
acceptedConn)
$response | awk '/^accepted conn:/{print $NF}'
;;
listenQueue)
$response | awk '/^listen queue:/{print $NF}'
;;
maxListenQueue)
$response | awk '/^max listen queue:/{print $NF}'
;;
listenQueueLen)
$response | awk '/^listen queue len:/{print $NF}'
;;
idleProcesses)
$response | awk '/^idle processes:/{print $NF}'
;;
activeProcesses)
$response | awk '/^active processes:/{print $NF}'
;;
totalProcesses)
$response | awk '/^total processes:/{print $NF}'
;;
maxActiveProcesses)
$response | awk '/^max active processes:/{print $NF}'
;;
maxChildrenReached)
$response | awk '/^max children reached:/{print $NF}'
;;
slowRequests)
$response | awk '/^slow requests:/{print $NF}'
;;
*)
echo -e "\e[031mUsage: $0 {startSince|acceptedConn|listenQueue|maxListenQueue|listenQueueLen|idleProcesses|activeProcesses|totalProcesses|maxActiveProcesses|maxChildrenReached|slowRequests}\e[0m"
exit 1
esac