multiple graphs templates using only one data source

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

Moderators: Developers, Moderators

Post Reply
thierrycoopman
Posts: 1
Joined: Fri Jun 04, 2004 11:44 am

multiple graphs templates using only one data source

Post by thierrycoopman »

Hi,

I have search the forum and the docs and the examples, but I can't find info on this.

I use a script command data input method with the following script

Code: Select all

#!/usr/bin/perl

# what server are we polling?
$server=@ARGV[0];

$what=@ARGV[1];

# gather data
@data = `/usr/local/bin/curl -k https://$server/server-status?auto 2> /dev/null`;

if (@data[0] eq "") {
  # Uh oh!  Webserver might be down!
  printf "0";
} else {
          # hits
          @hits = split(/ /, @data[0]);
          chomp(@hits[2]);
          printf "hits:@hits[2] ";
          # calculate bytes
          @bytes = split(/ /, @data[1]);
          chomp(@bytes[2]);
          printf ("bytes:%5.0f ", ((@bytes[2]+0.5) * 1024));
          #calculate concurrent users
          @users = split(/ /, @data[7]);
          chomp(@users[1]);
          printf "users:@users[1] ";
          #calculate idle servers 
          @idle = split(/ /, @data[8]);
          chomp(@idle[1]);
          printf "idle:@idle[1]\n";
}
This script has 1 input (the hostname) and 4 outputs (hits, bytes, users, idle).

I want to create multiple charts with this info, one with hits, one with bytes and one with the combined usage of users and idle.

I create a data template that uses this data input method and has 4 data source items, bytes and hits are DERIVE type, and users and idle are COUNTER type.

I have 3 graphs associated to a host template.


If I create a host of this type and and create all 3 of the graphs, cacti will create 3 times the same data source for this host.

Maybe I missed something here, but I don't know how to tell cacti to use only a single data source for all three graphs...

Can someone help? or do I need to create only multiple data input methods???
[/quote]
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

This is certainly a known issue that needs to be addressed. There are a few things related to data queries at the moment which makes this sort of difficult. I will come up with something though. See the following bug for more information:

http://bugs.cacti.net/bug_view_page.php?bug_id=0000168

-Ian
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests