Git Product home page Git Product logo

portmon's People

Contributors

sfpprxy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

portmon's Issues

Curl报错500 Internal Server Error

安装环境:Centos 7 通过GIT拉取项目
步骤:
1、拉取文件,添加权限
2、修改ini文件中的端口,执行安装
3、curl localhost:9000

奇怪的是只要我不修改默认监视端口(22和9000)就不会出现这个错误,但我修改了ini文件中的监视端口后就会报错。

报错内容:

curl localhost:9000

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
    <head>
        <title>Error: 500 Internal Server Error</title>
        <style type="text/css">
          html {background-color: #eee; font-family: sans-serif;}
          body {background-color: #fff; border: 1px solid #ddd;
                padding: 15px; margin: 15px;}
          pre {background-color: #eee; border: 1px solid #ddd; padding: 5px;}
        </style>
    </head>
    <body>
        <h1>Error: 500 Internal Server Error</h1>
        <p>Sorry, the requested URL <tt>&#039;http://localhost:9000/&#039;</tt>
           caused an error:</p>
        <pre>Internal Server Error</pre>
    </body>
</html>

日志文件:
2020-07-22 05:22:02,998 [MainThread ] {/usr/bin/portmon.py:153} [INFO ] get_statistic of
2020-07-22 05:22:18,710 [TrafficMonit] {/usr/bin/portmon.py:115} [DEBUG] {'10', '1'}
2020-07-22 05:22:18,724 [TrafficMonit] {/usr/bin/portmon.py:126} [DEBUG] init usage_disk{'22': 0, '9000': 0}
2020-07-22 05:22:18,725 [TrafficMonit] {/usr/bin/portmon.py:141} [DEBUG] {'22': 0, '9000': 0}
2020-07-22 05:23:18,793 [TrafficMonit] {/usr/bin/portmon.py:115} [DEBUG] {'10', '1'}
2020-07-22 05:23:18,807 [TrafficMonit] {/usr/bin/portmon.py:126} [DEBUG] init usage_disk{'22': 0, '9000': 0}
2020-07-22 05:23:18,808 [TrafficMonit] {/usr/bin/portmon.py:141} [DEBUG] {'22': 0, '9000': 0}
2020-07-22 05:24:18,879 [TrafficMonit] {/usr/bin/portmon.py:115} [DEBUG] {'10', '1'}
2020-07-22 05:24:18,891 [TrafficMonit] {/usr/bin/portmon.py:126} [DEBUG] init usage_disk{'22': 0, '9000': 0}
2020-07-22 05:24:18,892 [TrafficMonit] {/usr/bin/portmon.py:141} [DEBUG] {'22': 0, '9000': 0}
2020-07-22 05:25:18,961 [TrafficMonit] {/usr/bin/portmon.py:115} [DEBUG] {'10', '1'}
2020-07-22 05:25:18,971 [TrafficMonit] {/usr/bin/portmon.py:126} [DEBUG] init usage_disk{'22': 0, '9000': 0}
2020-07-22 05:25:18,972 [TrafficMonit] {/usr/bin/portmon.py:141} [DEBUG] {'22': 0, '9000': 0}

端口被扫描占用后,curl不出数据

curl不出数据,我看了一下log,看不出有什么异常,然后用tcping 服务器ip 发现9000端口无法ping通
然后在服务器上ss sport = 9000,发现9000端口被一个阿里云的ip连接占用了。
感觉这应该是导致curl不出数据的原因
微信截图_20200718211901

偶尔卡死无法curl出数据

今天刚好遇到了,看了下service status里面好像有错误提示,麻烦帮忙看看。
Apr 05 13:03:28 robot python3[6583]: @ÀrÀv
Apr 05 13:03:28 robot python3[6583]: ¾
Apr 05 13:03:28 robot python3[6583]: ½À" 400 -
Apr 05 13:03:28 robot python3[6583]: 47.102.184.30 - - [05/Apr/2020 13:03:28] "GET /HNAP1 HTTP/1.1" 404 -
Apr 05 13:03:28 robot python3[6583]: 47.102.184.30 - - [05/Apr/2020 13:03:28] code 400, message Bad request syntax ('\x16\x03\x01\x02\x00\x01\x00\x01ü\x03\x03\x0ejQüMÍ\x89¦9')
Apr 05 13:03:28 robot python3[6583]: [46B blob data]
Apr 05 13:03:28 robot python3[6583]: [1B blob data]
Apr 05 13:03:28 robot python3[6583]: [25B blob data]
Apr 05 13:03:28 robot python3[6583]: 47.102.184.30 - - [05/Apr/2020 13:03:28] "GET /nmaplowercheck1586063006 HTTP/1.1" 404 -
Apr 05 13:03:28 robot python3[6583]: 47.102.184.30 - - [05/Apr/2020 13:03:28] code 400, message Bad request syntax ("\x16\x03\x01\x02\x00\x01\x00\x01ü\x03\x03æbp\x05Ô\x052\x19µ\x90\x1dÜü\x8a_bÐ×S\x89)\x015\x88°ÇËKþ\x82Cè Ô\x83k\x165P0«¼
eïÙ0G#\x0e¬ÿ8{Ë\x12]\xad9ßÝ(6\x0c\x89\x85\x00\x9c\x13\x02\x13\x03\x13\x01\x003\x009\x005\x00/À,À0\x00£\x00\x9f̨̩̪À¯À\xadÀ£À\x9fÀ]ÀaÀWÀSÀ+À/\x00¢\x00\x9eÀ®À¬À¢À\x9eÀ\À`ÀVÀRÀ$À(\x00k\x00jÀsÀw\x00Ä\x00ÃÀ#À'\x00g\x00@ÀrÀv\x00¾\x00½À")

新版还是会偶尔卡死curl不出数据

新版还是会偶尔卡死curl不出数据,
service portmon status里面没有提示什么错误,restart以后正常。
提示这个curl: (7) Failed to connect to 161...* port 9000: Timed out,服务器是正常的。

流量统计不准确

清零以后的几天是准确的,我也不知道具体多久开始统计的数据不准,我一般30天清零一次,就差不多快到30天的样子,我发现统计的数据和实际的流量数据是对不上的。
文本部分是这个月还没执行清零的数据,图片也是这个月的数据,实际算下来的话是对不上的,清零的时候是否要把data,data_daily也一起删除?

Chain INPUT (policy ACCEPT 46090006 packets, 63728590995 bytes)
pkts bytes target prot opt in out source destination

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination

Chain OUTPUT (policy ACCEPT 36573161 packets, 65242725295 bytes)
pkts bytes target prot opt in out source destination
1521 61036 tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp spt:18025
1412290 1968559626 tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp spt:18005
26776 68875716 tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp spt:18045
180038 54744811 tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp spt:18103
1286295 3761795276 tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp spt:18111
29763 68148337 tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp spt:18154
463320 132358757 tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp spt:18165
2 88 tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp spt:18125
28 1120 tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp spt:18022
230118 780653216 tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp spt:18063
11 440 tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp spt:18130
7655412 19841725442 tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp spt:18094
1874 10494223 tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp spt:18174
4909092 13449168273 tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp spt:18066
5678177 20011020505 tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp spt:18023
image

新版无法正常工作

最新版安装以后 反倒无法正常工作了
1 安装以后指定端口后,不会更新端口的流量信息,我用iptable -nxvL看了下,指定的端口没有加入到规则里面
2 如果之前有~/.portmon 下有data和portmon.log 这两个文件里面有数据,会导致程序出错,curl出来的数据变成错误500

<html>
    <head>
        <title>Error: 500 Internal Server Error</title>
        <style type="text/css">
          html {background-color: #eee; font-family: sans-serif;}
          body {background-color: #fff; border: 1px solid #ddd;
                padding: 15px; margin: 15px;}
          pre {background-color: #eee; border: 1px solid #ddd; padding: 5px;}
        </style>
    </head>
    <body>
        <h1>Error: 500 Internal Server Error</h1>
        <p>Sorry, the requested URL <tt>&#039;http://**.**.152.200:9000/&#039;</tt>
           caused an error:</p>
        <pre>Internal Server Error</pre>
    </body>
</html>

@sfpprxy

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.