Cactid - passing script variable with a space

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
Scusting
Posts: 1
Joined: Fri Jun 16, 2006 6:02 am

Cactid - passing script variable with a space

Post by Scusting »

Hi,

Since upgrading to the latest Cacti & cactid I have found that some of my custom scripts seem to of broken, and it appears to be down to the way cactid is passing variables to my custom script.

My Data input method is using:
<path_cacti>/scripts/intstats.custom <host> <community> <dir> <bits> <ifname> <iftype>

I have added some logging to my script to see what variables it is being passed, and when I run cmd.php as the poller (or cactid on my old cacti server) I get:

$1 = host.domain
$2 = public
$3 = out
$4 = 64
$5 = port ethernet 1/3
$6 = 6

But when I run cactid my script logs the following variables are passed:
$1 = host.domain
$2 = public
$3 = out
$4 = 64
$5 = "port
$6 = ethernet

It seems my script is not getting the second quote around the variable and so interpreting this one variable as mutliple variables. I have tried using double quotes, single quotes and no quotes but I get the same issue each time with cactid.

With cmd.php my script gets the variables fine, but the poller runs out of time due to the number of hosts & checks.

How can I get this to work?

Many Thanks.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

With latest cactid you'll have to apply the /full/path/to/interpreted for all Data Input Methods. E.g. use /bin/sh or the like
Reinhard
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest