[GeoNode-devel] GeoNode monitoring

Paolo Corti pcorti at gmail.com
Wed Oct 4 08:52:35 PDT 2017

Hi Cezio

I gave another try right now. I run collect_metrics, and now I see an
error when accessing the monitoring page:

[04/Oct/2017 10:48:32] "GET /monitoring/api/services/ HTTP/1.1" 200 410
Internal Server Error: /monitoring/api/metric_data/uptime/
Traceback (most recent call last):
  File "/home/vagrant/env_gn_master/local/lib/python2.7/site-packages/django/core/handlers/base.py",
line 132, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/vagrant/env_gn_master/local/lib/python2.7/site-packages/django/views/generic/base.py",
line 71, in view
    return self.dispatch(request, *args, **kwargs)
  File "/home/vagrant/env_gn_master/local/lib/python2.7/site-packages/django/views/generic/base.py",
line 89, in dispatch
    return handler(request, *args, **kwargs)
  File "/home/vagrant/worldmap_28/geonode.git/geonode/contrib/monitoring/views.py",
line 339, in get
    out = capi.get_metrics_for(metric_name, **filters)
  File "/home/vagrant/worldmap_28/geonode.git/geonode/contrib/monitoring/collector.py",
line 681, in get_metrics_for
  File "/home/vagrant/worldmap_28/geonode.git/geonode/contrib/monitoring/collector.py",
line 794, in get_metrics_data
    return [postproc(row) for row in raw_sql(q, params)]
  File "/home/vagrant/worldmap_28/geonode.git/geonode/utils.py", line
1004, in raw_sql
    c.execute(query, params)
  File "/home/vagrant/env_gn_master/local/lib/python2.7/site-packages/django/db/backends/utils.py",
line 79, in execute
    return super(CursorDebugWrapper, self).execute(sql, params)
  File "/home/vagrant/env_gn_master/local/lib/python2.7/site-packages/django/db/backends/utils.py",
line 64, in execute
    return self.cursor.execute(sql, params)
  File "/home/vagrant/env_gn_master/local/lib/python2.7/site-packages/django/db/utils.py",
line 98, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/home/vagrant/env_gn_master/local/lib/python2.7/site-packages/django/db/backends/utils.py",
line 64, in execute
    return self.cursor.execute(sql, params)
  File "/home/vagrant/env_gn_master/local/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py",
line 318, in execute

    return Database.Cursor.execute(self, query, params)
OperationalError: near "%": syntax error
[04/Oct/2017 10:48:32] "GET
HTTP/1.1" 500 208097
[04/Oct/2017 10:48:32] "GET
HTTP/1.1" 500 207973
[04/Oct/2017 10:48:32] "GET
HTTP/1.1" 500 209799
[04/Oct/2017 10:48:32] "GET /monitoring/api/metric_data/uptime/
HTTP/1.1" 500 206789

This is my configuration:

$ ./manage.py collect_metrics -l
System check identified some issues:

monitoring.RequestEvent.resources: (fields.W340) null has no effect on
available services
   local-geonode (  )
   running on localhost
   active: True
    not checked yet

   local-geoserver ( http://localhost:8080/geoserver/ )
   running on localhost
   active: True
    not checked yet

   local-system-geonode ( http://localhost:8000/ )
   running on localhost
   active: True
    last check: 2017-10-04 10:48:01.027709

By the way, I see that with latest pushes there is some more
requirements you need to add in requirements.txt and setup.py:


Thanks a lot, it looks really useful and promising


On Fri, Sep 29, 2017 at 7:53 AM, Cezary Statkiewicz
<cezary.statkiewicz at geo-solutions.it> wrote:
> From: "Paolo Corti" pcorti at gmail.com
> To: "cezary.statkiewicz at geo-solutions.it" cezary.statkiewicz at geo-solutions.it
> Cc: "geonode-devel" geonode-devel at lists.osgeo.org
> Date: Thu, 28 Sep 2017 16:08:09 -0400
> Subject: Re: [GeoNode-devel] GeoNode monitoring
> Hi Cezary
>> it is a great work, thanks a lot!
>> I am having a try, and I could successfully install and configure it. But
> the console is not fed with monitoring data, and I see in the Django
> log lot of lines (one every minute, as the default frequency) like
> this:
>> [28/Sep/2017 15:04:34] "GET
>> /monitoring/api/metric_data/response.error.count/?last=undefined&interval=undefined
> HTTP/1.1" 400 123
>> Any idea?
>> cheers
>> ps I added some comment in your PR. Maybe I will add others once I can
> make it working :)
>  Hi!
>  I'm glad you like it. As for those strange requests, it's frontend requesting for specific metric data. It should contain something else in last and intervals args though. Could you show your configuration? I've tested with known corner cases, but I couldn't reproduce.
>  You can get config with `manage.py collect_metrics -l`
>  Also, you should run `manage.py collect_metrics` from time to time (or add the call to crontab).
> Regards,
> Cezary Statkiewicz
> ==
> GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information.
> ==
> Cezary Statkiewicz
> Senior Software Engineer
> GeoSolutions S.A.S.
> Via di Montramito 3/A
> 55054 Massarosa (LU)
> Italy
> phone: +39 0584 962313
> fax: +39 0584 1660272
> http://www.geo-solutions.it
> http://twitter.com/geosolutions_it
> -------------------------------------------------------
> Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.
> The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.

Paolo Corti
Geospatial software developer
web: http://www.paolocorti.net
twitter: @capooti
skype: capooti

More information about the geonode-devel mailing list