Cacti / plugin_syslog

Syslog Plugin for Cacti
GNU General Public License v2.0
21 stars 16 forks source link

[syslog 4.0] Command not exectuing #193

Closed bmfmancini closed 1 year ago

bmfmancini commented 1 year ago

This seems to be unresolved since https://github.com/Cacti/plugin_syslog/issues/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

bmfmancini commented 1 year ago

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);
                                                }
                                        }
TheWitness commented 1 year ago

Pull request please.

seanmancini commented 1 year ago

Pull Request submitted https://github.com/Cacti/plugin_syslog/pull/194

TheWitness commented 1 year ago

Did you update the changelog?

seanmancini commented 1 year ago

just pushed a PR now for the changelog