Details

    • Bug
    • Resolution: Fixed
    • Minor
    • None
    • None
    • Scripts
    • None

    Description

      Running discovery.php -h all form the SSH in the Observium server. I get this error below is what I get after running the script

       

      Oops! Something went wrong! You may want to report this to the Observium developers.

      fclose(): Argument #1 ($stream) must be of type resource, bool given in /opt/observium/includes/common.inc.php:626

      Stack trace:

      #0: (unknown function) called at [/opt/observium/includes/common.inc.php:626]
      621: } else {
      622: $fd = fopen($filename, 'wb');
      623: // Check writable file (only after creation for speedup)
      624: if (!is_writable($filename))

      { 625: print_debug("Log file '$filename' is not writable or not created."); 626: fclose($fd); 627: return FALSE; 628: }

      629: }
      630:
      631: //$string = '[' . date('Y/m/d H:i:s O') . '] ' . basename($argv[0]) . '(' . getmypid() . '): ' . trim($string) . PHP_EOL;

      #1: fclose called at [/opt/observium/includes/common.inc.php:626]
      621: } else {
      622: $fd = fopen($filename, 'wb');
      623: // Check writable file (only after creation for speedup)
      624: if (!is_writable($filename))

      { 625: print_debug("Log file '$filename' is not writable or not created."); 626: fclose($fd); 627: return FALSE; 628: }

      629: }
      630:
      631: //$string = '[' . date('Y/m/d H:i:s O') . '] ' . basename($argv[0]) . '(' . getmypid() . '): ' . trim($string) . PHP_EOL;

      #2: logfile called at [/opt/observium/discovery.php:277]
      272: print_warning("WARNING: 0 devices discovered." . ($options['h'] !== 'new' ? " Did you specify a device that does not exist?" : ''));
      273: }
      274:
      275: $string = $argv[0] . ": $doing - $discovered_devices devices discovered in $discovery_time secs";
      276: print_debug($string);
      277: logfile($string);
      278:
      279: // Clean stale observium processes
      280: $process_sql = "SELECT * FROM `observium_processes` WHERE `poller_id` = ? AND `process_start` < ?";
      281: foreach (dbFetchRows($process_sql, [$config['poller_id'], $config['time']['fourhour']]) as $process) {
      282: // We found processes in DB, check if it exist on system

       

       

      This is the first time using this software so I could be doing something wrong but Please let me know if there is anything else you need.

      Attachments

        1. myagent.discovery
          1.01 MB
          William Hardwick
        2. myagent.poller
          1.47 MB
          William Hardwick

        Activity

          [OBS-4631] Run discovery.php -h all

          it's common linux commands. I not know which users you use.

          man chmod
          man chown

          landy Mike Stupalov added a comment - it's common linux commands. I not know which users you use. man chmod man chown

          do you know how to make that directory writeable form a normal user not a root

          william.hardwick@comeausea.com William Hardwick added a comment - do you know how to make that directory writeable form a normal user not a root

          It's not exact critical issue. Log file (or log dir) not writeable for user who run discovery.

          Log file '/opt/observium/logs/observium.log' is not writeable or not created.
          

          But fatal exit fixed in r13033.

          landy Mike Stupalov added a comment - It's not exact critical issue. Log file (or log dir) not writeable for user who run discovery. Log file '/opt/observium/logs/observium.log' is not writeable or not created. But fatal exit fixed in r13033.

          ./poller.php -d -h all > myagent.poller

           

          attach file for this command

           

          myagent.poller

          william.hardwick@comeausea.com William Hardwick added a comment - ./poller.php -d -h all > myagent.poller   attach file for this command   myagent.poller

          ./discovery.php -d -h all > myagent.discovery

           

          attach file myagent.discovery

          william.hardwick@comeausea.com William Hardwick added a comment - ./discovery.php -d -h all > myagent.discovery   attach file  myagent.discovery

          run this command 

          snmpwalk -v2c -c public -t 3 -Cc --hexOutputLength=0 -Ih -ObentxU 192.168.104.156 .1.3.6.1.4.1 > myagent.snmpwalk

           

          add file to this one also [^myagent.snmpwalk]

          william.hardwick@comeausea.com William Hardwick added a comment - run this command  snmpwalk -v2c -c public -t 3 -Cc --hexOutputLength=0 -Ih -ObentxU 192.168.104.156 .1.3.6.1.4.1 > myagent.snmpwalk   add file to this one also [^myagent.snmpwalk]

          run the command below and attache file [^myagent.snmpwalk]

           

          snmpwalk -v2c -c public -t 3 -Cc --hexOutputLength=0 -Ih -ObentxU 192.168.104.85 .1 > myagent.snmpwalk

           

           

          william.hardwick@comeausea.com William Hardwick added a comment - run the command below and attache file [^myagent.snmpwalk]   snmpwalk -v2c -c public -t 3 -Cc --hexOutputLength=0 -Ih -ObentxU 192.168.104.85 .1 > myagent.snmpwalk    

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

            landy Mike Stupalov
            william.hardwick@comeausea.com William Hardwick
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: