Cactid limitations w/ script output name/value pairs?

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

Moderators: Developers, Moderators

Post Reply
flundy
Posts: 13
Joined: Wed Oct 13, 2004 3:38 pm

Cactid limitations w/ script output name/value pairs?

Post by flundy »

The cacti documentation mentions that the syntax for script output is:
<name1>:<value1> <name2:value2> ...
It seems that switching to cactid 0.86g that only the first name/value pair is recognized and an error is displayed when cacti is run in debug mode:
CACTID: Host[34] DS[1710] WARNING: Result from SCRIPT not valid. Partial Result: ...
CACTID: Host[34] DS[1710] SCRIPT: /var/xxxstatus.sh buzzsaw.xxx.xxx, output: U
Are there limitations w/ cactid concerning script output?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Hmm, not sure on this. But please verify that your script does exactly one single print, no loop. cactid won't wait until a second, third, ... print is invoked.
Reinhard
flundy
Posts: 13
Joined: Wed Oct 13, 2004 3:38 pm

Post by flundy »

Fairly simple script. I am doing a log rotate nightly, so as bad as this looks, it gets the job done... Sub-second execution.

Code: Select all

grep "SYSTEM STATS:" $1 | \
        tr '[A-Z]' '[a-z]' | \
        tail -1 |\
        awk '{gsub("threads:n/a", "threads:1"); gsub("hostsperprocess", "hostsprocess"); printf("%s %s %s %s %s %s %s %s", $7, $8, $9, $10, $11, $12, $13, $14)}'
Worked fine until cactid.
Last edited by flundy on Fri Feb 03, 2006 11:30 am, edited 2 times in total.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Ah, I'm realizing what you're aiming at. Not the exact solution, but may you please have a look at the solution at http://forums.cacti.net/viewtopic.php?t=9272
Reinhard
flundy
Posts: 13
Joined: Wed Oct 13, 2004 3:38 pm

Post by flundy »

I saw that thread. It looks like a nice graph. However, I have other scripts that were graphing as well. I was using my old poller script as an example.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

What cactid version? Latest cactid requires full paths to be included
Reinhard
flundy
Posts: 13
Joined: Wed Oct 13, 2004 3:38 pm

Post by flundy »

cactid 0.86g according to the tarball name, but the version string compiled in from the src says "0.86f".

I am refering to the following stmt from denow:
If i am not wrong cactid doesn't allow multiple return values. Either u have to rewrite your perl script to return a single value at a time or use cmd.php
in the thread http://forums.cacti.net/viewtopic.php?t ... ial+result .

Witness posted ~3 hrs later and did not correct him. I assumed this lack of correction was intentional.

So, I guess I am looking to see if cactid is missing the feature mentioned in the online docs ( http://www.cacti.net/downloads/docs/htm ... cacti.html ) or if there is some other way to get these multiple name/value pair outputs to work.
flundy
Posts: 13
Joined: Wed Oct 13, 2004 3:38 pm

Post by flundy »

For further understanding, my motivation is that cmd.php pushes the host to a load of 7+ w/ a total polling time of 130 sec or so compared to cactid w/ a load of < 1 and a polling time of 20sec for ~125 devices.
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

The multi output pairs do work in Cactid 0.8.6g. There must be something else going on. It is likely a dangling space at the end of your output. Is there any way for you to "trim" the output string prior to outputting it.

BTB, the Cactid 0.8.6f-g thingy was a mistake by the packager != me. These things happen from time to time.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
flundy
Posts: 13
Joined: Wed Oct 13, 2004 3:38 pm

Post by flundy »

I specifically trimmed dangling spaces and \n from the scripts.

Is cactid 0.86g really supposed to read "0.86f" when requesting a version string? As stated previously, the tarball was named "cacti-cactid-0.8.6g.tar.gz", and came fromthe cactid download pg: http://www.cacti.net/downloads/cactid/c ... .6g.tar.gz.
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

The packager did not run the auto tools to fully remake everything. So, even though it's 0.8.6g, it reports as 0.8.6f.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

I looked at your script and then realized what you were doing. I have a better approach. I will post in a bit. Not on my home PC at the moment.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests