全部博文(317)
分类: LINUX
2015-07-28 10:26:18
1
2
3
4
|
#!/usr/bin/perl
use strict;
my $pw=$ARGV[0];
print crypt ($pw,$pw). "\n" ;
|
1
2
3
4
5
6
|
location /nginx-status {
auth_basic "NginxStatus" ;
stub_status on;
access_log on;
auth_basic_user_file /lnmp/nginx/conf/htpasswd ;
}
|
1
2
3
4
5
6
7
8
9
10
|
#!/bin/bash
QINGQIU1=`curl -s http: //ip/nginx-status | awk '/server accepts handled requests/ {getline a;split(a,s); print s[length(s)]}' `
sleep 5
QINGQIU2=`curl -s http: //ip/nginx-status | awk '/server accepts handled requests/ {getline a;split(a,s); print s[length(s)]}' `
if [ $QINGQIU2 -gt 0 ]
then
QINGQIU=` expr $QINGQIU2 - $QINGQIU1`
PER=` expr $QINGQIU / 5`
echo "The nginx request is ${PER} per second"
fi
|