Skip to content

SonarSoftwareInc/poller

Repository files navigation

Sonar Poller

Sonar Poller

Introduction

This poller provides a way to collect data from your network and return it to Sonar. This poller only works with Sonar v2 - please check out the legacy poller if you're on Sonar version 1.

Installation

Feel free to reach out to Sonar support if you need assistance getting the poller up and running.

The poller is designed to run on Ubuntu 20 Server Edition. Install on bare metal or a VM, and then follow the steps below.

  1. From the command line, enter wget https://raw.githubusercontent.com/SonarSoftwareInc/poller/master/setup.sh
  2. Enter chmod +x setup.sh
  3. Enter sudo ./setup.sh

The poller should automatically install and get up and running. Once this is complete, you can access the poller web interface by navigating to https://SERVER_IP in a browser, where SERVER_IP is the IP address of the server you installed the poller on.

Login using your Sonar credentials, navigate to the Settings tab and enter the necessary information. To receive a poller API key, you'll need to add the poller into Sonar under Settings > Monitoring > Pollers. Now navigate to the Device Credentials tab and enter any applicable credentials.

For developers

Adding new types of devices

Edit config/devices.json and add a response value which should be the response to an SNMP get to 1.3.6.1.2.1.1.2.0. Add a device value which is a string representing the entire namespace and class name of the mapper in question.

If the class name is a mapper inside src/DeviceMappers, then the mapper must extend BaseDeviceMapper. If the class name is an identifier inside src/DeviceIdentifiers, then the identifier must implement IdentifierInterface. Almost all responses should be a mapper - the identifier path is only needed if the vendor doesn't uniquely identify their devices by a response to 1.3.6.1.2.1.1.2.0.

Check out an existing mapper for examples of the best way to implement a new one. The Netonix/Ws6Mini, Ubiquiti/Toughswitch or MikroTik/MikroTik mappers have examples of using non-SNMP based data collection as well.

Basic CLI Operation

Starting/Stopping the poller service

Run supervisorctl restart sonar_poller to restart the poller

Run supervisorctl stop sonar_poller to stop the poller

Enabling Debug Mode

You will need to set the environment variable SONAR_DEBUG_MODE, setting it to 1 will enable debugging, and setting it to 0 will disable debugging.

Run export SONAR_DEBUG_MODE=1 to enable debugging

Run export SONAR_DEBUG_MODE=0 to disable debugging

Restart the poller (see the supervisorctl commands above) to enable the changes to take effect