online and uptime

71 views
Skip to first unread message

Mirco Tonin

unread,
Apr 10, 2020, 10:04:28 AM4/10/20
to OpenWISP
Hello.
I am evaluating OpenWisp, is there a way to see if a device is online and uptime?
Thanks.

Federico Capoano

unread,
Apr 10, 2020, 11:28:46 AM4/10/20
to OpenWISP
Hi,

I recently published a monitoring module which does that: https://github.com/openwisp/openwisp-monitoring
But as of today 10th of April 2020, there's not yet a lot of documentation on how to add it into OpenWISP and use it.
Nonetheless, with some patience and effort, it works.

Here's some screens:

Screenshot from 2020-04-10 10-16-44.png
Screenshot from 2020-04-10 10-18-06.png
Screenshot from 2020-04-10 10-25-21.png
Screenshot from 2020-04-10 10-26-26.png

We are also actively working to improve it.

If you need help, let us know.

Best regards
Federico

--
You received this message because you are subscribed to the Google Groups "OpenWISP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openwisp+u...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/openwisp/1c7daa14-26b4-4ac8-a4e0-79c5b43c3403%40googlegroups.com.

Mirco Tonin

unread,
Apr 16, 2020, 8:47:36 AM4/16/20
to OpenWISP

Could you give me some information on how to start the installation?

Thanks.




Il giorno venerdì 10 aprile 2020 17:28:46 UTC+2, Federico Capoano ha scritto:
Hi,

I recently published a monitoring module which does that: https://github.com/openwisp/openwisp-monitoring
But as of today 10th of April 2020, there's not yet a lot of documentation on how to add it into OpenWISP and use it.
Nonetheless, with some patience and effort, it works.

Here's some screens:

Screenshot from 2020-04-10 10-16-44.png
Screenshot from 2020-04-10 10-18-06.png
Screenshot from 2020-04-10 10-25-21.png
Screenshot from 2020-04-10 10-26-26.png

We are also actively working to improve it.

If you need help, let us know.

Best regards
Federico

On Fri, Apr 10, 2020 at 9:04 AM Mirco Tonin <in...@assistenzainformatica.tv> wrote:
Hello.
I am evaluating OpenWisp, is there a way to see if a device is online and uptime?
Thanks.

--
You received this message because you are subscribed to the Google Groups "OpenWISP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open...@googlegroups.com.

Federico Capoano

unread,
Apr 17, 2020, 5:08:57 PM4/17/20
to OpenWISP
Here's a sample playbook to use with ansible-openwisp2, follow the instructions in this link first, then add the following to your playbook.yml:

- hosts: openwisp
  become: true
  become_user: root
  roles:
    - openwisp.openwisp2
  vars:
    openwisp2_language_code: en-en
    openwisp2_time_zone: Europe/Rome
    openwisp2_nginx_http2: true
    openwisp2_nginx_ipv6: true
    openwisp2_default_from_email: no-r...@owisp.uniot.eu
    openwisp2_default_cert_validity: 7300
    openwisp2_default_ca_validity: 7300
    openwisp2_default_from_email: no-reply@<yourdomain>
    openwisp2_extra_python_packages:
    openwisp2_extra_urls:
        - "url(r'', include('openwisp_monitoring.urls'))"
    openwisp2_extra_django_settings:
        EMAIL_HOST: '<SMTP_SERVER>'
        EMAIL_PORT: 25
        EMAIL_HOST_USER: chan...@changeme.it
    openwisp2_extra_django_settings_instructions:
      - |
        # monitoring settings
        from datetime import timedelta

        CELERY_BEAT_SCHEDULE = {
            'run_checks': {
                'task': 'openwisp_monitoring.check.tasks.run_checks',
                'schedule': timedelta(minutes=5),
                'args': None,
                'relative': True
            }
        }

        CELERY_TASK_ACKS_LATE = True
        CELERY_WORKER_PREFETCH_MULTIPLIER = 1

        for app in ['openwisp_monitoring.notifications',
                  'openwisp_monitoring.check',
                  'openwisp_monitoring.device',
                  'openwisp_monitoring.monitoring']:
            INSTALLED_APPS.insert(INSTALLED_APPS.index('openwisp_controller.geo',) + 1, app)

        TEMPLATES[0]['OPTIONS']['loaders'].insert(0, 'apptemplates.Loader')
        if 'djcelery_email' not in INSTALLED_APPS:
            INSTALLED_APPS.append('djcelery_email')
            EMAIL_BACKEND = 'djcelery_email.backends.CeleryEmailBackend'
            CELERY_BROKER_URL = 'redis://127.0.0.1:6379/3'

        OPENWISP_MONITORING_HEALTH_STATUS_LABELS = {
            'unknown': 'unknown',
            'ok': 'online',
            'problem': 'problem',
            'critical': 'offline'
        }
        INFLUXDB_USER = "root"
        INFLUXDB_PASSWORD = "root"
  pre_tasks:
    # openwisp-monitoring
    - name: Add influxdb key
      apt_key:
        state: present
      tags: [monitoring]
    - name: Add influxdb repo
      apt_repository:
        repo: "deb https://repos.influxdata.com/{{ ansible_distribution.lower() }}/ {{ ansible_distribution_release  }} stable"
        state: present
      tags: [monitoring]
    - name: Install influxdb and fping (update apt cache first)
      apt:
        name: "{{ item }}"
        update_cache: yes
      with_items:
        - influxdb
        - fping
      tags: [monitoring]
    - name: ensure influxdb is started and enabled
      service:
        name: influxdb
        state: started
        enabled: yes
      tags: [monitoring]
  tasks:
    # monitoring
    - name: supervisor celerybeat
      template:
        src: templates/celerybeat.j2
        dest: "{{ supervisor_path | format('celerybeat') }}"
      notify: reload supervisor
      tags: [openwisp2, monitoring]


in templates/celerybeat.j2 put:

[program:celerybeat]
user
={{ www_user }}
directory
={{ openwisp2_path }}
command
={{ openwisp2_path }}/env/bin/celery -A openwisp2 beat -l info
autostart
=true
autorestart
=true
stopsignal
=INT
redirect_stderr
=true
stdout_logfile
={{ openwisp2_path }}/log/celerybeat.log
stdout_logfile_maxbytes
=30MB
stdout_logfile_backups
=5

In production systems I suggest to use PostgreSQL (you can use the ansible role ANXS.postgresql) and Letsencrypt (instructions for configuring letsencrypt are included in the README of ansible-openwisp2).

I hope this helps.

Best regards
Federico
Reply all
Reply to author
Forward
0 new messages