Script server and static arg_prepend with quotes

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
SeanW
Posts: 26
Joined: Tue Nov 28, 2006 9:17 am
Location: Winnipeg, Canada
Contact:

Script server and static arg_prepend with quotes

Post by SeanW »

Cacti 0.8.7b on Fedora 9

I have a data query I wrote that's called through the script server. In the XML file I prepend a static string that has a space in it, therefore I quote it:

Code: Select all

 <arg_prepend>|host_hostname| "Cisco H323"</arg_prepend>
The reason I do this is that the same script can serve many different collections (Cisco H323 being a collection)

When I set this up, my script stopped working when called from the script server. Some debugging showed that the "Cisco H323" is being changed to two arguments:

"Cisco
and
H323"

When called outside the script server, either from the command line or a verbose query from the device screen, the script works fine.

On full debugging:

Code: Select all

09/05/2008 01:10:24 PM - PHPSVR: Poller[0] DEBUG: INC: '/usr/share/cacti/scripts/ss_callmanager.php' FUNC: 'ss_callmanager' PARMS: 'X.X.80.17 "Cisco H323" get CallsInProgress X.X.80.22'
09/05/2008 01:10:24 PM - CACTID: Poller[0] Host[340] DS[11597] SS[0] SERVER: /usr/share/cacti/scripts/ss_callmanager.php ss_callmanager X.X.80.17 "Cisco H323" get CallsInProgress X.X.80.22, output: U
Some syslogging within my script shows the parameters are, in order

Code: Select all

X.X.80.17
"Cisco
H323"
get
CallsInProgress
As a result the parameters are off, the data doesn't work.

If I hardcode the "Cisco H323" in my script and remove the prepended value, it works.

http://forums.cacti.net/viewtopic.php?t=27181 seems to be similar, but the string in question dynamic (enclosed in pipes)

Am I passing the string incorrectly? Is there a better way? Is this a bug?

Thanks

Sean
Toddles18
Posts: 22
Joined: Fri Feb 20, 2009 1:28 pm

Re: Script server and static arg_prepend with quotes

Post by Toddles18 »

Technical Support
General Information
Date Wed, 02 Mar 2016 13:35:32 -0500
Cacti Version 0.8.8f
Cacti OS win32
SNMP Version NET-SNMP version: 5.5
RRDTool Version RRDTool 1.4.x
Hosts 4
Graphs 34
Data Sources Script - Script Server (PHP): 16
Script Query - Script Server: 18
Total: 34
Poller Information
Interval 60
Type cmd.php
Items Action[2]: 72
Total: 72
Concurrent Processes 8
Max Threads 4
PHP Servers 4
Script Timeout 25
Max OID 10
Last Run Statistics Time:12.0814 Method:cmd.php Processes:8 Threads:N/A Hosts:5 HostsPerProcess:1 DataSources:72 RRDsProcessed:30
PHP Information
PHP Version 5.5.20
PHP OS WINNT
PHP uname Windows NT MIHQDBMONITOR01 6.3 build 9200 (Windows Server 2012 R2 Standard Edition) AMD64
PHP SNMP Installed
max_execution_time 60
memory_limit 512M
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests