You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: admin/mgmt_commands/index.rst
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -266,7 +266,7 @@ This will produce output that looks like the following
266
266
267
267
DJANGO_SETTINGS_MODULE=geonode.settings python manage.py sync_geonode_maps --updatethumbnails -f 'This is a test Map'
268
268
269
-
Management Command ``set_all_layers_metadata``
269
+
Management Command ``set_all_datasets_metadata``
270
270
----------------------------------------------
271
271
272
272
This command allows to reset **Metadata Attributes** and **Catalogue Schema** on Datasets. The command will also update the :guilabel:`CSW Catalogue` XML and Links of GeoNode.
@@ -287,26 +287,26 @@ The options are:
287
287
*
288
288
* **set_links**; If set will refresh the links of the resource. (Default True).
289
289
290
-
First of all let's take a look at the :guilabel:`--help` option of the ``set_all_layers_metadata``
290
+
First of all let's take a look at the :guilabel:`--help` option of the ``set_all_datasets_metadata``
291
291
management command in order to inspect all the command options and features.
This contrib app, along with the GeoNode internal monitoring app, lets administrators
314
-
to configure a service for sending metrics data to a **centralized server**
315
-
which comes with `Logstash <https://www.elastic.co/products/logstash>`_.
316
-
317
-
So it will be possible to visualize stats and charts about one or more GeoNode instances outside the application.
318
-
Having a server configured with the `ELK stack <https://www.elastic.co/what-is/elk-stack>`_,
319
-
it is possible to visualize those information on a Kibana dashboard for example.
320
-
321
-
If you manage more than one GeoNode instances, that server can receive data from
322
-
many GeoNode(s) so it can make available both *single-instance dashboards*
323
-
(referred to individual instances) and *global dashboards*
324
-
(stats calculated on the whole set of instances).
325
-
326
-
.. warning:: The centralized monitoring service cannot be active if the settings variables :ref:`user-analytics` and :ref:`monitoring-enabled` are set to `False`.
327
-
328
-
Overview
329
-
--------
330
-
331
-
By default, GeoNode will send data to the centralized server every **3600 seconds**
332
-
(1 hour) so, if enabled, the monitoring app will collect 1-hour-aggregated data.
333
-
This time interval can be configured, see the next paragraphs to know how.
334
-
335
-
Formatted and compressed data will be sent on a **TCP** connection (on the `443` standard port by default)
336
-
through a **scheduled celery task** which basically logs information
337
-
via `python-logstash-async <https://pypi.org/project/python-logstash-async/>`_.
338
-
339
-
.. warning:: This feature requires `python-logstash-async <https://pypi.org/project/python-logstash-async/>`_.
340
-
341
-
.. _events-formats:
342
-
343
-
Data and events formats
344
-
~~~~~~~~~~~~~~~~~~~~~~~
345
-
346
-
Each time the centralized monitoring service is called, 4 types of *JSON* formatted events are sent to the server:
347
-
348
-
1. Instance overview
349
-
350
-
.. code-block:: json
351
-
352
-
{
353
-
"format_version": "1.0",
354
-
"instance": {
355
-
"name": geonode instance HOSTNAME,
356
-
"ip": geonode instance IP
357
-
},
358
-
"time": {
359
-
"startTime": UTC now - 1 hour (default)
360
-
"endTime": UTC now
361
-
},
362
-
"hits": total number of requests,
363
-
"unique_visits": total number of unique sessions,
364
-
"unique_visitors": total number of unique users,
365
-
"registered_users": total number of registered users at the end time,
366
-
"layers": total number of layers at the end time,
367
-
"documents": total number of documents at the end time,
368
-
"maps": total number of maps at the end time,
369
-
"errors": total number of errors
370
-
}
371
-
372
-
2. Resources details
373
-
374
-
.. code-block:: json
375
-
376
-
{
377
-
"format_version": "1.0",
378
-
"instance": {
379
-
"name": geonode instance HOSTNAME,
380
-
"ip": geonode instance IP
381
-
},
382
-
"time": {
383
-
"startTime": UTC now - 1 hour (default)
384
-
"endTime": UTC now
385
-
},
386
-
"resources": [
387
-
…
388
-
{
389
-
"type": resource type,
390
-
"name": resource name,
391
-
"url": resource URL,
392
-
"hits": total number of requests about this resource,
393
-
"unique_visits": total number of unique sessions about this resource,
394
-
"unique_visitors": total number of unique users about this resource,
395
-
"downloads": total number of resource downloads,
396
-
"ogcHits": total number of OGC service requests about this resource,
397
-
"publications": total number of publication events
398
-
},
399
-
…
400
-
]
401
-
}
402
-
403
-
3. Countries details
404
-
405
-
.. code-block:: json
406
-
407
-
{
408
-
"format_version": "1.0",
409
-
"instance": {
410
-
"name": geonode instance HOSTNAME,
411
-
"ip": geonode instance IP
412
-
},
413
-
"time": {
414
-
"startTime": UTC now - 1 hour (default)
415
-
"endTime": UTC now
416
-
},
417
-
"countries": [
418
-
…
419
-
{
420
-
"name": country name,
421
-
"hits": total number of requests about the country
422
-
},
423
-
…
424
-
]
425
-
}
426
-
427
-
4. UA (User Agent) Family details
428
-
429
-
.. code-block:: json
430
-
431
-
{
432
-
"format_version": "1.0",
433
-
"instance": {
434
-
"name": geonode instance HOSTNAME,
435
-
"ip": geonode instance IP
436
-
},
437
-
"time": {
438
-
"startTime": UTC now - 1 day
439
-
"endTime": UTC now
440
-
},
441
-
"ua_families": [
442
-
…
443
-
{
444
-
"name": UA family name
445
-
"hits": total number of requests about the UA family
446
-
},
447
-
…
448
-
]
449
-
}
450
-
451
-
These messages will be `gzip <https://docs.python.org/2/library/zlib.html>`_
452
-
compressed in order to improve transport performances and they should be parsed
453
-
by a `logstash filter <https://www.elastic.co/guide/en/logstash/current/plugins-codecs-gzip_lines.html>`_
454
-
on the server side (see :ref:`logstash-input`).
455
-
456
-
Configuration
457
-
-------------
458
-
459
-
The centralized monitoring service is disabled by default because it needs
460
-
the internal monitoring to be active and service-specific configurations.
461
-
462
-
GeoNode configuration
463
-
~~~~~~~~~~~~~~~~~~~~~
464
-
465
-
|On the GeoNode side, all needed configurations can be set up from the Django admin interface.
466
-
|If enabled, the **GEONODE LOGSTASH** section will show the **Centralized servers** feature:
467
-
468
-
.. image:: img/centralized_server_admin_ui.png
469
-
:alt:Centralized Servers from admin UI
470
-
471
-
Let's add one:
472
-
473
-
.. image:: img/add_centralized_server.png
474
-
:alt:Centralized Server set up
475
-
476
-
The **Host** IP address and the **Port** number are mandatory as well as the
477
-
time **Interval** (3600 seconds by default) which defines the service
478
-
invocation polling (so the time range on which data should be aggregated).
479
-
480
-
.. note:: Once the service configured, the user can test the configuration by clicking on **Test connection**.
481
-
It will test the connection with the centralized server without saving the configuration.
482
-
483
-
Other settings come with a default value:
484
-
485
-
* **Db path** --> the local Spatialite database to cache events between emitting and transmission to the Logstash server (log events are cached even across process restarts and crashes);
486
-
* **Socket timeout** --> timeout in seconds for TCP connections;
487
-
* **Queue check interval** --> interval in seconds to check the internal queue for new messages to be cached in the database;
488
-
* **Queue events flush interval** --> interval in seconds to send cached events from the database to Logstash;
489
-
* **Queue events flush count** --> count of cached events to send from the database to Logstash;
490
-
* **Queue events batch size** --> maximum number of events to be sent to Logstash in one batch;
491
-
* **Logstash db timeout** --> timeout in seconds to 'connect' the Spatialite database.
492
-
493
-
To better understand what these variables mean, it is recommended to read the `python-logstash-async options for the asynchronous processing and formatting <https://python-logstash-async.readthedocs.io/en/stable/config.html#options-for-the-asynchronous-processing-and-formatting>`_.
494
-
495
-
Other three read-only fields will be visible:
496
-
497
-
* **Last successful deliver** --> timestamp of the last successful deliver (if exists);
498
-
* **Next scheduled deliver** --> timestamp of the next scheduled deliver;
499
-
* **Last failed deliver** --> timestamp of the last failed deliver (if exists).
500
-
501
-
.. _logstash-input:
502
-
503
-
Logstash configuration
504
-
~~~~~~~~~~~~~~~~~~~~~~
505
-
506
-
|On the server side, a proper Logstash configuration should be set up.
507
-
|Some events formats contain arrays (see :ref:`events-formats`) so Logstash should
508
-
be able to retrieve a single event for each element of the array.
509
-
The `Split filter plugin <https://www.elastic.co/guide/en/logstash/current/plugins-filters-split.html#plugins-filters-split>`_
510
-
helps to correctly parse those messages.
511
-
|As mentioned above, events messages will be gzip compressed so the
0 commit comments