Uploaded image for project: 'Observium'
  1. Observium
  2. OBS-2215

SNR Ethernet Remote Devices (Series 2 and 4)

Details

    • Add New Device / OS
    • Resolution: Fixed
    • Trivial
    • None
    • None
    • Discovery, Poller

    Description

      I want to add new devices SNR ERD 2.x
      //(also add SNR ERD 4.x but only definitions without any sensors/statuses, TODO later)
      //(I don't have any SNR ERD 3.x)
      Tested on SNR-ERD-2.3-termo-out

      It is my first try to add os with more then just add some strings to includes/definitions/os.inc.php

      Definitions/os

      includes/definitions/os.inc.php

      // SNR (shop.nag.ru)
       
      $os = "snr-erd-2";
      $config['os'][$os]['text']                  = "SNR ERD-2";
      $config['os'][$os]['icon']                  = "snr";
      $config['os'][$os]['sysObjectID'][]         = ".1.3.6.1.4.1.40418.2.2";
      $config['os'][$os]['type']                  = "environment";
      $config['os'][$os]['sysDescr_regex'][]      = "/Fmv_(?<version>\d[\w\.]+)/";
      $config['os'][$os]['ports_skip_ifType']     = TRUE;
      $config['os'][$os]['remote_access']         = array('http');
      $config['os'][$os]['mibs'][]                = "SNR-ERD-2";
       
      $os = "snr-erd-4";
      $config['os'][$os]['text']                  = "SNR ERD-4";
      $config['os'][$os]['icon']                  = "snr";
      $config['os'][$os]['sysObjectID'][]         = ".1.3.6.1.4.1.40418.2.6";
      $config['os'][$os]['type']                  = "environment";
      $config['os'][$os]['remote_access']         = array('http');
      $config['os'][$os]['mibs'][]                = "SNR-ERD-4";

      Definitions/mibs _ status discovery

      includes/definitions/mibs.inc.php

      // SNR (shop.nag.ru)
      $os = "snr-erd-2";
      $config['os'][$os]['text']                  = "SNR ERD-2";
      $config['os'][$os]['icon']                  = "snr";
      $config['os'][$os]['sysObjectID'][]         = ".1.3.6.1.4.1.40418.2.2";
      $config['os'][$os]['type']                  = "environment";
      $config['os'][$os]['sysDescr_regex'][]      = "/Fmv_(?<version>\d[\w\.]+)/";
      $config['os'][$os]['ports_skip_ifType']     = TRUE;
      $config['os'][$os]['remote_access']         = array('http');
      $config['os'][$os]['mibs'][]                = "SNR-ERD-2";
       
      $os = "snr-erd-4";
      $config['os'][$os]['text']                  = "SNR ERD-4";
      $config['os'][$os]['icon']                  = "snr";
      $config['os'][$os]['sysObjectID'][]         = ".1.3.6.1.4.1.40418.2.6";
      $config['os'][$os]['type']                  = "environment";
      $config['os'][$os]['remote_access']         = array('http');
      $config['os'][$os]['mibs'][]                = "SNR-ERD-4";

      Sensor discovery

      includes/discovery/sensors/snr-erd-2.inc.php

      <?php
       
      $scale          = 1;
      $outlet_oid     = ".1.3.6.1.4.1.40418.2.2.4.1.0";
      $outlet_descr   = "Temperature Sensor";
      $outlet_current = snmp_get($device,"temperatureSensor.0", "-Ovq", "SNR-ERD-2");
       
      if ($outlet_current >= 0)
      {
        discover_sensor($valid['sensor'], 'temperature', $device, $outlet_oid, 0, 'snr-erd-2', $outlet_descr, $scale, $outlet_current, $limits);
      }
      // EOF

      MIBs

      $ mkdir /opt/observium/mibs/nag/

      [^SNR-ERD-2] [^SNR-ERD-4]

      Attachments

        Activity

          [OBS-2215] SNR Ethernet Remote Devices (Series 2 and 4)
          bot Observium Bot made changes -
          Status Original: Resolved [ 5 ] New: Closed [ 6 ]
          mtivi Martyushev Tim made changes -
          Comment [ After changes in r11340 and r11341.
          Observium stop discovery OID upsOutputSource.0 from UPS-MIB ]

          fixed in r11340 and r11341

          mtivi Martyushev Tim added a comment - fixed in r11340 and r11341

          Current sensors discovery for UPS-MIB (includes/discovery/sensors/ups-mib.inc.php) doesn't discover all sensors from ERD-4.

          For debug purpose I add

          Index: includes/discovery/sensors/ups-mib.inc.php
          ===================================================================
          --- includes/discovery/sensors/ups-mib.inc.php	(revision 11338)
          +++ includes/discovery/sensors/ups-mib.inc.php	(working copy)
          @@ -66,6 +66,12 @@
             }
           }
           
          +if ($device['os'] === 'snr-erd')
          +{
          +  $indexes = array(0, 1);
          +  print_r($ups_array);
          +}
          +
          


          And all sesnors from UPS-MIB are discovered.

          Array $ups_array:

          Array
          (
              [1] => Array
                  (
                      [upsInputLineIndex] => 1
                      [upsInputFrequency] => 50
                      [upsInputVoltage] => 231
                      [upsOutputLineIndex] => 1
                      [upsOutputVoltage] => 231
                      [upsOutputCurrent] => 0
                      [upsOutputPower] => 0
                      [upsOutputPercentLoad] => 14
                  )
           
              [0] => Array
                  (
                      [upsOutputSource] => normal
                  )
           
          )

          please help to improve discovery

          mtivi Martyushev Tim added a comment - Current sensors discovery for UPS-MIB (includes/discovery/sensors/ups-mib.inc.php) doesn't discover all sensors from ERD-4. For debug purpose I add Index: includes/discovery/sensors/ups-mib.inc.php =================================================================== --- includes/discovery/sensors/ups-mib.inc.php (revision 11338) +++ includes/discovery/sensors/ups-mib.inc.php (working copy) @@ -66,6 +66,12 @@ } } +if ($device['os'] === 'snr-erd') +{ + $indexes = array(0, 1); + print_r($ups_array); +} + And all sesnors from UPS-MIB are discovered. Array $ups_array: Array ( [1] => Array ( [upsInputLineIndex] => 1 [upsInputFrequency] => 50 [upsInputVoltage] => 231 [upsOutputLineIndex] => 1 [upsOutputVoltage] => 231 [upsOutputCurrent] => 0 [upsOutputPower] => 0 [upsOutputPercentLoad] => 14 )   [0] => Array ( [upsOutputSource] => normal )   ) please help to improve discovery
          landy Mike Stupalov made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Progress [ 3 ] New: Resolved [ 5 ]

          Added (with small changes) in r11336.

          landy Mike Stupalov added a comment - Added (with small changes) in r11336.
          landy Mike Stupalov made changes -
          Status Original: In Review [ 10101 ] New: In Progress [ 3 ]

          I attached patch for ERD-2.3 / ERD-2, ERD-3 and ERD-4.
          snr-erd.patch

          landy You have an access to SNMP on EDR-4

          Also attached snmpwalk for ERD-2.3 / ERD-2, ERD-3.
          [^erd-2.3.snmpwalk] [^erd-2.snmpwalk] [^erd-3.snmpwalk]

          mtivi Martyushev Tim added a comment - I attached patch for ERD-2.3 / ERD-2, ERD-3 and ERD-4. snr-erd.patch landy You have an access to SNMP on EDR-4 Also attached snmpwalk for ERD-2.3 / ERD-2, ERD-3. [^erd-2.3.snmpwalk] [^erd-2.snmpwalk] [^erd-3.snmpwalk]
          mtivi Martyushev Tim made changes -
          Attachment Original: erd-3-1.snmpwalk [ 18602 ]
          mtivi Martyushev Tim made changes -
          Attachment Original: erd-2-1.snmpwalk [ 18601 ]

          People

            landy Mike Stupalov
            mtivi Martyushev Tim
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: