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

PHP Fatal error: Uncaught Error: Call to undefined function str_icontains()

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • None
    • Professional Edition
    • Discovery
    • None

    Description

      When trying to add a Netcomm NF18ACV, I get a fatal error because function str_icontains() does not exist:

      # /opt/observium/add_device.php $IP $COMMUNITY
        Observium 21.5.11365
        Add Device(s)
       
        Try to add ***.***.***.***:
        Trying v2c community *** [0] ...
        +-------------+-----------------------+
        | OID         |                       |
        +-------------+-----------------------+
        | sysDescr    | NF18ACV-NC2-R6B022.EN |
        | sysObjectID | .1.3.6.1.4.1.4413     |
        +-------------+-----------------------+
       
        PHP Fatal error:  Uncaught Error: Call to undefined function str_icontains() in /opt/observium/includes/discovery/os/broadcom.inc.php:21
        Stack trace:
        #0 /opt/observium/includes/functions.inc.php(783): include()
        #1 /opt/observium/includes/entities/device.inc.php(714): get_device_os()
        #2 /opt/observium/includes/entities/device.inc.php(388): create_device()
        #3 /opt/observium/includes/entities/device.inc.php(291): add_device()
        #4 /opt/observium/add_device.php(192): add_device()
        #5 {main}
          thrown in /opt/observium/includes/discovery/os/broadcom.inc.php on line 21
      

      I suggest replacing

      str_icontains('bcm963', $sysDescr)
      

      with

      str_contains('bcm963', strtolower($sysDescr))
      

      or equivalent.

      Attachments

        Activity

          [OBS-3764] PHP Fatal error: Uncaught Error: Call to undefined function str_icontains()
          bot Observium Bot made changes -
          Status Original: Resolved [ 5 ] New: Closed [ 6 ]
          landy Mike Stupalov made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Progress [ 3 ] New: Resolved [ 5 ]

          Tnx, fixed in r11372.

          landy Mike Stupalov added a comment - Tnx, fixed in r11372.
          landy Mike Stupalov made changes -
          Status Original: In Review [ 10101 ] New: In Progress [ 3 ]
          landy Mike Stupalov made changes -
          Status Original: Pending Response [ 10000 ] New: In Review [ 10101 ]
          bwest Bob West made changes -
          Attachment New: myagent.snmpwalk [ 18720 ]
          bot Observium Bot made changes -
          Status Original: Open [ 1 ] New: Pending Response [ 10000 ]
          bwest Bob West created issue -

          Please make and attach additional information about the device:

          • full snmp dump from device:

            snmpwalk -v2c -c <community>  --hexOutputLength=0 -ObentxU <hostname> .1 > myagent.snmpwalk
            snmpwalk -v2c -c <community>  --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

          Note, this comment is added automatically.

          bot Observium Bot added a comment - Please make and attach additional information about the device: full snmp dump from device: snmpwalk -v2c -c <community> --hexOutputLength=0 -ObentxU <hostname> .1 > myagent.snmpwalk snmpwalk -v2c -c <community> --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 Note, this comment is added automatically.

          People

            landy Mike Stupalov
            bwest Bob West
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: