[syslog 4.0] Command not exectuing
bmfmancini opened this issue · 5 comments
bmfmancini commented
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
bmfmancini commented
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
Pull request please.
seanmancini commented
Pull Request submitted #194
TheWitness commented
Did you update the changelog?
seanmancini commented
just pushed a PR now for the changelog