Closed eschoeller closed 7 years ago
I think on this one, you can remove the double quotes on around the tags on your data input method since we do this automatically now. After that, are you still seeing the issue?
Also, expand your text-area above and see if there is a carriage return or line feed in the data input method. That would lead to the issue you mention.
Are the spaces lost on the export or the import?
Here is what it looks like after the export:
<input_string><path_php_binary> -q <path_cacti>/scripts/query_apc_rack_pdu.php <query> <hostname> <snmp_community> <snmp_version> <snmp_port> <snmp_timeout> "<snmp_username>" "<snmp_password>" "<snmp_auth_protocol>" "<snmp_priv_passphrase>" "<snmp_priv_protocol>"</input_string>
So it looks like this is OK, meaning the space is lost upon import
That's what I needed to know. I don't have much time right now for a lot of hunting and pecking. So, any work you all can do to facilitate things is a blessing.
Doing the research this morning, the problem is due to the XML parser that comes with PHP. It strips the spaces after the special characters. I'm going to resolve this for 1.1.26 forward by base64_encoding the input_string instead and detecting it on the import side and decoding. This is the only good way to handle this permanently. I'm also going to be adding a little hack to resolve issues (or attempt to) for people with old templates.
Either way, what was in place before had no hope of working.
Resolved. My prior comments still are relevant for this issue.
I have created a data input method shown here:
<path_php_binary> -q <path_cacti>/scripts/query_apc_rack_pdu.php <query> <hostname> <snmp_community> <snmp_version> <snmp_port> <snmp_timeout> "<snmp_username>" "<snmp_password>" "<snmp_auth_protocol>" "<snmp_priv_passphrase>" "<snmp_priv_protocol>"
I then export it as part of a device template, and re-import it into another instance. Here is what it looks like now:
<path_php_binary> -q <path_cacti>/scripts/query_apc_rack_pdu.php <query> <hostname> <snmp_community> <snmp_version> <snmp_port> <snmp_timeout>"<snmp_username>" "<snmp_password>" "<snmp_auth_protocol>" "<snmp_priv_passphrase>" "<snmp_priv_protocol>"
And in my logs I saw this:
ERROR: Empty result [192.168.1.3]: '/usr/local/php/bin/php -q /cacti/cacti-1.1.24-prod/scripts/query_apc_rack_pdu.php 'PhaseStatusApparentPower' '192.168.1.3' 'something' '2' '161' '1500'"''" "''" "''" "''" "''"'
This seems to be a very minor nuance but I have a mixture of arguments double quoted and not. There is a space before the first argument that is double quoted (snmp_username), separating it from the previous one (snmp_timeout). When the Data Input Method is imported, this space is removed - and of course the command no longer works.