Details
-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
None
-
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))
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))
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.
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.