Cacti/plugin_syslog

[syslog 4.0] Command not exectuing

bmfmancini opened this issue · 5 comments

This seems to be unresolved since #151

The log shows Syslog executes the command but it fails actually to execute the script
I changed the following line in functions.php

exec_background('/bin/sh', $command);

to

exec('/bin/sh', $command);

Command runs fine now

Full blocks


                                        if (trim($alert['command']) != '' && !$ignore) {
                                                $command = alert_replace_variables($alert, $results, $hostname);

                                                cacti_log("SYSLOG NOTICE: Executing '$command'", true, 'SYSTEM');

                                                $cparts = explode(' ', $command);

                                                if (is_executable($cparts[0])) {
                                                        exec($command);
                                                } else {
                                                        exec('/bin/sh', $command);
                                                }
                                        }

Pull request please.

Pull Request submitted #194

Did you update the changelog?

just pushed a PR now for the changelog