Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script Server should output parameter array rather than parameters #1289

Closed
netniV opened this issue Jan 31, 2018 · 0 comments
Closed

Script Server should output parameter array rather than parameters #1289

netniV opened this issue Jan 31, 2018 · 0 comments

Comments

@netniV
Copy link
Member

netniV commented Jan 31, 2018

When looking at another issue, I noticed that the script server is calling parseArgs() and then logging the output in POLLER_VERBOSITY_DEBUG but uses the following code:

cacti_log("DEBUG: PID[$pid] CTR[$ctr] INC: '". basename($include_file) . "' FUNC: '" .$function . "' PARMS: '" . $parameters . "'", false, 'PHPSVR', POLLER_VERBOSITY_DEBUG);

If you update this to

 cacti_log("DEBUG: PID[$pid] CTR[$ctr] INC: '". basename($include_file) .
         "' FUNC: '$function' PARMS: '" . implode('\', \'',$parameters) .
         '\'', false, 'PHPSVR', POLLER_VERBOSITY_DEBUG);

It would correctly log the parameters as they were parsed rather than the pre-parsed format which may or may not be how the values are sent to the script functions.

netniV added a commit to netniV/cacti that referenced this issue Jan 31, 2018
issue Cacti#1289: Change Script Server to output parameters as returned by parseArgs()
cigamit pushed a commit that referenced this issue Feb 3, 2018
* Fix for Issue #1289 - Change debug log for Script Server
issue #1289: Change Script Server to output parameters as returned by parseArgs()

* Use correct $parameter_array not $parameters
@netniV netniV closed this as completed Feb 3, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant