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

Unsupported operand type: string+string in eppc-ups.inc.php

Details

    • Bug
    • Resolution: Fixed
    • Major
    • None
    • Professional Edition
    • Poller
    • None
    • Ubuntu 22.04 Jammy
      PHP 8.1.2

    Description

      With PHP 8.1 the eppc-ups.inc.php poller fails with following error:

      #####  Module Start: os  #####
       
       o OS Poller            OS
      PHP Fatal error:  Uncaught TypeError: Unsupported operand types: string + string in /opt/observium/includes/polling/os/eppc-ups.inc.php:23
      Stack trace:
      #0 /opt/observium/includes/polling/os.inc.php(157): include()
      #1 /opt/observium/includes/polling/functions.inc.php(305): include('...')
      #2 /opt/observium/poller.php(171): poll_device()
      #3 {main}
        thrown in /opt/observium/includes/polling/os/eppc-ups.inc.php on line 23 

       

      Workaround patch:

      Index: includes/polling/os/eppc-ups.inc.php
      ===================================================================
      --- includes/polling/os/eppc-ups.inc.php	(revision 12246)
      +++ includes/polling/os/eppc-ups.inc.php	(working copy)
      @@ -20,7 +20,7 @@
           $hardware = snmp_get($device, 'upsEIdentityManufacturer.0', '-OQv', 'EPPC-MIB') . ' (' .
                       snmp_get($device, 'upsESystemConfigOutputVA.0', '-OQv', 'EPPC-MIB') . 'VA ' . snmp_get($device, 'upsEIdentityModel.0', '-OQv', 'EPPC-MIB') . ')';
           $upsEIdentityDescription = snmp_get($device, 'upsEIdentityDescription.0', '-OQv', 'EPPC-MIB');
      -    $version = $upsEIdentityDescription + ' UPS: ' .
      +    $version = $upsEIdentityDescription . ' UPS: ' .
                      snmp_get($device, 'upsEIdentityUPSFirmwareVerison.0', '-OQv', 'EPPC-MIB') . ' Firmware: ' . snmp_get($device, 'upsIdentAgentSoftwareVersion.0', '-OQv', 'EPPC-MIB');
           $status = snmp_get($device, 'upsESystemStatus.0', '-OQv', 'EPPC-MIB') . ' ' . snmp_get($device, 'upsEBatteryTestResult.0', '-OQv', 'EPPC-MIB');
       

       

       

      Attachments

        Activity

          [OBS-4226] Unsupported operand type: string+string in eppc-ups.inc.php

          Thanks. Fixed in r12249.

          This is incorrect use of the version field though, so at some point should be split up. We can't handle multiple version strings at the moment though, so it can stay for now!

          adama Adam Armstrong added a comment - Thanks. Fixed in r12249. This is incorrect use of the version field though, so at some point should be split up. We can't handle multiple version strings at the moment though, so it can stay for now!

          General questions and device support can be discussed in our Discord channel, click here to join.


          Please make and attach additional information about the device:

          • full snmp dump from device:

            snmpwalk -v2c -c <community> -t 3 -Cc --hexOutputLength=0 -ObentxU <hostname> .1 > myagent.snmpwalk
            snmpwalk -v2c -c <community> -t 3 -Cc --hexOutputLength=0 -ObentxU <hostname> .1.3.6.1.4.1 >> myagent.snmpwalk

            If device not support SNMP version 2c, replace -v2c with -v1.

          • If you have problems with discovery or poller processes, please do and attach these debugs:

            ./discovery.php -d -h <device>
            ./poller.php -d -h <device>

          • additionally attach device and/or vendor specific MIB files

          This comment is added automatically.

          bot Observium Bot added a comment - General questions and device support can be discussed in our Discord channel, click here to join . Please make and attach additional information about the device: full snmp dump from device: snmpwalk -v2c -c <community> -t 3 -Cc --hexOutputLength=0 -ObentxU <hostname> .1 > myagent.snmpwalk snmpwalk -v2c -c <community> -t 3 -Cc --hexOutputLength=0 -ObentxU <hostname> .1.3.6.1.4.1 >> myagent.snmpwalk If device not support SNMP version 2c, replace -v2c with -v1. If you have problems with discovery or poller processes, please do and attach these debugs: ./discovery.php -d -h <device> ./poller.php -d -h <device> additionally attach device and/or vendor specific MIB files This comment is added automatically.

          People

            adama Adam Armstrong
            nodefield Ilkka Myller
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: