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

Nothing on graphs #9

Closed
romeor opened this issue Nov 13, 2015 · 8 comments
Closed

Nothing on graphs #9

romeor opened this issue Nov 13, 2015 · 8 comments

Comments

@romeor
Copy link

romeor commented Nov 13, 2015

Hi,

I've managed to start the daemon using the -r option, but there nothing drawn on the graphs and current listeners shows nothing

@leofiore
Copy link
Contributor

hi,
first of all, please check on your icecast server that someone was listening using the icecast admin interface. Next, check the latest acces.log in the logs/ directory and look for messages like registering #n entries . This means that the system is working and entries are handled correctly

For the current listeners, please see #4 . At this moment current active listeners cannot be seen because of imperfections on the user interface. The current active listeners are not fetched because, during the loading of the interface, the interface asks for entries that have listened until the current time of loading.

E. g. if you load the ui @13Nov2015,14:54 the interface will load all the entries of listeners between @13Oct2015,14:54 AND @13Nov2015,14:54 , so if someone is continuing to listen after this range, is not fetched nor shown. To prove this, just edit the range and move the end to 2 or three minutes in the future (using the clock icon in the dropdown menu) and you'll probably see the current listeners.

@romeor
Copy link
Author

romeor commented Nov 13, 2015

-- MARK --
-- MARK --
The only output I've got.
Also I don't have any line like registering in access logs :(
There are around 400 users listening to the radio atm.

2015-11-13 16:09 GMT+02:00 Leonardo notifications@github.com:

hi,
first of all, please check on your icecast server that someone was
listening using the icecast admin interface. Next, check the latest
acces.log in the logs/ directory and look for messages like registering
#n entries . This means that the system is working and entries are
handled correctly

For the current listeners, please see #4
#4 . At this
moment current active listeners cannot be seen because of imperfections on
the user interface. The current active listeners are not fetched because,
during the loading of the interface, the interface asks for entries that
have listened until the current time of loading.

E. g. if you load the ui @13Nov2015,14:54 the interface will load all the
entries of listeners between @13Oct2015,14:54 AND @13Nov2015,14:54 , so
if someone is continuing to listen after this range, is not fetched nor
shown. To prove this, just edit the range and move the end to 2 or three
minutes in the future (using the clock icon in the dropdown menu) and
you'll probably see the current listeners.


Reply to this email directly or view it on GitHub
#9 (comment)
.

Best regards,
Roman.

@romeor
Copy link
Author

romeor commented Nov 13, 2015

Well, suddenly it started to draw graphs. Weird.

2015-11-13 18:10 GMT+02:00 Roman romeo.r@gmail.com:

-- MARK --
-- MARK --
The only output I've got.
Also I don't have any line like registering in access logs :(
There are around 400 users listening to the radio atm.

2015-11-13 16:09 GMT+02:00 Leonardo notifications@github.com:

hi,
first of all, please check on your icecast server that someone was
listening using the icecast admin interface. Next, check the latest
acces.log in the logs/ directory and look for messages like registering
#n entries . This means that the system is working and entries are
handled correctly

For the current listeners, please see #4
#4 . At this
moment current active listeners cannot be seen because of imperfections on
the user interface. The current active listeners are not fetched because,
during the loading of the interface, the interface asks for entries that
have listened until the current time of loading.

E. g. if you load the ui @13Nov2015,14:54 the interface will load all
the entries of listeners between @13Oct2015,14:54 AND @13Nov2015,14:54 ,
so if someone is continuing to listen after this range, is not fetched nor
shown. To prove this, just edit the range and move the end to 2 or three
minutes in the future (using the clock icon in the dropdown menu) and
you'll probably see the current listeners.


Reply to this email directly or view it on GitHub
#9 (comment)
.

Best regards,
Roman.

Best regards,
Roman.

@romeor
Copy link
Author

romeor commented Nov 13, 2015

oh, sorry for the mess.. it was OK on my test server...
on the production I get this:

Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
self.run()
File "/root/test/morganfreeman/icestats/daemon.py", line 160, in run
server_version = re.match("Icecast (.*)", server_info['Version']).groups(0)
KeyError: 'Version'

@leofiore
Copy link
Contributor

Pplease, again describe your environment, else we cannot try to reproduce the error. What icecast version do you have in production? did you cloned the application from the github repository or you copied it from test server? Are you running the latest version? Is the application trying to run in background? ecc.

Thanks for your time

@romeor
Copy link
Author

romeor commented Nov 13, 2015

Sure, no problems.
I found out that the older version in test server works fine. When I copy
it from test server to production, I see graphs.
But if I clone the project from the git, I see errors like above on both
test and production servers.

I run Icecast 2.4.2

below is diff:

diff morganfreeman/icestats/daemon.py

test/morganfreeman/icestats/daemon.py
19a20,23

ICECAST_V_2_3 = '2.3.'
ICECAST_V_2_4 = '2.4.'
ICECAST_V_KH = '-kh'

142a147,160
try:
result = urllib2.urlopen(self.host + "/server_version.xsl")
except Exception as e:
print e
logger.error("Failed update: %s", e)
result = None
resultstr = result.read()
server_info = dict(
re.findall(
'<tr[^>]>[\r\s]<td[^>]>([^\r<>]?)[\s\r]'
'<td[^>]class="streamdata"[^>]>([^\r<>]
?)',
resultstr)
)
server_version = re.match("Icecast (.*)",
server_info['Version']).groups(0)
194c212,213
< # the fourth table on listclients.xls is the relevant

one

                # the latest (fourth in vanilla, third in -kh) table
                # on listclients.xls is the relevant one

196c215

< "<table[^>]>([^\r]?)", resultstr)[3]

                    "<table[^>]*>([^\r]*?)</table>", resultstr)[-1]

206,208c225,233
< # the first row is the table header
< logger.debug("registering %d entries", len(listeners) - 1)

< for listener in listeners[1:]:

            if ICECAST_V_KH in server_version:
                rowskip = 0
            else:
                rowskip = 1
            # in icecast vanilla, first row is the
            # table header. in -kh, the header is enclosed in <thead>
            # without use of <tr>
            logger.debug("registering %d entries", len(listeners) -

rowskip)
for listener in listeners[rowskip:]:
210,214c235,247
< # fields[0]: IP
< # fields[1]: Seconds since connection
< # fields[2]: user-agent
< # fields[3]: useless kick link

< db.record(mount, fields[0], int(fields[1]), fields[2])

                if not ICECAST_V_KH in server_version: # vanilla
                    # fields[0]: IP
                    # fields[1]: Seconds since connection
                    # fields[2]: user-agent
                    # fields[3]: action
                    db.record(mount, fields[0], int(fields[1]),

fields[2])
else:
# fields[0]: IP
# fields[1]: Seconds since connection
# fields[2]: lag
# fields[3]: user-agent
# fields[4]: action
db.record(mount, fields[0], int(fields[1]),
fields[3])

2015-11-13 18:39 GMT+02:00 Leonardo notifications@github.com:

Pplease, again describe your environment, else we cannot try to reproduce
the error. What icecast version do you have in production? did you cloned
the application from the github repository or you copied it from test
server? Are you running the latest version? Is the application trying to
run in background? ecc.

Thanks for your time


Reply to this email directly or view it on GitHub
#9 (comment)
.

Best regards,
Roman.

leofiore added a commit that referenced this issue Nov 13, 2015
a too strict regular expression that should be more relaxed for icecast
2.4.2. Apparently no drawbacks for older versions.
@leofiore
Copy link
Contributor

this last commit should fix it. please pull it and try.

@romeor
Copy link
Author

romeor commented Nov 13, 2015

just pulling did not help, so I've cloned whole project again and now it works. Thanks a lot, great project and support! Hope to see GeopIP realization also 👍

@romeor romeor closed this as completed Nov 13, 2015
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