{"action":"created","issue":{"url":"https://api.github.com/repos/Cacti/cacti/issues/2095","repository_url":"https://api.github.com/repos/Cacti/cacti","labels_url":"https://api.github.com/repos/Cacti/cacti/issues/2095/labels{/name}","comments_url":"https://api.github.com/repos/Cacti/cacti/issues/2095/comments","events_url":"https://api.github.com/repos/Cacti/cacti/issues/2095/events","html_url":"https://github.com/Cacti/cacti/issues/2095","id":372259900,"node_id":"MDU6SXNzdWUzNzIyNTk5MDA=","number":2095,"title":"[1.2.0 Beta 1] dsstats errors","user":{"login":"eschoeller","id":12864741,"node_id":"MDQ6VXNlcjEyODY0NzQx","avatar_url":"https://avatars2.githubusercontent.com/u/12864741?v=4","gravatar_id":"","url":"https://api.github.com/users/eschoeller","html_url":"https://github.com/eschoeller","followers_url":"https://api.github.com/users/eschoeller/followers","following_url":"https://api.github.com/users/eschoeller/following{/other_user}","gists_url":"https://api.github.com/users/eschoeller/gists{/gist_id}","starred_url":"https://api.github.com/users/eschoeller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eschoeller/subscriptions","organizations_url":"https://api.github.com/users/eschoeller/orgs","repos_url":"https://api.github.com/users/eschoeller/repos","events_url":"https://api.github.com/users/eschoeller/events{/privacy}","received_events_url":"https://api.github.com/users/eschoeller/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/Cacti/cacti/milestones/1","html_url":"https://github.com/Cacti/cacti/milestone/1","labels_url":"https://api.github.com/repos/Cacti/cacti/milestones/1/labels","id":2239053,"node_id":"MDk6TWlsZXN0b25lMjIzOTA1Mw==","number":1,"title":"Cacti 1.2","description":"This release will incorporate some well needed features that did not make the feature cutoff for 1.0.","creator":{"login":"cigamit","id":957322,"node_id":"MDQ6VXNlcjk1NzMyMg==","avatar_url":"https://avatars1.githubusercontent.com/u/957322?v=4","gravatar_id":"","url":"https://api.github.com/users/cigamit","html_url":"https://github.com/cigamit","followers_url":"https://api.github.com/users/cigamit/followers","following_url":"https://api.github.com/users/cigamit/following{/other_user}","gists_url":"https://api.github.com/users/cigamit/gists{/gist_id}","starred_url":"https://api.github.com/users/cigamit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cigamit/subscriptions","organizations_url":"https://api.github.com/users/cigamit/orgs","repos_url":"https://api.github.com/users/cigamit/repos","events_url":"https://api.github.com/users/cigamit/events{/privacy}","received_events_url":"https://api.github.com/users/cigamit/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":76,"state":"open","created_at":"2017-01-09T23:50:16Z","updated_at":"2018-10-27T12:01:33Z","due_on":null,"closed_at":null},"comments":32,"created_at":"2018-10-20T22:46:56Z","updated_at":"2018-10-30T09:54:14Z","closed_at":null,"author_association":"NONE","body":"<pre>\r\n2018/10/20 16:43:08 - ERROR PHP NOTICE: Undefined offset: 18 in file: /cacti/cacti-1.2.0-beta1-prod/lib/dsstats.php  on line: 299\r\n2018/10/20 16:43:08 - CMDPHP PHP ERROR NOTICE Backtrace:  (/poller_boost.php[153]:dsstats_boost_bottom(), /lib/dsstats.php[727]:dsstats_get_and_store_ds_avgpeak_values(), /lib/dsstats.php[71]:dsstats_obtain_data_source_avgpeak_values(), /lib/dsstats.php[299]:CactiErrorHandler())\r\n2018/10/20 16:43:08 - ERROR PHP NOTICE: Undefined offset: 19 in file: /cacti/cacti-1.2.0-beta1-prod/lib/dsstats.php  on line: 313\r\n2018/10/20 16:43:08 - CMDPHP PHP ERROR NOTICE Backtrace:  (/poller_boost.php[153]:dsstats_boost_bottom(), /lib/dsstats.php[727]:dsstats_get_and_store_ds_avgpeak_values(), /lib/dsstats.php[71]:dsstats_obtain_data_source_avgpeak_values(), /lib/dsstats.php[313]:CactiErrorHandler())\r\n2018/10/20 16:43:08 - ERROR PHP NOTICE: Undefined offset: 19 in file: /cacti/cacti-1.2.0-beta1-prod/lib/dsstats.php  on line: 314\r\n2018/10/20 16:43:08 - CMDPHP PHP ERROR NOTICE Backtrace:  (/poller_boost.php[153]:dsstats_boost_bottom(), /lib/dsstats.php[727]:dsstats_get_and_store_ds_avgpeak_values(), /lib/dsstats.php[71]:dsstats_obtain_data_source_avgpeak_values(), /lib/dsstats.php[314]:CactiErrorHandler())\r\n2018/10/20 16:43:08 - ERROR PHP NOTICE: Undefined offset: 16 in file: /cacti/cacti-1.2.0-beta1-prod/lib/dsstats.php  on line: 298\r\n2018/10/20 16:43:08 - CMDPHP PHP ERROR NOTICE Backtrace:  (/poller_boost.php[153]:dsstats_boost_bottom(), /lib/dsstats.php[727]:dsstats_get_and_store_ds_avgpeak_values(), /lib/dsstats.php[71]:dsstats_obtain_data_source_avgpeak_values(), /lib/dsstats.php[298]:CactiErrorHandler())\r\n2018/10/20 16:43:18 - ERROR PHP NOTICE: Undefined offset: 1 in file: /cacti/cacti-1.2.0-beta1-prod/lib/dsstats.php  on line: 203\r\n2018/10/20 16:43:18 - CMDPHP PHP ERROR NOTICE Backtrace:  (/poller_dsstats.php[202]:dsstats_get_and_store_ds_avgpeak_values(), /lib/dsstats.php[71]:dsstats_obtain_data_source_avgpeak_values(), /lib/dsstats.php[203]:CactiErrorHandler())\r\n</pre>"},"comment":{"url":"https://api.github.com/repos/Cacti/cacti/issues/comments/434237655","html_url":"https://github.com/Cacti/cacti/issues/2095#issuecomment-434237655","issue_url":"https://api.github.com/repos/Cacti/cacti/issues/2095","id":434237655,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNDIzNzY1NQ==","user":{"login":"eschoeller","id":12864741,"node_id":"MDQ6VXNlcjEyODY0NzQx","avatar_url":"https://avatars2.githubusercontent.com/u/12864741?v=4","gravatar_id":"","url":"https://api.github.com/users/eschoeller","html_url":"https://github.com/eschoeller","followers_url":"https://api.github.com/users/eschoeller/followers","following_url":"https://api.github.com/users/eschoeller/following{/other_user}","gists_url":"https://api.github.com/users/eschoeller/gists{/gist_id}","starred_url":"https://api.github.com/users/eschoeller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eschoeller/subscriptions","organizations_url":"https://api.github.com/users/eschoeller/orgs","repos_url":"https://api.github.com/users/eschoeller/repos","events_url":"https://api.github.com/users/eschoeller/events{/privacy}","received_events_url":"https://api.github.com/users/eschoeller/received_events","type":"User","site_admin":false},"created_at":"2018-10-30T09:54:14Z","updated_at":"2018-10-30T09:54:14Z","author_association":"NONE","body":"Yep, I have done something similar within dsstats_rrdtool_execute already:\r\n```\r\nif (substr_count($stdout, 'ERROR')) {\r\n                        cacti_log(\"rrdtool_execute found ERROR for command:\" . $command, true,'DSSTATS');\r\n                        $errortime = microtime();\r\n                        $errorfile = fopen(\"/tmp/rrdexecute.error.$errortime\",\"w\");\r\n                        fwrite($errorfile,$command);\r\n                        fwrite($errorfile,$stdout);\r\n                        fclose($errorfile);\r\n                        break;\r\n                }\r\n```\r\nI also like your approach so I'll switch to that and see if it gains me any more insight on this. \r\n\r\nI also tried to redirect stderr for dsstats_rrdtool_init like this:\r\n```\r\nif ($config['cacti_server_os'] == 'unix') {\r\n                $fds = array(\r\n                        0 => array('pipe', 'r'), // stdin\r\n                        1 => array('pipe', 'w'), // stdout\r\n                        #2 => array('file', '/dev/null', 'a')  // stderr\r\n                        2 => array('file', '/tmp/errors', 'a')  // stderr\r\n                );\r\n        } else {\r\n                $fds = array(\r\n                        0 => array('pipe', 'r'), // stdin\r\n                        1 => array('pipe', 'w'), // stdout\r\n                        #2 => array('file', 'nul', 'a')  // stderr\r\n                        2 => array('file', '/tmp/errors.1', 'a')  // stderr\r\n                );\r\n        }\r\n```\r\nBut I didn't really have any success. /tmp/errors was created, but never got anything. Maybe there was never any stderr output. Any idea what else I could do to capture stderr? "}}
{"actor":{"display_login":"eschoeller"}}