Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ngxtop is not working at all #87

Open
manas86 opened this issue Jan 24, 2018 · 1 comment
Open

ngxtop is not working at all #87

manas86 opened this issue Jan 24, 2018 · 1 comment

Comments

@manas86
Copy link

manas86 commented Jan 24, 2018

hi all,

As, I stated above ngxtop doesn't work other than ngxtop info.
can anyone have similar issue, if so then how did they solve it( i have python 2.7.5).
Or i'm doing something silly here?

sh-4.2$ ngxtop info
nginx configuration file:
/etc/nginx/nginx.conf
access log file:
/var/log/nginx/access.log
access log format:
$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" "$http_x_forwarded_for"
available variables:
body_bytes_sent, http_referer, http_user_agent, http_x_forwarded_for, remote_addr, remote_user, request, status, time_local
sh-4.2$ ngxtop top remote_addr
Traceback (most recent call last):
File "/usr/bin/ngxtop", line 11, in
sys.exit(main())
File "/usr/lib/python2.7/site-packages/ngxtop/ngxtop.py", line 385, in main
process(args)
File "/usr/lib/python2.7/site-packa
ges/ngxtop/ngxtop.py", line 370, in process
process_log(source, pattern, processor, arguments)
File "/usr/lib/python2.7/site-packages/ngxtop/ngxtop.py", line 267, in process_log
processor.process(records)
File "/usr/lib/python2.7/site-packages/ngxtop/ngxtop.py", line 215, in process for r in records:
File "/usr/lib/python2.7/site-packages/ngxtop/ngxtop.py", line 148, in add_field for item in dict_sequence:
File "/usr/lib/python2.7/site-packages/ngxtop/ngxtop.py", line 135, in map_field for item in dict_sequence:
File "/usr/lib/python2.7/site-packages/ngxtop/ngxtop.py", line 135, in map_field for item in dict_sequence:
File "/usr/lib/python2.7/site-packages/ngxtop/ngxtop.py", line 148, in add_field for item in dict_sequence:
File "/usr/lib/python2.7/site-packages/ngxtop/ngxtop.py", line 148, in add_field for item in dict_sequence: File "/usr/lib/python2.7/site-packages/ngxtop/ngxtop.py", line 135, in map_field
for item in dict_sequence:File "/usr/lib/python2.7/site-packages/ngxtop/ngxtop.py", line 187, in
records = (m.groupdict() for m in matches if m is not None) File "/usr/lib/python2.7
/site-packages/ngxtop/ngxtop.py", line 186, in matches = (pattern.match(l) for l in lines) File "/usr/lib/python2.7/site-packages/ngxtop/ngxtop.py", line 121, in follow
f.seek(0, 2) # seek to eof IOError: [Errno 29
] Illegal seek sh-4.2$ ngxtop top remote_addr
Traceback (most recent call last):
File "/usr/bin/ngxtop", line 11, in
sys.exit(main())
File "/usr/lib/python2.7/site-packages/ngxtop/ngxtop.py", line 385, in main
process(args)
File "/usr/lib/python2.7/site-packa
ges/ngxtop/ngxtop.py", line 370, in process
process_log(source, pattern, processor, arguments)
File "/usr/lib/python2.7/site-packages/ngxtop/ngxtop.py", line 267, in process_log
processor.process(records)
File "/usr/lib/python2.7/site-packages/ngxtop/ngxtop.py", line 215, in process for r in records:
File "/usr/lib/python2.7/site-packages/ngxtop/ngxtop.py", line 148, in add_field for item in dict_sequence:
File "/usr/lib/python2.7/site-packages/ngxtop/ngxtop.py", line 135, in map_field for item in dict_sequence:
File "/usr/lib/python2.7/site-packages/ngxtop/ngxtop.py", line 135, in map_field for item in dict_sequence:
File "/usr/lib/python2.7/site-packages/ngxtop/ngxtop.py", line 148, in add_field for item in dict_sequence:
File "/usr/lib/python2.7/site-packages/ngxtop/ngxtop.py", line 148, in add_field for item in dict_sequence: File "/usr/lib/python2.7/site-packages/ngxtop/ngxtop.py", line 135, in map_field
for item in dict_sequence:File "/usr/lib/python2.7/site-packages/ngxtop/ngxtop.py", line 187, in
records = (m.groupdict() for m in matches if m is not None) File "/usr/lib/python2.7
/site-packages/ngxtop/ngxtop.py", line 186, in matches = (pattern.match(l) for l in lines) File "/usr/lib/python2.7/site-packages/ngxtop/ngxtop.py", line 121, in follow
f.seek(0, 2) # seek to eof IOError: [Errno 29
] Illegal seek

@m3talstorm
Copy link

I was getting roughly the same error when I was passing in a log that was completely empty.

This was because the offical Docker image I was using here, links /var/log/nginx/access.log to /dev/stdout, so when you do ngxtop -l /var/log/nginx/access.log, you are actually reading stdout, which is empty :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants