Usm cabletest EN

Материал из WiKi - UserSide

en | ru

USM_CABLETEST - it is a module for periodic polling by cable tester of cable lengths for known switch models, fixing the results and outputting notifications about the change of values


Module Language: Perl

Current version: see page: Modules

Module Status: Paid

Required Perl modules:

Time::Local
Socket
FindBin
URI
URI::Escape
LWP::UserAgent
JSON
Data::Dumper
Net::Telnet
Net::SNMP

For general information for all modules, see the page: Modules

Supported device models

D-Link DES-3010G 
D-Link DES-3026 
D-Link DES-3028
D-Link DES-3028G
D-Link DES-3052
D-Link DES-3200-10
D-Link DES-3200-10/C1
D-Link DES-3200-18
D-Link DES-3200-18/C1
D-Link DES-3200-26
D-Link DES-3200-26/C1
D-Link DES-3200-28 
D-Link DES-3200-28/C1 
D-Link DES-3200-28F 
D-Link DES-3200-28F/C1
D-Link DES-3200-52 
D-Link DES-3200-52/C1 
D-Link DES-3526
D-Link DES-3528
D-Link DGS-3000-24TC
D-Link DGS-3120-24SC
D-Link DGS-3120-24TC
D-Link DGS-3200-10
D-Link DGS-3200-16

To add support for other switch models (that have cable tester) - contact us.

Main features

  • periodically obtaining information about the length of cables included in the copper ports of switches or about the absence of cables at all
  • recording of the obtained results
  • control of the facts of cable length changes and output of corresponding notifications

The method of data acquisition - telnet or SNMP (depending on the switch model).

In one run, the module connects to one device and attempts to poll it.

Installing and configuring the module

  1. Allocate a separate catalogue. A completely arbitrary one. It is better not to place it in a catalogue accessible via web. Interaction with ERP "UserSide" is carried out through API means via http/s-protocol. In this way the module is fully autonomous and can work on any separate computer in any subnet. Also create a separate directory for the module logs. Do not forget to grant write permissions to it.
  2. Transfer there the files from the module archive. Rename the sample configuration file "usm_cabletest.conf-example" to "usm_cabletest.conf". In it, configure the parameters. The list of possible parameters is listed below.
  3. Check for additional perl-packages that are required to run the module. Their list is given above. If you do not have them installed, the module will generate an error at startup and the perl-package will need to be installed (using CPAN or PPM).
  4. Enable usm_cabletest module in the "Settings - Modules" section.
  5. Run the module manually
perl usm_cabletest.pl

It should start and run without errors.

7. Write the module startup into the system cron, according to the recommendations below

Clarifications:

  • The module processes only one device at startup. Therefore, the system cron should be set to call the required number of copies of the module (based on the number of switches of suitable models in the system and the desired polling frequency).
  • The module processes one device at startup. Therefore, the module can process 15 devices in 15 minutes. Any number of copies of the module can be started. To ensure that the simultaneous launch of a large number of copies of the module does not lead to increased load on the switches and the server (because the same tasks will be performed during the launch) the parameter "$delay" is used. By specifying in it a number of arbitrary delay, for example in "20" - you can achieve that the modules will be started from 1 to 20 seconds in random order and the load will be distributed.

IMPORTANT: Note that the cable tester polling is an internal diagnostic operation of the switch. It is possible that the switch will switch the port on/off to obtain correct data. It is also possible that frequent polling may cause the equipment to freeze.

It is also necessary to take into account that the cable tester data may be inaccurate. The error can reach several metres.

Example from the cron of launching five copies of the module:

* * * * * perl /home/usm_cabletest/usm_cabletest.pl &> /dev/null
* * * * * perl /home/usm_cabletest/usm_cabletest.pl &> /dev/null
* * * * * perl /home/usm_cabletest/usm_cabletest.pl &> /dev/null
* * * * * perl /home/usm_cabletest/usm_cabletest.pl &> /dev/null
* * * * * perl /home/usm_cabletest/usm_cabletest.pl &> /dev/null

In the card of the device polled by the usm_cabletest module you can view the history of polling of this device by the module and the general table of device polling by clicking the corresponding link. Also in the table of ports in the card of this device you can see the last known cable lengths on the polled ports.

Parameters

The module is configured in the usm_cabletest.conf file.

$usUrl - URL to ERP "UserSide"
$usApiKey - API-key to ERP "UserSide"
$logsPath - Path to the catalogue for module logs

$isSilence - Flag - hide notifications to the console when the module is running
$delay - Custom time delay from 0 to n-seconds after module start. Allows you to reduce the load on the server when using a large number of modules at the same time

The usm_cabletest module can be run with the (specify a specific device to poll) parameter

Example:

perl usm_cabletest 998

will poll the switch with ID 998

Operation information

On the "Settings - Modules - usm_cabletest" page you can view the report of polling by the equipment module by clicking on the link

Separately, you can view the data for this device in the equipment card

The latest data is displayed in the ports table

In the home page setting - the user can enable the output of cable length change information to the home page

If the information is not captured/module does not work

1. It is necessary to distinguish and understand whether the module is not working or information is not captured. On the "Settings - Modules - usm_cabletest - Module Run Information" page, you should check the usm_cabletest module run logs and results.

2. You should make sure that the community access, passwords are correct and the device itself is physically connected and working.

3. In the ERP "UserSide" itself, open the switch card and click on the "Cable tester" link

4. For the test - you should run the module specifically for a particular switch. For example:

perl usm_cabletest.pl 998

will start the module for switch ID: 998

Check if there are no errors in the information output.

In the log files, analyse the information received.