Skip to content

Commit

Permalink
连接数改成唯一端口数
Browse files Browse the repository at this point in the history
  • Loading branch information
91yun committed Aug 10, 2018
1 parent 30665a8 commit 805902c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion clients/client-psutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def ip_status():
return True
#连接数
def get_connections():
(status, output) = commands.getstatusoutput("netstat -s -t | grep 'connections established' | awk '{print $1}'")
(status, output) = commands.getstatusoutput("netstat -natu|grep ESTABLISHED |grep ::ffff:|awk '{print $4}'|sort|uniq| wc -l")
return int(output)


Expand Down
18 changes: 18 additions & 0 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM nginx

MAINTAINER 91yun https://www.91yunco

RUN apt-get update
RUN apt-get -y install gcc g++ make git
RUN git clone https://github.com/91yun/ServerStatus
RUN cp -rf /ServerStatus/web/* /usr/share/nginx/html/


WORKDIR /ServerStatus/server

RUN make
RUN pwd && ls -a

EXPOSE 80 3561

CMD nohup sh -c '/etc/init.d/nginx start && /ServerStatus/server/sergate --config=/ServerStatus/server/config.json --port=3561 --web-dir=/usr/share/nginx/html'

0 comments on commit 805902c

Please sign in to comment.